diff --git a/packages/webui/components/share-manager.tsx b/packages/webui/components/share-manager.tsx index 270acb91..883f373a 100644 --- a/packages/webui/components/share-manager.tsx +++ b/packages/webui/components/share-manager.tsx @@ -86,8 +86,8 @@ export default function ShareManager({ const [rightSidebarWidth, setRightSidebarWidth] = useState(360) const { - fileListLeftSidebarCollapsed: isLeftSidebarCollapsed, - fileListRightSidebarCollapsed: isRightSidebarCollapsed, + shareConfigLeftSidebarCollapsed: isLeftSidebarCollapsed, + shareConfigRightSidebarCollapsed: isRightSidebarCollapsed, viewModes, } = useUiStore() diff --git a/packages/webui/components/top-nav.tsx b/packages/webui/components/top-nav.tsx index 7717642c..67f4d004 100644 --- a/packages/webui/components/top-nav.tsx +++ b/packages/webui/components/top-nav.tsx @@ -27,23 +27,33 @@ export function TopNav() { const isFileView = !!fileId + const isShareConfig = !!shareId && !isFileView + const isLeftSidebarCollapsed = isFileView ? uiStore.fileViewLeftSidebarCollapsed - : uiStore.fileListLeftSidebarCollapsed + : isShareConfig + ? uiStore.shareConfigLeftSidebarCollapsed + : uiStore.fileListLeftSidebarCollapsed const onLeftSidebarToggle = isPublic ? undefined : () => isFileView ? uiStore.setFileViewLeftSidebarCollapsed(!uiStore.fileViewLeftSidebarCollapsed) - : uiStore.setFileListLeftSidebarCollapsed(!uiStore.fileListLeftSidebarCollapsed) + : isShareConfig + ? uiStore.setShareConfigLeftSidebarCollapsed(!uiStore.shareConfigLeftSidebarCollapsed) + : uiStore.setFileListLeftSidebarCollapsed(!uiStore.fileListLeftSidebarCollapsed) const isRightSidebarCollapsed = isFileView ? uiStore.fileViewRightSidebarCollapsed - : uiStore.fileListRightSidebarCollapsed + : isShareConfig + ? uiStore.shareConfigRightSidebarCollapsed + : uiStore.fileListRightSidebarCollapsed const onRightSidebarToggle = () => isFileView ? uiStore.setFileViewRightSidebarCollapsed(!uiStore.fileViewRightSidebarCollapsed) - : uiStore.setFileListRightSidebarCollapsed(!uiStore.fileListRightSidebarCollapsed) + : isShareConfig + ? uiStore.setShareConfigRightSidebarCollapsed(!uiStore.shareConfigRightSidebarCollapsed) + : uiStore.setFileListRightSidebarCollapsed(!uiStore.fileListRightSidebarCollapsed) const displayStyle = projectId ? (uiStore.viewModes[projectId] ?? 'card') : 'card' const onDisplayStyleChange = isPublic diff --git a/packages/webui/routes/projects/$projectId/shares/index.tsx b/packages/webui/routes/projects/$projectId/shares/index.tsx index b74b7fc3..b2f83e29 100644 --- a/packages/webui/routes/projects/$projectId/shares/index.tsx +++ b/packages/webui/routes/projects/$projectId/shares/index.tsx @@ -65,8 +65,8 @@ function SharesPage() { const [leftSidebarWidth, setLeftSidebarWidth] = useState(240) const { - fileListLeftSidebarCollapsed: isLeftSidebarCollapsed, - setFileListLeftSidebarCollapsed: setIsLeftSidebarCollapsed, + shareConfigLeftSidebarCollapsed: isLeftSidebarCollapsed, + setShareConfigLeftSidebarCollapsed: setIsLeftSidebarCollapsed, } = useUiStore() const { diff --git a/packages/webui/stores/ui.ts b/packages/webui/stores/ui.ts index 029c1a2f..300450e0 100644 --- a/packages/webui/stores/ui.ts +++ b/packages/webui/stores/ui.ts @@ -14,6 +14,12 @@ interface UiState { fileListRightSidebarCollapsed: boolean setFileListRightSidebarCollapsed: (collapsed: boolean) => void + shareConfigLeftSidebarCollapsed: boolean + setShareConfigLeftSidebarCollapsed: (collapsed: boolean) => void + + shareConfigRightSidebarCollapsed: boolean + setShareConfigRightSidebarCollapsed: (collapsed: boolean) => void + viewModes: { [projectId: string]: 'card' | 'list' } setViewMode: (projectId: string, mode: 'card' | 'list') => void } @@ -37,6 +43,14 @@ export const useUiStore = create()( setFileListRightSidebarCollapsed: (collapsed) => set({ fileListRightSidebarCollapsed: collapsed }), + shareConfigLeftSidebarCollapsed: false, + setShareConfigLeftSidebarCollapsed: (collapsed) => + set({ shareConfigLeftSidebarCollapsed: collapsed }), + + shareConfigRightSidebarCollapsed: false, + setShareConfigRightSidebarCollapsed: (collapsed) => + set({ shareConfigRightSidebarCollapsed: collapsed }), + viewModes: {}, setViewMode: (projectId, mode) => set((state) => ({