From 49b2413f030e090faa8532d7cd585e7fd90d03fd Mon Sep 17 00:00:00 2001 From: imbingox Date: Thu, 28 May 2026 11:10:35 +0000 Subject: [PATCH 1/2] Add workspace layout mode preference --- src/app/workspace/layout.tsx | 13 +- .../files/file-workspace-tab-bar.tsx | 3 +- .../settings/general-settings.test.tsx | 135 ++++++++++++++++++ src/components/settings/general-settings.tsx | 59 +++++++- src/contexts/workspace-context.tsx | 19 +++ src/i18n/messages/ar.json | 8 +- src/i18n/messages/de.json | 8 +- src/i18n/messages/en.json | 8 +- src/i18n/messages/es.json | 8 +- src/i18n/messages/fr.json | 8 +- src/i18n/messages/ja.json | 8 +- src/i18n/messages/ko.json | 8 +- src/i18n/messages/pt.json | 8 +- src/i18n/messages/zh-CN.json | 8 +- src/i18n/messages/zh-TW.json | 8 +- src/lib/workspace-layout-mode-storage.test.ts | 24 ++++ src/lib/workspace-layout-mode-storage.ts | 27 ++++ 17 files changed, 345 insertions(+), 15 deletions(-) create mode 100644 src/components/settings/general-settings.test.tsx create mode 100644 src/lib/workspace-layout-mode-storage.test.ts create mode 100644 src/lib/workspace-layout-mode-storage.ts diff --git a/src/app/workspace/layout.tsx b/src/app/workspace/layout.tsx index 42d5cb60..ddb39e75 100644 --- a/src/app/workspace/layout.tsx +++ b/src/app/workspace/layout.tsx @@ -123,7 +123,8 @@ function resolvePanelSizeRange( } function WorkspaceContent({ children }: { children: React.ReactNode }) { - const { mode, setActivePane, filesMaximized } = useWorkspaceContext() + const { mode, layoutMode, setActivePane, filesMaximized } = + useWorkspaceContext() const panelGroupRef = useRef(null) const fusionLayoutRef = useRef<[number, number]>(DEFAULT_FUSION_LAYOUT) const desiredLayoutRef = useRef<[number, number]>(DEFAULT_FUSION_LAYOUT) @@ -160,10 +161,10 @@ function WorkspaceContent({ children }: { children: React.ReactNode }) { }, []) useEffect(() => { - if (mode === "fusion") { + if (mode === "fusion" && layoutMode === "fusion") { applyLayout(fusionLayoutRef.current) } - }, [applyLayout, mode]) + }, [applyLayout, mode, layoutMode]) const handleLayout = useCallback( (layout: number[]) => { @@ -187,6 +188,10 @@ function WorkspaceContent({ children }: { children: React.ReactNode }) { [applyLayout, mode] ) + if (layoutMode === "files" && mode === "fusion") { + return {children} + } + return (
)} - {!isMobile && mode === "fusion" && ( + {!isMobile && mode === "fusion" && layoutMode === "fusion" && (