Skip to content

The agent that grows with you

feat(desktop): tier the chrome so Simple hides the instrumentation

brooklyn!107c67cad221
diff --git a/apps/desktop/src/app/chat/composer/index.tsx b/apps/desktop/src/app/chat/composer/index.tsx
index 9d2a953f1df..5b16bbf6e9f 100644
--- a/apps/desktop/src/app/chat/composer/index.tsx
+++ b/apps/desktop/src/app/chat/composer/index.tsx
@@ -32,6 +32,7 @@ import { browseBackward, browseForward, deriveUserHistory, isBrowsingHistory } f
import { POPOUT_WIDTH_REM } from '@/store/composer-popout'
import { parkQueuedPrompts, removeQueuedPrompt, unparkQueuedPrompts } from '@/store/composer-queue'
import { $hudMode } from '@/store/hud'
+import { $showsAdvancedChrome } from '@/store/interface-mode'
import { sessionBlockingPrompt } from '@/store/prompts'
import { toggleReview } from '@/store/review'
import { $gatewayState } from '@/store/session'
@@ -219,6 +220,10 @@ export function ChatBar({
const onboardingThreadIds = useStore($chatOnboardingThreadIds)
const chatOnboardingSolo = useStore($chatOnboardingSolo)
const guidedChat = chatOnboardingSolo || (sessionId != null && onboardingThreadIds.includes(sessionId))
+ // The git row (branch / worktree / PR / review) is the coding instrument the
+ // guide already hides; Simple mode hides it for the same reason, everywhere.
+ const showsAdvancedChrome = useStore($showsAdvancedChrome)
+ const codingRowShown = !guidedChat && showsAdvancedChrome
const composerTourMarker = useTourMarker('composer')
@@ -1438,7 +1443,7 @@ export function ChatBar({
ref={composerSurfaceRef}
>
<div aria-hidden className={composerInputBacking} />
- {!guidedChat && (
+ {codingRowShown && (
<StatusDrawerContent collapsed={statusDrawerCollapsed} id={codingDrawerId}>
<CodingStatusRow
onBranchOff={handleBranchOff}
diff --git a/apps/desktop/src/app/chat/composer/status-stack/index.tsx b/apps/desktop/src/app/chat/composer/status-stack/index.tsx
index 5ead6286bee..8f9da916d52 100644
--- a/apps/desktop/src/app/chat/composer/status-stack/index.tsx
+++ b/apps/desktop/src/app/chat/composer/status-stack/index.tsx
@@ -30,6 +30,7 @@ import {
stopBackgroundProcess
} from '@/store/composer-status'
import { $freeTierRoute, $freeTierStatus, freeTierStripPending } from '@/store/free-tier'
+import { $interfaceMode, shownInMode, type Tiered } from '@/store/interface-mode'
import { $previewStatusBySession, dismissPreviewArtifact } from '@/store/preview-status'
import { $sessionControlBySession, refreshSessionControl } from '@/store/session-control'
import { $threadScrolledUpBySession } from '@/store/thread-scroll'
@@ -60,6 +61,15 @@ const GROUP_ICON: Record<StatusGroup['type'], string> = {
background: 'server-process'
}
+// Goals and todos are the plan the user is following; subagents and background
+// processes are how Hermes is executing it. Simple mode shows the plan only.
+const GROUP_TIER: Record<StatusGroup['type'], Tiered> = {
+ goal: {},
+ todo: {},
+ subagent: { tier: 'advanced' },
+ background: { tier: 'advanced' }
+}
+
const groupLabel = (group: StatusGroup, s: Translations['statusStack']) => {
if (group.type === 'goal') {
const status = group.items[0]?.goalStatus
@@ -99,7 +109,11 @@ export function ComposerStatusStack({ onSubmit, queue, sessionId }: ComposerStat
const { t } = useI18n()
const navigate = useNavigate()
const storedSessionId = useStore(useSessionView().$storedId)
- useSubagentSnapshot(sessionId)
+ const interfaceMode = useStore($interfaceMode)
+ const shown = useMemo(() => shownInMode(interfaceMode), [interfaceMode])
+ // Hydrate always (delegate cards and session dots read the same store after
+ // a reload); keep POLLING only while the subagent group is on the shelf.
+ useSubagentSnapshot(sessionId, shown(GROUP_TIER.subagent))
// Subscribe to THIS session's slice only. Both maps churn on other
// sessions' activity (subagent ticks, background polls, preview updates in
// any tile); a whole-map `useStore` re-rendered every mounted stack — one
@@ -127,15 +141,17 @@ export function ComposerStatusStack({ onSubmit, queue, sessionId }: ComposerStat
const isStructuredSupported = controlEntry?.capability === 'supported'
- const groups = useMemo(() => {
- const raw = groupStatusItems(items)
+ // Every group, before the shelf decides what to SHOW: whether a dev server is
+ // running is a fact about the session (it keeps its localhost preview chip
+ // alive) even when Simple keeps the background group itself off screen.
+ const allGroups = useMemo(() => groupStatusItems(items), [items])
- if (isStructuredSupported) {
- return raw.filter(g => g.type !== 'goal')
- }
+ const hasRunningBackground = allGroups.some(g => g.type === 'background' && g.items.some(i => i.state === 'running'))
- return raw
- }, [items, isStructuredSupported])
+ const groups = useMemo(
+ () => allGroups.filter(group => shown(GROUP_TIER[group.type]) && (group.type !== 'goal' || !isStructuredSupported)),
+ [allGroups, isStructuredSupported, shown]
+ )
// Seed from the registry on session open; event-driven refreshes (terminal /
// process tool completions) live in use-message-stream. This must NOT reset
@@ -152,8 +168,6 @@ export function ComposerStatusStack({ onSubmit, queue, sessionId }: ComposerStat
}
}, [sessionId])
- const hasRunningBackground = groups.some(g => g.type === 'background' && g.items.some(i => i.state === 'running'))
-
// Drop localhost previews once no dev server is left running — that's what made
// dead `localhost:5174` chips stick around. On-disk file previews are kept.
const visiblePreviews = previews.filter(item => hasRunningBackground || !isLocalhostPreview(item.target))
diff --git a/apps/desktop/src/app/chat/composer/status-stack/use-subagent-snapshot.ts b/apps/desktop/src/app/chat/composer/status-stack/use-subagent-snapshot.ts
index d8564fde826..67a2a46ca2a 100644
--- a/apps/desktop/src/app/chat/composer/status-stack/use-subagent-snapshot.ts
+++ b/apps/desktop/src/app/chat/composer/status-stack/use-subagent-snapshot.ts
@@ -10,8 +10,10 @@ export const rejectUnownedSubagentRequest = async <T>(): Promise<T> => {
throw new Error('Subagent owner unavailable')
}
-/** Hydrate even an empty composer; live events remain authoritative over reads. */
-export function useSubagentSnapshot(sessionId: string | null) {
+/** Hydrate even an empty composer; live events remain authoritative over reads.
+ * `poll` keeps the 5s safety-net refresh — off when nothing on screen shows
+ * the answer, the one-shot hydrate still lands. */
+export function useSubagentSnapshot(sessionId: string | null, poll = true) {
const gatewayState = useStore($gatewayState)
const paneVisible = usePaneVisible()
useEffect(() => {
@@ -61,6 +63,12 @@ export function useSubagentSnapshot(sessionId: string | null) {
void refresh()
+ if (!poll) {
+ return () => {
+ cancelled = true
+ }
+ }
+
const timer = window.setInterval(() => {
if (document.visibilityState === 'visible') {
void refresh()
@@ -79,5 +87,5 @@ export function useSubagentSnapshot(sessionId: string | null) {
window.clearInterval(timer)
window.removeEventListener('focus', retry)
}
- }, [sessionId, gatewayState, paneVisible])
+ }, [sessionId, gatewayState, paneVisible, poll])
}
diff --git a/apps/desktop/src/app/chat/sidebar/filter-menu.tsx b/apps/desktop/src/app/chat/sidebar/filter-menu.tsx
index 6d78799a87e..a3e52f35493 100644
--- a/apps/desktop/src/app/chat/sidebar/filter-menu.tsx
+++ b/apps/desktop/src/app/chat/sidebar/filter-menu.tsx
@@ -21,6 +21,7 @@ import {
import { useI18n } from '@/i18n'
import { desktopGit } from '@/lib/desktop-git'
import { cn } from '@/lib/utils'
+import { $showsAdvancedChrome } from '@/store/interface-mode'
import {
$sidebarCardRows,
$sidebarFiltersActive,
@@ -182,6 +183,9 @@ export function SidebarFilterMenu({ className }: { className?: string }) {
// locally, the gateway's REST mirror remotely. Resolved per render, not once
// at module load: switching to a remote profile swaps the bridge underneath.
const prAvailable = Boolean(desktopGit()?.review?.prList)
+ // Simple mode owns the row readouts and the rail, and PRs are a coding
+ // signal — those rows wait for Advanced rather than appearing pre-decided.
+ const showsAdvancedChrome = useStore($showsAdvancedChrome)
// Fold the level in view: project rows, or the date/status buckets. Project
// rows default open, so "all collapsed" means every one of them has been
@@ -282,19 +286,21 @@ export function SidebarFilterMenu({ className }: { className?: string }) {
</DropdownMenuSubContent>
</DropdownMenuSub>
- <DropdownMenuSub>
- <DropdownMenuSubTrigger>Show</DropdownMenuSubTrigger>
- <DropdownMenuSubContent>
- {rowMetaOptions.map(option => (
- <OptionCheckbox
- checked={rowMeta.includes(option.id)}
- key={option.id}
- onCheck={() => toggleSidebarRowMeta(option.id)}
- option={option}
- />
- ))}
- </DropdownMenuSubContent>
- </DropdownMenuSub>
+ {showsAdvancedChrome && (
+ <DropdownMenuSub>
+ <DropdownMenuSubTrigger>Show</DropdownMenuSubTrigger>
+ <DropdownMenuSubContent>
+ {rowMetaOptions.map(option => (
+ <OptionCheckbox
+ checked={rowMeta.includes(option.id)}
+ key={option.id}
+ onCheck={() => toggleSidebarRowMeta(option.id)}
+ option={option}
+ />
+ ))}
+ </DropdownMenuSubContent>
+ </DropdownMenuSub>
+ )}
{grouping === 'project' && (
<OptionCheckbox
@@ -315,11 +321,13 @@ export function SidebarFilterMenu({ className }: { className?: string }) {
{/* The colored strip at the sidebar foot. Off, the statusbar grows a
profile dropdown beside the gateway switcher, so nobody loses the
door — this is for people whose profiles are bots, not workspaces. */}
- <OptionCheckbox
- checked={profileRailVisible}
- onCheck={toggleProfileRailVisible}
- option={{ icon: 'organization', id: 'profile-rail', label: t.sidebar.profileRail }}
- />
+ {showsAdvancedChrome && (
+ <OptionCheckbox
+ checked={profileRailVisible}
+ onCheck={toggleProfileRailVisible}
+ option={{ icon: 'organization', id: 'profile-rail', label: t.sidebar.profileRail }}
+ />
+ )}
</DropdownMenuGroup>
<DropdownMenuSeparator />
@@ -343,7 +351,7 @@ export function SidebarFilterMenu({ className }: { className?: string }) {
{/* `gh` only exists where the checkout does, so on a remote backend
this submenu never appears rather than filtering everything out. */}
- {prAvailable && (
+ {prAvailable && showsAdvancedChrome && (
<DropdownMenuSub>
<DropdownMenuSubTrigger>Pull request</DropdownMenuSubTrigger>
<DropdownMenuSubContent>
diff --git a/apps/desktop/src/app/chat/sidebar/index.tsx b/apps/desktop/src/app/chat/sidebar/index.tsx
index 2f85d6490fb..0ea188e353a 100644
--- a/apps/desktop/src/app/chat/sidebar/index.tsx
+++ b/apps/desktop/src/app/chat/sidebar/index.tsx
@@ -31,6 +31,7 @@ import { normalizeSessionSource, sessionSourceLabel } from '@/lib/session-source
import { cn } from '@/lib/utils'
import { $activeConnectionId } from '@/store/connections'
import { $cronJobs } from '@/store/cron'
+import { $interfaceMode, $showsAdvancedChrome, shownInMode } from '@/store/interface-mode'
import { $bindings } from '@/store/keybinds'
import {
$dismissedAutoProjectIds,
@@ -198,6 +199,8 @@ const NON_SESSION_LOAD_STEP = 10
// screen — has the connection to itself first.
const PROJECT_TREE_WARM_MS = 2_000
+// A row's `tier` is the one mode it belongs to (Simple keeps the setup rows,
+// Advanced adds the readouts); the list filters once, nothing is passed down.
const SIDEBAR_NAV: SidebarNavItem[] = [
{
id: 'new-session',
@@ -220,19 +223,23 @@ const SIDEBAR_NAV: SidebarNavItem[] = [
route: MESSAGING_ROUTE,
keybindActionId: 'nav.messaging'
},
+ // Artifacts and Scheduled jobs are outputs of running Hermes the developer
+ // way; Capabilities and Messaging are how anyone sets it up.
{
id: 'artifacts',
label: '',
icon: props => <Codicon name="files" {...props} />,
route: ARTIFACTS_ROUTE,
- keybindActionId: 'nav.artifacts'
+ keybindActionId: 'nav.artifacts',
+ tier: 'advanced'
},
{
id: 'cron',
label: '',
icon: props => <Codicon name="watch" {...props} />,
route: CRON_ROUTE,
- keybindActionId: 'nav.cron'
+ keybindActionId: 'nav.cron',
+ tier: 'advanced'
}
]
@@ -411,13 +418,22 @@ export function ChatSidebar({
id: c.id,
label: data.label,
icon: (props: { className?: string }) => <Codicon name={codicon} {...props} />,
- route: data.path
+ route: data.path,
+ tier: data.tier
}
]
}),
[navContributions]
)
+ const interfaceMode = useStore($interfaceMode)
+ const showsAdvancedChrome = useStore($showsAdvancedChrome)
+
+ const navItems = useMemo(
+ () => [...SIDEBAR_NAV, ...contributedNav].filter(shownInMode(interfaceMode)),
+ [contributedNav, interfaceMode]
+ )
+
const panesFlipped = useStore($panesFlipped)
const grouping = useStore($sidebarGrouping)
const ordering = useStore($sidebarOrdering)
@@ -1543,7 +1559,7 @@ export function ChatSidebar({
<SidebarGroup className="shrink-0 p-0 pb-2 pt-[calc(var(--titlebar-height)+0.375rem)]">
<SidebarGroupContent>
<SidebarMenu className="gap-px">
- {[...SIDEBAR_NAV, ...contributedNav].map(item => {
+ {navItems.map(item => {
const isInteractive = Boolean(item.action) || Boolean(item.route)
const active =
@@ -1989,7 +2005,7 @@ export function ChatSidebar({
)
})}
- {!trimmedQuery && !worktreeGroupingActive && cronJobs.length > 0 && (
+ {!trimmedQuery && !worktreeGroupingActive && showsAdvancedChrome && cronJobs.length > 0 && (
<SidebarCronJobsSection
jobs={cronJobs}
label={s.cronJobs}
diff --git a/apps/desktop/src/app/contrib/wiring.tsx b/apps/desktop/src/app/contrib/wiring.tsx
index c2da512f402..edd89415836 100644
--- a/apps/desktop/src/app/contrib/wiring.tsx
+++ b/apps/desktop/src/app/contrib/wiring.tsx
@@ -48,6 +48,7 @@ import { $activeConnectionId } from '@/store/connections'
import { $cronReviewRequest, setCronFocusJobId } from '@/store/cron'
import { requestGatewayForProfile } from '@/store/gateway'
import { reconnectGateway } from '@/store/gateway-reconnect'
+import { $interfaceMode, shownInMode } from '@/store/interface-mode'
import { $pinnedSessionIds, pinSession, restoreWorktree, unpinSession } from '@/store/layout'
import { notifyError } from '@/store/notifications'
import { $poolLimitsSettingsRequest } from '@/store/pool-limits'
@@ -1246,9 +1247,11 @@ export function ContribWiring({ children }: { children: ReactNode }) {
// renderer paints its own min/max/close (main decides via customWindowControls).
const customWindowControls = connection?.customWindowControls ?? window.hermesDesktop?.windowControls?.custom ?? false
const appActionsSide = useStore($titlebarAppActionsSide)
- const paneToolCount = rightTitlebarTools.filter(tool => !tool.hidden).length
- const leftExtraCount = leftTitlebarTools.filter(tool => !tool.hidden).length
- const clusters = titlebarAppActionsClusterCounts(appActionsSide, leftExtraCount, 0)
+ const interfaceMode = useStore($interfaceMode)
+ const shownTool = shownInMode(interfaceMode)
+ const paneToolCount = rightTitlebarTools.filter(tool => !tool.hidden && shownTool(tool)).length
+ const leftExtraCount = leftTitlebarTools.filter(tool => !tool.hidden && shownTool(tool)).length
+ const clusters = titlebarAppActionsClusterCounts(appActionsSide, leftExtraCount, 0, interfaceMode)
const systemToolsWidth = titlebarToolsWidthCss(clusters.right)
const titlebarToolsWidth =
diff --git a/apps/desktop/src/app/hooks/use-keybinds.ts b/apps/desktop/src/app/hooks/use-keybinds.ts
index 8c84763cf9d..347f6ebe9e9 100644
--- a/apps/desktop/src/app/hooks/use-keybinds.ts
+++ b/apps/desktop/src/app/hooks/use-keybinds.ts
@@ -30,6 +30,7 @@ import {
openFindBar
} from '@/store/find-in-page'
import { toggleHud } from '@/store/hud'
+import { toggleSimpleMode } from '@/store/interface-mode'
import { $capture, $comboIndex, endCapture, setBinding } from '@/store/keybinds'
import {
cycleSidebarGrouping,
@@ -254,6 +255,7 @@ export function useKeybinds(deps: KeybindRuntimeDeps): void {
'view.toggleReview': toggleReview,
'view.toggleStatusbar': toggleStatusbarVisible,
'view.toggleProfileRail': toggleProfileRailVisible,
+ 'view.toggleSimpleMode': toggleSimpleMode,
'view.toggleTabStrip': () => void toggleTargetZoneTabStrip(),
'view.showFiles': showFiles,
'view.showBrowser': openBrowserTab,
diff --git a/apps/desktop/src/app/routes.ts b/apps/desktop/src/app/routes.ts
index 0013ed8689c..503928aeba5 100644
--- a/apps/desktop/src/app/routes.ts
+++ b/apps/desktop/src/app/routes.ts
@@ -4,6 +4,7 @@ import type { ReactNode } from 'react'
import { noteActiveTreeGroup, revealTreePane } from '@/components/pane-shell/tree/store'
import { registry } from '@/contrib/registry'
import type { Contribution } from '@/contrib/types'
+import type { InterfaceTier } from '@/store/interface-mode'
type NavigateLike = (to: string, options?: { replace?: boolean }) => void
@@ -133,6 +134,8 @@ export interface SidebarNavContribution {
label: string
/** Route to navigate to (usually a contributed page's path). */
path: string
+ /** `'advanced'` keeps the row out of Simple mode; unset shows it everywhere. */
+ tier?: InterfaceTier
}
// Views that render as a full-screen modal card (OverlayView) over the shell.
diff --git a/apps/desktop/src/app/shell/titlebar-controls.tsx b/apps/desktop/src/app/shell/titlebar-controls.tsx
index b1b48e483e1..7b1f18057ff 100644
--- a/apps/desktop/src/app/shell/titlebar-controls.tsx
+++ b/apps/desktop/src/app/shell/titlebar-controls.tsx
@@ -16,6 +16,7 @@ import { triggerHaptic } from '@/lib/haptics'
import { formatModifierToken } from '@/lib/keybinds/combo'
import { cn } from '@/lib/utils'
import { toggleHud } from '@/store/hud'
+import { $interfaceMode, shownInMode, type Tiered } from '@/store/interface-mode'
import {
$fileBrowserOpen,
$panesFlipped,
@@ -25,7 +26,7 @@ import {
toggleSidebarOpen
} from '@/store/layout'
import { $unreadSessionCount } from '@/store/session-dot-state'
-import { $titlebarAppActionsSide } from '@/store/titlebar-app-actions'
+import { $titlebarAppActionsSide, TITLEBAR_FIXED_TOOLS } from '@/store/titlebar-app-actions'
import { appViewForPath, hidesFixedTitlebarClusters, isOverlayView } from '../routes'
@@ -38,7 +39,7 @@ import {
} from './titlebar'
import { TitlebarIcon } from './titlebar-icon'
-export interface TitlebarTool {
+export interface TitlebarTool extends Tiered {
id: string
label: string
active?: boolean
@@ -142,8 +143,12 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
const sidebarOpen = useStore($sidebarOpen)
const unreadCount = useStore($unreadSessionCount)
const appActionsSide = useStore($titlebarAppActionsSide)
+ const interfaceMode = useStore($interfaceMode)
const unreadBadge = unreadCount > 0 ? unreadCount : undefined
const unreadHint = unreadBadge ? ` · ${t.titlebar.unreadSessions(unreadBadge)}` : ''
+ // One filter for every cluster: a tool's own `hidden`, then the mode's tier.
+ const shown = shownInMode(interfaceMode)
+ const visibleTool = (tool: TitlebarTool) => !tool.hidden && shown(tool)
// `titleBar.*` slot content is mount-scoped — a page's <Contribute> registers
// only while that surface is up — so a non-empty area means a page is
@@ -163,6 +168,7 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
const rightLabel = rightEdge.open ? t.titlebar.hideRightSidebar : t.titlebar.showRightSidebar
const sidebarTool: TitlebarTool = {
+ ...TITLEBAR_FIXED_TOOLS.sidebar,
actionId: 'view.toggleSidebar',
badge: panesFlipped ? undefined : unreadBadge,
icon: <TitlebarIcon name="layout-sidebar-left" />,
@@ -175,6 +181,7 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
}
const flipTool: TitlebarTool = {
+ ...TITLEBAR_FIXED_TOOLS['flip-panes'],
actionId: 'view.flipPanes',
icon: <TitlebarIcon name="arrow-swap" />,
id: 'flip-panes',
@@ -186,6 +193,7 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
}
const rightSidebarTool: TitlebarTool = {
+ ...TITLEBAR_FIXED_TOOLS['right-sidebar'],
actionId: 'view.toggleRightSidebar',
badge: panesFlipped ? unreadBadge : undefined,
icon: <TitlebarIcon name="layout-sidebar-right" />,
@@ -202,6 +210,7 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
// left titlebar stays free for tabs (#107351).
const systemTools: TitlebarTool[] = [
{
+ ...TITLEBAR_FIXED_TOOLS.settings,
actionId: 'nav.settings',
icon: <TitlebarIcon name="settings-gear" />,
id: 'settings',
@@ -212,6 +221,7 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
}
},
{
+ ...TITLEBAR_FIXED_TOOLS.layout,
className: 'group/tool',
// Hover + held ⌘/Ctrl morphs the glyph into its reset form (see
// LayoutGlyph) — the mod-click telegraphs itself before it happens.
@@ -232,6 +242,7 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
title: t.titlebar.layoutEditorTitle(formatModifierToken('mod'))
},
{
+ ...TITLEBAR_FIXED_TOOLS.hud,
// No `title`: TitlebarToolButton passes `title` to TipKeybindLabel as a
// text OVERRIDE, so a long sentence there replaces the short label and
// crowds the ⌘⇧H hint off the tooltip. Label only — the hint is appended
@@ -273,7 +284,7 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
// route. Contributed `titleBar.tools` items keep rendering here too, so a
// chrome-owning page never silently drops a registered item.
if (hidesFixedTitlebarClusters(view) && pageOwnsTitlebar) {
- const pageTools = [...leftTools, ...tools].filter(tool => !tool.hidden)
+ const pageTools = [...leftTools, ...tools].filter(visibleTool)
// Both markers are required even when a page contributes to only one side.
return (
@@ -296,10 +307,11 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
const visibleLeftTools = (
appActionsSide === 'left' ? [sidebarTool, ...systemTools, ...leftTools] : [sidebarTool, ...leftTools]
- ).filter(tool => !tool.hidden)
+ ).filter(visibleTool)
- const visibleSystemTools = appActionsSide === 'right' ? systemTools.filter(tool => !tool.hidden) : []
- const visiblePaneTools = tools.filter(tool => !tool.hidden)
+ const visibleSystemTools = appActionsSide === 'right' ? systemTools.filter(visibleTool) : []
+ const visiblePaneTools = tools.filter(visibleTool)
+ const visibleRightFixedTools = [flipTool, rightSidebarTool].filter(visibleTool)
return (
<>
@@ -333,8 +345,9 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
{visibleSystemTools.map(tool => (
<TitlebarToolButton key={tool.id} navigate={navigate} tool={tool} />
))}
- <TitlebarToolButton navigate={navigate} tool={flipTool} />
- <TitlebarToolButton navigate={navigate} tool={rightSidebarTool} />
+ {visibleRightFixedTools.map(tool => (
+ <TitlebarToolButton key={tool.id} navigate={navigate} tool={tool} />
+ ))}
<Slot area="titleBar.right" />
</div>
</>
diff --git a/apps/desktop/src/app/types.ts b/apps/desktop/src/app/types.ts
index e42030a4033..59c889d1ba1 100644
--- a/apps/desktop/src/app/types.ts
+++ b/apps/desktop/src/app/types.ts
@@ -1,6 +1,7 @@
import type * as React from 'react'
import type { ChatMessage } from '@/lib/chat-messages'
+import type { Tiered } from '@/store/interface-mode'
import type { SessionMessage, UsageStats } from '@/types/hermes'
export interface ContextSuggestion {
@@ -125,7 +126,7 @@ export interface HandoffFailResponse {
export type SidebarNavId =
'artifacts' | 'capabilities' | 'command-center' | 'cron' | 'messaging' | 'new-session' | 'settings'
-export interface SidebarNavItem {
+export interface SidebarNavItem extends Tiered {
/** Built-in view id, or a contributed row's namespaced contribution id. */
id: SidebarNavId | (string & {})
label: string
diff --git a/apps/desktop/src/components/pane-shell/edit-mode.test.ts b/apps/desktop/src/components/pane-shell/edit-mode.test.ts
new file mode 100644
index 00000000000..838d1665660
--- /dev/null
+++ b/apps/desktop/src/components/pane-shell/edit-mode.test.ts
@@ -0,0 +1,30 @@
+/**
+ * Layout edit mode force-shows toggle-hidden panes so they can be rearranged.
+ * In Simple those panes rest by policy, so edit mode must arrange what Simple
+ * shows — otherwise opening the layout editor brings every machinery tab back.
+ */
+
+import { beforeEach, describe, expect, it, vi } from 'vitest'
+
+describe('$layoutEditRevealsHidden', () => {
+ beforeEach(() => {
+ window.localStorage.clear()
+ vi.resetModules()
+ })
+
+ it('reveals hidden panes in Advanced only', async () => {
+ const { $layoutEditMode, $layoutEditRevealsHidden } = await import('./edit-mode')
+ const { setInterfaceMode } = await import('@/store/interface-mode')
+
+ expect($layoutEditRevealsHidden.get()).toBe(false)
+
+ $layoutEditMode.set(true)
+ expect($layoutEditRevealsHidden.get()).toBe(true)
+
+ setInterfaceMode('simple')
+ expect($layoutEditRevealsHidden.get()).toBe(false)
+
+ setInterfaceMode('advanced')
+ expect($layoutEditRevealsHidden.get()).toBe(true)
+ })
+})
diff --git a/apps/desktop/src/components/pane-shell/edit-mode.tsx b/apps/desktop/src/components/pane-shell/edit-mode.tsx
index 1e7bba6a64a..1ae8609bd93 100644
--- a/apps/desktop/src/components/pane-shell/edit-mode.tsx
+++ b/apps/desktop/src/components/pane-shell/edit-mode.tsx
@@ -6,13 +6,24 @@
* This hook only owns Escape-to-exit.
*/
-import { atom } from 'nanostores'
+import { atom, computed } from 'nanostores'
import { useEffect } from 'react'
import { ESCAPE_PRIORITY, isTopEscapeLayer, pushEscapeLayer } from '@/lib/escape-layers'
+import { $showsAdvancedChrome } from '@/store/interface-mode'
export const $layoutEditMode = atom(false)
+// Edit mode force-shows toggle-hidden panes (terminal off, review closed) so
+// they can be rearranged. In Simple those panes are resting by policy, not by
+// a toggle, and arranging machinery you cannot see is not the job — edit mode
+// there works on what Simple shows. The renderers read this, never
+// `$layoutEditMode`, for the hidden-pane question.
+export const $layoutEditRevealsHidden = computed(
+ [$layoutEditMode, $showsAdvancedChrome],
+ (editMode, advanced) => editMode && advanced
+)
+
export function toggleLayoutEditMode() {
$layoutEditMode.set(!$layoutEditMode.get())
}
diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.tsx
index 16bfb56627f..d6977dc1352 100644
--- a/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.tsx
+++ b/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.tsx
@@ -33,7 +33,7 @@ import { useKeybindHint } from '@/lib/keybinds/use-keybind-hint'
import { cn } from '@/lib/utils'
import { closeAllOpenSessionTiles, setZoneParkedTiles } from '@/store/session-states'
-import { $layoutEditMode } from '../../edit-mode'
+import { $layoutEditMode, $layoutEditRevealsHidden } from '../../edit-mode'
import { useWindowControlsOverlap } from '../../geometry'
import { emptyPaneLifecycleState, reconcilePaneLifecycle } from '../../pane-lifecycle'
import { hiddenPaneProps, PaneGroupContext, PaneLifecycleContext, PaneVisibleContext } from '../../pane-visibility'
@@ -257,6 +257,7 @@ export function TreeGroup({
// overlay, not every zone's header/body (and not the menuDirections walk).
const dragging = useStore($treeDragging)
const editMode = useStore($layoutEditMode)
+ const revealsHidden = useStore($layoutEditRevealsHidden)
const wcOverlap = useWindowControlsOverlap(ref, !topEdge)
const hiddenPanes = useStore($hiddenTreePanes)
@@ -280,10 +281,10 @@ export function TreeGroup({
// Unregistered (plugin not loaded), chrome-toggled-off, and narrow-collapsed
// panes drop out of the header; the active pane falls back to the first
// shown one (render-side — the tree keeps `active`).
- // Edit mode forces toggle-hidden panes visible so they can be rearranged
- // (mirrors tree-split's paneGone) — restores itself on exit.
+ // Edit mode (in Advanced) forces toggle-hidden panes visible so they can be
+ // rearranged (mirrors tree-split's paneGone) — restores itself on exit.
const paneShown = (id: string) =>
- Boolean(paneFor(id)) && (editMode || !hiddenPanes.has(id)) && !(narrow && paneChrome(paneFor(id)).collapsible)
+ Boolean(paneFor(id)) && (revealsHidden || !hiddenPanes.has(id)) && !(narrow && paneChrome(paneFor(id)).collapsible)
const shown = node.panes.filter(paneShown)
const memoryKey = workspaceScopeKey(workspaceMode, workspaceOwnerKey)
diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/tree-split.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/tree-split.tsx
index 149929b4ce4..3ff02bf0058 100644
--- a/apps/desktop/src/components/pane-shell/tree/renderer/tree-split.tsx
+++ b/apps/desktop/src/components/pane-shell/tree/renderer/tree-split.tsx
@@ -16,7 +16,7 @@ import { rafCoalesce } from '@/lib/raf-coalesce'
import { cn } from '@/lib/utils'
import { $paneStates, type PaneStateSnapshot, setPaneHeightOverride, setPaneWidthOverride } from '@/store/panes'
-import { $layoutEditMode } from '../../edit-mode'
+import { $layoutEditMode, $layoutEditRevealsHidden } from '../../edit-mode'
import type { LayoutNode, SplitNode } from '../model'
import { allPaneIds } from '../model'
import {
@@ -111,6 +111,7 @@ export function TreeSplit({
// re-render — not every split in the tree.
const overrides = useSubtreeOverrides(useMemo(() => allPaneIds(node), [node]))
const editMode = useStore($layoutEditMode)
+ const revealsHidden = useStore($layoutEditRevealsHidden)
const collapsedSides = useStore($collapsedTreeSides)
const horizontal = node.orientation === 'row'
const axis = node.orientation
@@ -136,11 +137,12 @@ export function TreeSplit({
// is narrow and the pane is collapsible (edge overlay instead).
const paneFor = (id: string) => panes.find(p => p.id === id)
- // Layout-edit mode forces toggle-hidden panes (terminal off, review/preview
- // closed) visible so they're rearrangeable — only truly-absent (unregistered)
- // or narrow-collapsed panes stay gone. Restores itself on exit (render-only).
+ // Layout-edit mode (in Advanced) forces toggle-hidden panes (terminal off,
+ // review/preview closed) visible so they're rearrangeable — only truly-absent
+ // (unregistered) or narrow-collapsed panes stay gone. Restores itself on exit
+ // (render-only).
const paneGone = (id: string) =>
- !paneFor(id) || (!editMode && hiddenPanes.has(id)) || (narrow && Boolean(paneChrome(paneFor(id)).collapsible))
+ !paneFor(id) || (!revealsHidden && hiddenPanes.has(id)) || (narrow && Boolean(paneChrome(paneFor(id)).collapsible))
const trackCtx: TrackContext = { paneFor, paneGone, overrides }
@@ -524,7 +526,7 @@ export function TreeSplit({
},
// trackCtx is derived state rebuilt per render; the drag captures it once.
// eslint-disable-next-line react-hooks/exhaustive-deps
- [axis, editMode, horizontal, node.children, node.id, node.weights, hiddenPanes, narrow, overrides, panes]
+ [axis, editMode, revealsHidden, horizontal, node.children, node.id, node.weights, hiddenPanes, narrow, overrides, panes]
)
// Double-click a sash: every neighbor returns to its DEFAULT size.
@@ -601,7 +603,7 @@ export function TreeSplit({
setTreeSplitWeights(node.id, !preset && !pinned ? weights.map(() => 1) : weights)
},
// eslint-disable-next-line react-hooks/exhaustive-deps
- [axis, editMode, horizontal, node.children, node.id, node.weights, hiddenPanes, narrow, overrides, panes]
+ [axis, editMode, revealsHidden, horizontal, node.children, node.id, node.weights, hiddenPanes, narrow, overrides, panes]
)
// A run of ONLY fixed tracks can't fill the container (grow-0 all around
@@ -652,6 +654,17 @@ export function TreeSplit({
? allFixedAbsorberIndex(growable, i => (horizontal ? tracks[i].sizing?.maxWidth : tracks[i].sizing?.maxHeight))
: -1
+ // A capped all-fixed run leaves slack. When every track left standing is
+ // END-placed chrome (a bottom terminal whose column-mates ⌘J folded away),
+ // the slack goes BEFORE it so the zone keeps hugging its edge — a terminal
+ // deck belongs at the bottom of its column, not floating at the top.
+ const endPlacement = horizontal ? 'right' : 'bottom'
+
+ const anchorsEnd =
+ allFixed &&
+ absorberIndex < 0 &&
+ growable.every(i => allPaneIds(tracks[i].child).every(id => paneChrome(paneFor(id)).placement === endPlacement))
+
// Weights are RATIOS, but CSS flex-grow is absolute: a run whose grows sum
// below 1 fills only that fraction of the leftover (normalize's flatten
// scales weights into the parent slot — a dock-split nested into an
@@ -686,7 +699,7 @@ export function TreeSplit({
return (
<div
- className={cn('flex min-h-0 min-w-0 flex-1', horizontal ? 'flex-row' : 'flex-col')}
+ className={cn('flex min-h-0 min-w-0 flex-1', horizontal ? 'flex-row' : 'flex-col', anchorsEnd && 'justify-end')}
data-tree-split={node.id}
ref={containerRef}
>
diff --git a/apps/desktop/src/lib/keybinds/actions.ts b/apps/desktop/src/lib/keybinds/actions.ts
index 218e46dded3..be9efa3c3a6 100644
--- a/apps/desktop/src/lib/keybinds/actions.ts
+++ b/apps/desktop/src/lib/keybinds/actions.ts
@@ -134,6 +134,9 @@ export const KEYBIND_ACTIONS: readonly KeybindActionMeta[] = [
{ id: 'view.toggleTabStrip', category: 'view', defaults: ['mod+alt+t'] },
// Unbound: the rail is a one-time preference, not something to flip mid-chat.
{ id: 'view.toggleProfileRail', category: 'view', defaults: [] },
+ // Unbound for the same reason: Simple ↔ Advanced is a stance, not a view
+ // toggle; ⌘K, the layout editor and Settings → Appearance are its doors.
+ { id: 'view.toggleSimpleMode', category: 'view', defaults: [] },
// ⌘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: [] },
diff --git a/apps/desktop/src/store/titlebar-app-actions.test.ts b/apps/desktop/src/store/titlebar-app-actions.test.ts
index 0ebf92c7887..97766f627bc 100644
--- a/apps/desktop/src/store/titlebar-app-actions.test.ts
+++ b/apps/desktop/src/store/titlebar-app-actions.test.ts
@@ -17,6 +17,12 @@ describe('titlebarAppActionsClusterCounts', () => {
expect(titlebarAppActionsClusterCounts('right', 1, 2)).toEqual({ left: 2, right: 7 })
expect(titlebarAppActionsClusterCounts('left', 1, 2)).toEqual({ left: 5, right: 4 })
})
+
+ it('releases the space of every tool Simple mode hides, on both sides', () => {
+ // Sidebar toggle + what Simple keeps of the app actions; nothing fixed on the right.
+ expect(titlebarAppActionsClusterCounts('right', 0, 0, 'simple')).toEqual({ left: 1, right: 2 })
+ expect(titlebarAppActionsClusterCounts('left', 0, 0, 'simple')).toEqual({ left: 3, right: 0 })
+ })
})
describe('$titlebarAppActionsSide', () => {
diff --git a/apps/desktop/src/store/titlebar-app-actions.ts b/apps/desktop/src/store/titlebar-app-actions.ts
index a787549092d..8b1d90e5b33 100644
--- a/apps/desktop/src/store/titlebar-app-actions.ts
+++ b/apps/desktop/src/store/titlebar-app-actions.ts
@@ -1,4 +1,5 @@
import { type Codec, persistentAtom } from '@/lib/persisted'
+import { DEFAULT_INTERFACE_MODE, type InterfaceMode, shownInMode, type Tiered } from '@/store/interface-mode'
export type TitlebarAppActionsSide = 'left' | 'right'
@@ -22,16 +23,38 @@ export function setTitlebarAppActionsSide(side: TitlebarAppActionsSide) {
$titlebarAppActionsSide.set(side)
}
-/** Button counts for the two titlebar clusters. Sidebar is always left; flip and
- * the right-sidebar toggle are always right; the three app actions follow `side`. */
+/**
+ * The fixed titlebar tools and which of them are instrumentation. ONE table:
+ * the buttons spread their entry to render, the width reservation counts the
+ * same entries, so a tool Simple hides also releases the space it held.
+ * Settings and Layout never carry a tier — they are the way back.
+ */
+export const TITLEBAR_FIXED_TOOLS = {
+ 'flip-panes': { tier: 'advanced' },
+ hud: { tier: 'advanced' },
+ layout: {},
+ 'right-sidebar': { tier: 'advanced' },
+ settings: {},
+ sidebar: {}
+} satisfies Record<string, Tiered>
+
+export type TitlebarFixedToolId = keyof typeof TITLEBAR_FIXED_TOOLS
+
+/** The app actions that follow `side`; the sidebar toggle is always left, flip and the right-sidebar toggle always right. */
+const APP_ACTION_IDS: readonly TitlebarFixedToolId[] = ['settings', 'layout', 'hud']
+const RIGHT_FIXED_IDS: readonly TitlebarFixedToolId[] = ['flip-panes', 'right-sidebar']
+
+/** Button counts for the two titlebar clusters, for the mode that is rendering them. */
export function titlebarAppActionsClusterCounts(
side: TitlebarAppActionsSide,
leftExtras = 0,
- rightExtras = 0
+ rightExtras = 0,
+ mode: InterfaceMode = DEFAULT_INTERFACE_MODE
): { left: number; right: number } {
+ const shown = shownInMode(mode)
const sidebar = 1
- const appActions = 3
- const rightFixed = 2
+ const appActions = APP_ACTION_IDS.filter(id => shown(TITLEBAR_FIXED_TOOLS[id])).length
+ const rightFixed = RIGHT_FIXED_IDS.filter(id => shown(TITLEBAR_FIXED_TOOLS[id])).length
if (side === 'left') {
return { left: sidebar + appActions + leftExtras, right: rightFixed + rightExtras }