Repository navigation
feat(app): add a sidebar toggle for vertical tabs - #55646
Conversation
There was a problem hiding this comment.
I've only reviewed the code and type-checked it. bun typecheck passes in packages/app, but I couldn't run the app here (no browser or desktop build), so before/after screenshots or a short video of open and close on macOS and Windows would help.
Public API: unchanged. The change adds an app-local persisted setting, appearance.sidebarOpen (optional, defaults to open), and a sidebar.toggle command (mod+shift+b). Neither touches the SDK, the server, the plugin API or the CLI.
Concerns:
- No way to reopen the sidebar outside sessions (macOS, Linux, web). The only on-screen toggle for a closed sidebar is the session header slot. Home, the new-session draft screen, Settings and session views without a header have none, so mouse users are left with only the shortcut or the command palette. On macOS the traffic lights also land on those screens' content. See the inline comment.
- The View → Toggle Sidebar menu item (
desktop-menu.ts, #55536) now works in vertical tabs mode. In the default horizontal layout it still does nothing, because the command is only registered whenverticalTabs()is true.
Related: #55536
| mac() ? macTrafficLightsBaseWidth / (platform.webviewZoom?.() ?? 1) - sessionHeaderStart + slotWidth : slotWidth | ||
|
|
||
| return ( | ||
| <Show when={desktop() && !windows() && settings.appearance.tabLayout() === "vertical"}> |
There was a problem hiding this comment.
This slot only renders through SessionTitleHeader, so it only shows on session views that have a header. On /, /settings and /new-session, and on session views with hideHeader or no title, a closed sidebar has no visible toggle on macOS, Linux or web; only mod+shift+b or the command palette brings it back. On macOS, closing the sidebar also takes away the traffic-light clearance on those screens. Could the closed-state toggle (and the traffic-light inset) live somewhere route-independent, e.g. the shell's main pane, rather than in the session header?
Summary
In vertical tabs mode, the sidebar can now be collapsed and reopened.
sidebar.togglecommand (mod+shift+b) and toggle button open and close the vertical tabs sidebar. The state is saved asappearance.sidebarOpenand defaults to open.lg, and the narrow settings nav) reserve its space and slide their contents along with it.Before / After
Desktop web, 1280×720, vertical tabs.
Testing
packages/app:bun typecheckpackages/app:e2e/regression/tabs.spec.ts(new case: the collapsed sidebar reopens from Home, new session, settings, and a session), plus the home, settings, session-header, and new-session suitesAdded by the opencode bot (AI-generated).
Related: #55536