diff --git a/apps/x/apps/renderer/src/App.tsx b/apps/x/apps/renderer/src/App.tsx index b810af9b..e18c9d47 100644 --- a/apps/x/apps/renderer/src/App.tsx +++ b/apps/x/apps/renderer/src/App.tsx @@ -2748,6 +2748,7 @@ function App() { : null const isRightPaneContext = Boolean(selectedPath || isGraphOpen) const isRightPaneOnlyMode = isRightPaneContext && isChatSidebarOpen && isRightPaneMaximized + const shouldCollapseLeftPane = isRightPaneOnlyMode const openMarkdownTabs = React.useMemo(() => { const markdownTabs = fileTabs.filter(tab => tab.path.endsWith('.md')) if (selectedPath?.endsWith('.md')) { @@ -2843,9 +2844,13 @@ function App() { backgroundTasks={backgroundTasks} selectedBackgroundTask={selectedBackgroundTask} /> - {!isRightPaneOnlyMode && ( setActiveShortcutPane('left')} onFocusCapture={() => setActiveShortcutPane('left')} > @@ -3136,7 +3141,6 @@ function App() { )} - )} {/* Chat sidebar - shown when viewing files/graph */} {isRightPaneContext && ( diff --git a/apps/x/apps/renderer/src/components/chat-sidebar.tsx b/apps/x/apps/renderer/src/components/chat-sidebar.tsx index 1e8610dd..05e498f7 100644 --- a/apps/x/apps/renderer/src/components/chat-sidebar.tsx +++ b/apps/x/apps/renderer/src/components/chat-sidebar.tsx @@ -154,6 +154,8 @@ export function ChatSidebar({ const paneRef = useRef(null) const startXRef = useRef(0) const startWidthRef = useRef(0) + const prevIsMaximizedRef = useRef(isMaximized) + const justToggledMaximize = prevIsMaximizedRef.current !== isMaximized const getMaxAllowedWidth = useCallback(() => { if (typeof window === 'undefined') return MAX_WIDTH @@ -183,6 +185,10 @@ export function ChatSidebar({ setShowContent(false) }, [isOpen]) + useEffect(() => { + prevIsMaximizedRef.current = isMaximized + }, [isMaximized]) + useEffect(() => { if (typeof window === 'undefined') return try { @@ -343,7 +349,7 @@ export function ChatSidebar({ onFocusCapture={onActivate} className={cn( 'relative flex min-w-0 flex-col overflow-hidden border-l border-border bg-background', - !isResizing && 'transition-[width] duration-200 ease-linear' + !isResizing && !justToggledMaximize && 'transition-[width] duration-200 ease-linear' )} style={paneStyle} >