Skip to content

The agent that grows with you

feat(desktop): give hiding the tab strip a command, and a way back

Brooklyn Nicholson272b007f8c12
diff --git a/apps/desktop/src/app/context-menu/app-context-menu.tsx b/apps/desktop/src/app/context-menu/app-context-menu.tsx
index 17ca30fa38f..afe4ce62ab5 100644
--- a/apps/desktop/src/app/context-menu/app-context-menu.tsx
+++ b/apps/desktop/src/app/context-menu/app-context-menu.tsx
@@ -4,6 +4,7 @@ import { useEffect } from 'react'
import { useNavigate } from 'react-router'
import { terminalMenuHandleFor } from '@/app/right-sidebar/terminal/terminal-context-menu'
+import { toggleTargetZoneTabStrip } from '@/components/pane-shell/tree/store'
import { Codicon } from '@/components/ui/codicon'
import { HERMES_CONTEXT_MENU_TRIGGER_ATTR } from '@/components/ui/context-menu'
import { writeClipboardText } from '@/components/ui/copy-button'
@@ -566,6 +567,15 @@ function shellSections({ navigate, t }: ShellVerbs): ReactNode[][] {
label={t.keybinds.actions['view.toggleStatusbar']}
onSelect={toggleStatusbarVisible}
/>,
+ // The pointer-only way back to a hidden tab strip: right-clicking the
+ // shell reaches this menu from anywhere, including a zone that has no
+ // chrome left to right-click.
+ <Item
+ icon="layout-menubar"
+ key="shell-tabstrip"
+ label={t.keybinds.actions['view.toggleTabStrip']}
+ onSelect={() => void toggleTargetZoneTabStrip()}
+ />,
<Item
icon="settings-gear"
key="shell-settings"
diff --git a/apps/desktop/src/app/contrib/controller.tsx b/apps/desktop/src/app/contrib/controller.tsx
index dc261d19c0b..05a0912dd91 100644
--- a/apps/desktop/src/app/contrib/controller.tsx
+++ b/apps/desktop/src/app/contrib/controller.tsx
@@ -29,7 +29,9 @@ import {
resetLayoutTree,
revealTreePane,
setStripTabHidden,
+ targetZoneTabStripVisible,
togglePaneVisible,
+ toggleTargetZoneTabStrip,
watchContributedPanes
} from '@/components/pane-shell/tree/store'
import { SidebarProvider } from '@/components/ui/sidebar'
@@ -40,7 +42,7 @@ import { registry } from '@/contrib/registry'
import { discoverRuntimePlugins } from '@/contrib/runtime-loader'
import { translateNow } from '@/i18n'
import { NEW_SESSION_TITLE, sessionTitle as storedSessionTitle } from '@/lib/chat-runtime'
-import { Download, FileText, LayoutDashboard, PanelBottom, Terminal, Upload, Zap } from '@/lib/icons'
+import { Download, FileText, LayoutDashboard, PanelBottom, PanelTop, Terminal, Upload, Zap } from '@/lib/icons'
import { type KeybindContribution, KEYBINDS_AREA } from '@/lib/keybinds/actions'
import { TRANSCRIPT_DIRECTIVE_AREA, type TranscriptDirectiveContribution } from '@/lib/transcript-directives'
import { setYoloEnabled } from '@/lib/yolo-session'
@@ -323,6 +325,18 @@ registry.registerMany([
get: () => $statusbarVisible.get(),
set: enabled => $statusbarVisible.set(enabled)
}),
+ paletteToggle({
+ id: 'view.toggleTabStrip',
+ label: 'Toggle tabs',
+ action: 'view.toggleTabStrip',
+ icon: PanelTop,
+ keywords: ['tab strip', 'tab bar', 'tabs', 'header', 'zone', 'hide', 'show', 'chrome'],
+ // On-screen truth for the zone the verbs target, not a stored flag: a zone
+ // on auto has no stored value, and the row must read as "what pressing
+ // this does to what I can see".
+ get: () => Boolean(targetZoneTabStripVisible()),
+ set: () => void toggleTargetZoneTabStrip()
+ }),
// The keybind panel's non-titlebar door (the keyboard icon is gone).
{
id: 'keybinds.panel',
diff --git a/apps/desktop/src/app/hooks/use-keybinds.ts b/apps/desktop/src/app/hooks/use-keybinds.ts
index caa0f9d7bcc..b4a525acf48 100644
--- a/apps/desktop/src/app/hooks/use-keybinds.ts
+++ b/apps/desktop/src/app/hooks/use-keybinds.ts
@@ -11,7 +11,8 @@ import {
cycleTreeTabInFocusedZone,
isPaneVisible,
layoutHasRootSide,
- togglePaneVisible
+ togglePaneVisible,
+ toggleTargetZoneTabStrip
} from '@/components/pane-shell/tree/store'
import { onReleaseTypingFocus } from '@/components/ui/keyboard-first'
import { findBarClaimsCombo } from '@/lib/find-in-page'
@@ -245,6 +246,7 @@ export function useKeybinds(deps: KeybindRuntimeDeps): void {
layoutHasRootSide('right') ? toggleFileBrowserOpen() : togglePaneVisible('terminal'),
'view.toggleReview': toggleReview,
'view.toggleStatusbar': toggleStatusbarVisible,
+ 'view.toggleTabStrip': () => void toggleTargetZoneTabStrip(),
'view.showFiles': showFiles,
'view.showBrowser': openBrowserTab,
'view.toggleHud': () => toggleHud(hudTargetSessionId()),
diff --git a/apps/desktop/src/app/settings/appearance-settings.tsx b/apps/desktop/src/app/settings/appearance-settings.tsx
index b677ae069f2..bd31f043fdc 100644
--- a/apps/desktop/src/app/settings/appearance-settings.tsx
+++ b/apps/desktop/src/app/settings/appearance-settings.tsx
@@ -21,6 +21,7 @@ import { $activeGatewayProfile, $profiles, normalizeProfileKey } from '@/store/p
import { $reactionsEnabled, setReactionsEnabled } from '@/store/reactions-enabled'
import { $reasoningCollapsedByDefault, setReasoningCollapsedByDefault } from '@/store/reasoning-disclosure'
import { $sessionListDensity, type SessionListDensity, setSessionListDensity } from '@/store/session-list-density'
+import { $tabStripDefault, setTabStripDefault, type TabStripDefault } from '@/store/tabstrip-prefs'
import { $toolViewMode, setToolViewMode } from '@/store/tool-view'
import {
$translucency,
@@ -345,6 +346,7 @@ export function AppearanceSettings() {
const toolViewMode = useStore($toolViewMode)
const reasoningCollapsedByDefault = useStore($reasoningCollapsedByDefault)
const sessionListDensity = useStore($sessionListDensity)
+ const tabStripDefault = useStore($tabStripDefault)
const zoomPercent = useStore($zoomPercent)
const embedMode = useStore($embedMode)
const embedAllowed = useStore($embedAllowed)
@@ -423,6 +425,12 @@ export function AppearanceSettings() {
{ id: 'detailed', label: a.sessionDensityDetailed }
] as const satisfies readonly { id: SessionListDensity; label: string }[]
+ const tabStripOptions = [
+ { id: 'auto', label: a.tabStripAuto },
+ { id: 'always', label: a.tabStripAlways },
+ { id: 'never', label: a.tabStripNever }
+ ] as const satisfies readonly { id: TabStripDefault; label: string }[]
+
const embedOptions = [
{ id: 'ask', label: a.embedsAsk },
{ id: 'always', label: a.embedsAlways },
@@ -583,6 +591,21 @@ export function AppearanceSettings() {
title={a.sessionDensityTitle}
/>
+ <ListRow
+ action={
+ <SegmentedControl
+ onChange={id => {
+ triggerHaptic('selection')
+ setTabStripDefault(id)
+ }}
+ options={tabStripOptions}
+ value={tabStripDefault}
+ />
+ }
+ description={a.tabStripDesc}
+ title={a.tabStripTitle}
+ />
+
{/* Linux has neither half of this setting (see TRANSLUCENCY_SUPPORTED),
so the row is absent there rather than offering a dead lever. */}
{TRANSLUCENCY_SUPPORTED && (
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 0ebe1d94bb0..d8926ce09df 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -276,6 +276,7 @@ export const en: Translations = {
'view.toggleRightSidebar': 'Toggle file browser',
'view.toggleReview': 'Toggle review pane',
'view.toggleStatusbar': 'Toggle status bar',
+ 'view.toggleTabStrip': 'Toggle tabs',
'view.showFiles': 'Show file browser',
'view.showBrowser': 'Open browser',
'view.toggleHud': 'Toggle HUD mode',
@@ -516,6 +517,11 @@ export const en: Translations = {
sessionDensityCompact: 'Compact',
sessionDensityComfortable: 'Comfortable',
sessionDensityDetailed: 'Detailed',
+ tabStripTitle: 'Tab Strip',
+ tabStripDesc: 'Show tabs above a zone. Auto hides them when a zone holds a single pane.',
+ tabStripAuto: 'Auto',
+ tabStripAlways: 'Always',
+ tabStripNever: 'Never',
terminalFontTitle: 'Terminal Font',
terminalFontDesc:
'Choose an installed font for Desktop terminals. Nerd Fonts render Powerlevel10k and shell icons; leave blank to use bundled JetBrains Mono.',
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index de86d2e0bdd..5868fca013b 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -340,6 +340,11 @@ export const ja = defineLocale({
sessionDensityCompact: 'コンパクト',
sessionDensityComfortable: '標準',
sessionDensityDetailed: '詳細',
+ tabStripTitle: 'タブバー',
+ tabStripDesc: 'ゾーンの上にタブを表示します。自動ではペインが1つのときに隠します。',
+ tabStripAuto: '自動',
+ tabStripAlways: '常に表示',
+ tabStripNever: '表示しない',
terminalFontTitle: 'ターミナルフォント',
terminalFontDesc:
'Desktop のターミナルで使用するインストール済みフォントを選びます。Nerd Font は Powerlevel10k とシェルアイコンを表示できます。空欄では内蔵の JetBrains Mono を使用します。',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 5716503fb76..61ef0bbc041 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -415,6 +415,11 @@ export interface Translations {
sessionDensityCompact: string
sessionDensityComfortable: string
sessionDensityDetailed: string
+ tabStripTitle: string
+ tabStripDesc: string
+ tabStripAuto: string
+ tabStripAlways: string
+ tabStripNever: string
terminalFontTitle: string
terminalFontDesc: string
terminalFontPlaceholder: string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 2c3513f09b9..b2317b4ea15 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -332,6 +332,11 @@ export const zhHant = defineLocale({
sessionDensityCompact: '緊湊',
sessionDensityComfortable: '舒適',
sessionDensityDetailed: '詳細',
+ tabStripTitle: '分頁列',
+ tabStripDesc: '在分區上方顯示分頁。自動模式會在分區只有一個面板時隱藏分頁。',
+ tabStripAuto: '自動',
+ tabStripAlways: '一律',
+ tabStripNever: '永不',
terminalFontTitle: '終端機字型',
terminalFontDesc:
'選擇已安裝的字型用於桌面端終端機。Nerd Font 可正確顯示 Powerlevel10k 與 Shell 圖示;留空則使用內建的 JetBrains Mono。',
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index db8866b7e32..66585070a42 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -271,6 +271,7 @@ export const zh: Translations = {
'view.toggleRightSidebar': '切换文件浏览器',
'view.toggleReview': '切换审查面板',
'view.toggleStatusbar': '切换状态栏',
+ 'view.toggleTabStrip': '切换标签',
'view.showFiles': '显示文件浏览器',
'view.showBrowser': '打开浏览器',
'view.showTerminal': '显示终端',
@@ -505,6 +506,11 @@ export const zh: Translations = {
sessionDensityCompact: '紧凑',
sessionDensityComfortable: '舒适',
sessionDensityDetailed: '详细',
+ tabStripTitle: '标签栏',
+ tabStripDesc: '在分区上方显示标签。自动模式会在分区只有一个面板时隐藏标签。',
+ tabStripAuto: '自动',
+ tabStripAlways: '始终',
+ tabStripNever: '从不',
terminalFontTitle: '终端字体',
terminalFontDesc:
'选择已安装的字体用于桌面端终端。Nerd Font 可正确显示 Powerlevel10k 和 Shell 图标;留空则使用内置的 JetBrains Mono。',
diff --git a/apps/desktop/src/lib/icons.ts b/apps/desktop/src/lib/icons.ts
index 54cac8d1855..6d20b50d16d 100644
--- a/apps/desktop/src/lib/icons.ts
+++ b/apps/desktop/src/lib/icons.ts
@@ -86,6 +86,7 @@ import {
IconPalette as Palette,
IconLayoutBottombar as PanelBottom,
IconLayoutSidebar as PanelLeftIcon,
+ IconLayoutNavbar as PanelTop,
IconPlayerPause as Pause,
IconPaw as PawPrint,
IconPencil as Pencil,
@@ -215,6 +216,7 @@ export {
Palette,
PanelBottom,
PanelLeftIcon,
+ PanelTop,
Pause,
PawPrint,
Pencil,
diff --git a/apps/desktop/src/lib/keybinds/actions.ts b/apps/desktop/src/lib/keybinds/actions.ts
index fd9527df191..f6bd021573a 100644
--- a/apps/desktop/src/lib/keybinds/actions.ts
+++ b/apps/desktop/src/lib/keybinds/actions.ts
@@ -122,6 +122,12 @@ export const KEYBIND_ACTIONS: readonly KeybindActionMeta[] = [
// gap in their View family) and Hermes has no chord dispatcher, so this
// takes the nearest free single combo instead of a ⌘K ⌘S two-stroke.
{ id: 'view.toggleStatusbar', category: 'view', defaults: ['mod+shift+s'] },
+ // ⌥⌘T — "t" for tabs, reaching past ⇧ because ⌘⇧T is reopen-closed-tab
+ // everywhere. Ships BOUND, unlike VS Code's settings-only tab-bar switch:
+ // here the hide can take away every other affordance the zone had, so the
+ // way back has to already exist. (⌥+letter emits a symbol on macOS; the
+ // binding resolves through KeyT via comboFromEvent's `event.code` fallback.)
+ { id: 'view.toggleTabStrip', category: 'view', defaults: ['mod+alt+t'] },
// ⌘G — "g" for git; the review pane is the source-control view.
{ id: 'view.toggleReview', category: 'view', defaults: ['mod+g'] },
{ id: 'view.showFiles', category: 'view', defaults: [] },