From d617910eb14ff4db472398f2f8a3e4be11151009 Mon Sep 17 00:00:00 2001 From: sajjad isvand Date: Sat, 4 Jul 2026 23:33:38 +0330 Subject: [PATCH 1/4] remove mini-apps from cache --- background/cache.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/background/cache.ts b/background/cache.ts index 70aaeb7b..3490dd65 100644 --- a/background/cache.ts +++ b/background/cache.ts @@ -11,7 +11,6 @@ const allowedPaths = [ '/contents', '/extension/notifications', '/extension/searchbox', - '/mini-apps', '/searchbox', '/weather', ] From 61ff24f8fbf1fc29a0339cd68691b626cd07c0c1 Mon Sep 17 00:00:00 2001 From: sajjad isvand Date: Sat, 4 Jul 2026 23:59:38 +0330 Subject: [PATCH 2/4] fix --- src/context/appearance.context.tsx | 11 +++++++---- src/layouts/navbar/components/settingsDropdown.tsx | 11 ++++------- src/layouts/navbar/navbar.layout.tsx | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/context/appearance.context.tsx b/src/context/appearance.context.tsx index e2f800ea..0b549fad 100644 --- a/src/context/appearance.context.tsx +++ b/src/context/appearance.context.tsx @@ -99,7 +99,10 @@ export function AppearanceProvider({ children }: { children: React.ReactNode }) (event.ctrlKey || event.metaKey) ) { event.preventDefault() - setUI(settings.ui === UI.ADVANCED ? UI.SIMPLE : UI.ADVANCED) + setUI( + settings.ui === UI.ADVANCED ? UI.SIMPLE : UI.ADVANCED, + isAuthenticated + ) } } @@ -142,8 +145,8 @@ export function AppearanceProvider({ children }: { children: React.ReactNode }) Analytics.event(`set_content_alignment_${value}`) } - const setUI = async (ui: UI) => { - if (!isAuthenticated) + const setUI = async (ui: UI, isAuth: boolean) => { + if (!isAuth) return showToast( 'برای استفاده از این حالت، باید وارد حساب کاربری خود شوید!', 'error' @@ -181,7 +184,7 @@ export function AppearanceProvider({ children }: { children: React.ReactNode }) setFontFamily, canReOrderWidget, ui: settings.ui, - setUI: setUI, + setUI: (val) => setUI(val, isAuthenticated), toggleCanReOrderWidget, setContentAlignment, } diff --git a/src/layouts/navbar/components/settingsDropdown.tsx b/src/layouts/navbar/components/settingsDropdown.tsx index e0592ec9..5bee1cf9 100644 --- a/src/layouts/navbar/components/settingsDropdown.tsx +++ b/src/layouts/navbar/components/settingsDropdown.tsx @@ -6,12 +6,9 @@ import { Icon } from '@/src/icons' import { useAuth } from '@/context/auth.context' import { Dropdown } from '@/components/dropdown' -interface SettingsProps { - setShowSettings: (value: boolean) => void -} -export const SettingsDropdown = ({ setShowSettings }: SettingsProps) => { +export const SettingsDropdown = () => { const { isAuthenticated } = useAuth() - const { canReOrderWidget, toggleCanReOrderWidget, ui } = useAppearanceSetting() + const { canReOrderWidget, toggleCanReOrderWidget, ui, setUI } = useAppearanceSetting() const triggerRef = useRef(null) const handleWidgetSettingsClick = useCallback(() => { @@ -20,7 +17,7 @@ export const SettingsDropdown = ({ setShowSettings }: SettingsProps) => { }, []) const handleSettingsClick = useCallback(() => { - setShowSettings(true) + callEvent('openSettings', 'general') callEvent('closeAllDropdowns') }, []) @@ -34,7 +31,7 @@ export const SettingsDropdown = ({ setShowSettings }: SettingsProps) => { } const onClickToChangeUI = () => { - callEvent('ui_change', ui === 'SIMPLE' ? UI.ADVANCED : UI.SIMPLE) + setUI(ui === 'SIMPLE' ? UI.ADVANCED : UI.SIMPLE) } const onClickToOpenGallery = () => { diff --git a/src/layouts/navbar/navbar.layout.tsx b/src/layouts/navbar/navbar.layout.tsx index f5189669..a5b32776 100644 --- a/src/layouts/navbar/navbar.layout.tsx +++ b/src/layouts/navbar/navbar.layout.tsx @@ -92,7 +92,7 @@ export function NavbarLayout(): JSX.Element { const { user } = useAuth() const [tab, setTab] = useState(null) const handleOpenSettings = useCallback((tabName: string | null) => { - if (tabName) setTab(tabName) + setTab(tabName) setShowSettings(true) }, []) @@ -201,7 +201,7 @@ export function NavbarLayout(): JSX.Element { - + From 9f403a10eda2709a90feb352dab2a11a79bacded Mon Sep 17 00:00:00 2001 From: sajjad isvand Date: Sun, 5 Jul 2026 18:20:45 +0330 Subject: [PATCH 3/4] improve habit item --- src/layouts/widgets/habit/components/item/habit.item.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layouts/widgets/habit/components/item/habit.item.tsx b/src/layouts/widgets/habit/components/item/habit.item.tsx index ac573247..713c244d 100644 --- a/src/layouts/widgets/habit/components/item/habit.item.tsx +++ b/src/layouts/widgets/habit/components/item/habit.item.tsx @@ -52,9 +52,9 @@ export function HabitItem({ habit, today, onChanged, onViewDetails }: HabitItemP return (
-
+
-
+

{habit.title}

From 83b9a5228cef4e6ec38066cd914403622a2ace7b Mon Sep 17 00:00:00 2001 From: sajjad isvand Date: Sun, 5 Jul 2026 18:45:03 +0330 Subject: [PATCH 4/4] feat(simplify): replace notes and network tabs with habit tab --- src/layouts/simplify/tools-simplify.tsx | 34 ++++++------------- .../simplify/widgets/habit-simplify.tsx | 9 +++++ src/layouts/widgets/habit/habits.layout.tsx | 6 ++-- 3 files changed, 23 insertions(+), 26 deletions(-) create mode 100644 src/layouts/simplify/widgets/habit-simplify.tsx diff --git a/src/layouts/simplify/tools-simplify.tsx b/src/layouts/simplify/tools-simplify.tsx index a6e71e4d..8eec2716 100644 --- a/src/layouts/simplify/tools-simplify.tsx +++ b/src/layouts/simplify/tools-simplify.tsx @@ -13,24 +13,18 @@ const Calendar = React.lazy(() => })) ) -const NetworkSimplify = React.lazy(() => - import('./widgets/network-simplify').then((module) => ({ - default: module.NetworkSimplify, - })) -) - -const NotesLayout = React.lazy(() => - import('../widgets/notes/notes.layout').then((module) => ({ - default: module.NotesLayout, - })) -) - const ArzSimplify = React.lazy(() => import('./widgets/arz-simplify').then((module) => ({ default: module.ArzSimplify, })) ) +const Habit = React.lazy(() => + import('./widgets/habit-simplify').then((module) => ({ + default: module.HabitSimplify, + })) +) + const NewsSimplify = React.lazy(() => import('./widgets/news-simplify').then((module) => ({ default: module.NewsSimplify, @@ -45,18 +39,18 @@ const tabs = [ element: TodosLayout, }, { - id: 'notes', - label: 'یادداشت', - icon: , - element: NotesLayout, + id: 'habit', + label: 'عادت ها', + icon: , + element: Habit, }, + { id: 'calendar', label: 'تقویم', icon: , element: Calendar, }, - { id: 'currency', label: 'ارزها', @@ -69,12 +63,6 @@ const tabs = [ icon: , element: NewsSimplify, }, - { - id: 'network', - label: 'شبکه', - icon: , - element: NetworkSimplify, - }, ] type TabId = string diff --git a/src/layouts/simplify/widgets/habit-simplify.tsx b/src/layouts/simplify/widgets/habit-simplify.tsx new file mode 100644 index 00000000..4bb9f168 --- /dev/null +++ b/src/layouts/simplify/widgets/habit-simplify.tsx @@ -0,0 +1,9 @@ +import { HabitsContent } from '@/layouts/widgets/habit/habits.layout' + +export function HabitSimplify() { + return ( +
+ +
+ ) +} diff --git a/src/layouts/widgets/habit/habits.layout.tsx b/src/layouts/widgets/habit/habits.layout.tsx index 6229d72e..e6f1c724 100644 --- a/src/layouts/widgets/habit/habits.layout.tsx +++ b/src/layouts/widgets/habit/habits.layout.tsx @@ -94,7 +94,7 @@ export function HabitsContent() { const isWaiting = isLoading || isRefetching return ( - <> +
@@ -166,7 +166,7 @@ export function HabitsContent() {
) }