From e6f437e6c07c9ba4785116aa98a37abf341effab Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 7 Jun 2026 21:01:40 -0500 Subject: [PATCH] feat(desktop): auto-collapse both sidebars below 600px into hover-reveal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a Pane `forceCollapsed` prop — collapses the track without writing to the store (so the saved open state restores when the window widens) while keeping hoverReveal alive (unlike `disabled`, which suppresses it). desktop-controller watches (max-width: 600px) and force-collapses the chat sidebar + file browser, so on a narrow window both rails get out of the way and the hover-reveal overlay becomes the way in. --- apps/desktop/src/app/desktop-controller.tsx | 7 +++++++ apps/desktop/src/components/pane-shell/pane-shell.tsx | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/app/desktop-controller.tsx b/apps/desktop/src/app/desktop-controller.tsx index 8a9c7e1f319..c6ccce0a46b 100644 --- a/apps/desktop/src/app/desktop-controller.tsx +++ b/apps/desktop/src/app/desktop-controller.tsx @@ -8,6 +8,7 @@ import { DesktopInstallOverlay } from '@/components/desktop-install-overlay' import { DesktopOnboardingOverlay } from '@/components/desktop-onboarding-overlay' import { GatewayConnectingOverlay } from '@/components/gateway-connecting-overlay' import { Pane, PaneMain } from '@/components/pane-shell' +import { useMediaQuery } from '@/hooks/use-media-query' import { useSkinCommand } from '@/themes/use-skin-command' import { formatRefValue } from '../components/assistant-ui/directive-text' @@ -166,6 +167,10 @@ export function DesktopController() { const terminalTakeover = useStore($terminalTakeover) const panesFlipped = useStore($panesFlipped) const profileScope = useStore($profileScope) + // Below 600px there's no room for a docked rail — collapse both sidebars + // (without touching their stored open state) so the hover-reveal overlay + // becomes the way in. Restores to the saved layout once it's wide again. + const narrowViewport = useMediaQuery('(max-width: 600px)') const routedSessionId = routeSessionId(location.pathname) const routeToken = `${location.pathname}:${location.search}:${location.hash}` @@ -848,6 +853,7 @@ export function DesktopController() { ) { const stateOpen = states[pane.id]?.open ?? pane.defaultOpen - const open = !pane.disabled && stateOpen + const open = !pane.disabled && !pane.forceCollapsed && stateOpen if (!open) { return { open: false, track: '0px' }