diff options
| author | Fuwn <[email protected]> | 2026-02-07 05:25:30 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-07 05:25:30 -0800 |
| commit | e30e7b30850de620b3274d204df1f2b6090389b2 (patch) | |
| tree | d01eacd413029c885f6b11709efbbd193be048f7 /apps/web/lib/stores | |
| parent | fix: reset sidebar to midpoint of min/max, detail to 50/50 split (diff) | |
| download | asa.news-e30e7b30850de620b3274d204df1f2b6090389b2.tar.xz asa.news-e30e7b30850de620b3274d204df1f2b6090389b2.zip | |
fix: reset panel sizes without page reload, prevent partial-data max width clamping
Use imperative groupRef API to resize panels instantly instead of
writing to localStorage and calling window.location.reload(). Register
reset callbacks in Zustand store from layout components.
Change sidebarMaxWidth early return from && to || so the generous 35%
fallback is used until both subscriptions and custom feeds have loaded,
preventing intermittent clamping to minimum size.
Diffstat (limited to 'apps/web/lib/stores')
| -rw-r--r-- | apps/web/lib/stores/user-interface-store.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/web/lib/stores/user-interface-store.ts b/apps/web/lib/stores/user-interface-store.ts index 5890167..01dceba 100644 --- a/apps/web/lib/stores/user-interface-store.ts +++ b/apps/web/lib/stores/user-interface-store.ts @@ -44,6 +44,8 @@ interface UserInterfaceState { isShortcutsDialogOpen: boolean expandedFolderIdentifiers: string[] navigableEntryIdentifiers: string[] + resetSidebarLayout: (() => void) | null + resetDetailLayout: (() => void) | null toggleSidebar: () => void setSidebarCollapsed: (isCollapsed: boolean) => void @@ -67,6 +69,8 @@ interface UserInterfaceState { toggleShortcutsDialog: () => void toggleFolderExpansion: (folderIdentifier: string) => void setNavigableEntryIdentifiers: (identifiers: string[]) => void + setResetSidebarLayout: (callback: (() => void) | null) => void + setResetDetailLayout: (callback: (() => void) | null) => void } export const useUserInterfaceStore = create<UserInterfaceState>()( @@ -92,6 +96,8 @@ export const useUserInterfaceStore = create<UserInterfaceState>()( isShortcutsDialogOpen: false, expandedFolderIdentifiers: [], navigableEntryIdentifiers: [], + resetSidebarLayout: null, + resetDetailLayout: null, toggleSidebar: () => set((state) => ({ isSidebarCollapsed: !state.isSidebarCollapsed })), @@ -155,6 +161,12 @@ export const useUserInterfaceStore = create<UserInterfaceState>()( setNavigableEntryIdentifiers: (identifiers) => set({ navigableEntryIdentifiers: identifiers }), + + setResetSidebarLayout: (callback) => + set({ resetSidebarLayout: callback }), + + setResetDetailLayout: (callback) => + set({ resetDetailLayout: callback }), }), { name: "asa-news-ui-preferences", |