From 60a8630f68024a6e1df57793d2e8b1abd5525206 Mon Sep 17 00:00:00 2001
From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
Date: Fri, 24 Apr 2026 17:22:24 -0700
Subject: [PATCH] feat(ui): replace back/forward workspace navigation icons
with arrows (#1066)
---
src/renderer/src/App.tsx | 282 ++++++++++++++++---------------
src/renderer/src/assets/main.css | 7 +
2 files changed, 150 insertions(+), 139 deletions(-)
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx
index bd2e1a17a..086f7e49f 100644
--- a/src/renderer/src/App.tsx
+++ b/src/renderer/src/App.tsx
@@ -2,7 +2,7 @@
import { lazy, Suspense, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
import { DEFAULT_STATUS_BAR_ITEMS, DEFAULT_WORKTREE_CARD_PROPERTIES } from '../../shared/constants'
-import { ChevronLeft, ChevronRight, Minimize2, PanelLeft, PanelRight } from 'lucide-react'
+import { ArrowLeft, ArrowRight, Minimize2, PanelLeft, PanelRight } from 'lucide-react'
import { FOCUS_TERMINAL_PANE_EVENT, TOGGLE_TERMINAL_PANE_EXPAND_EVENT } from '@/constants/terminal'
import { syncZoomCSSVar } from '@/lib/ui-zoom'
import { toast } from 'sonner'
@@ -645,149 +645,153 @@ function App(): React.JSX.Element {
// the sidebar-width left header (workspace view) can share the same
// controls without duplicating the agent badge popover.
const titlebarLeftControls = (
-
-
- {showSidebar && (
-
-
-
-
-
-
-
- {`Toggle sidebar (${isMac ? '⌘B' : 'Ctrl+B'})`}
-
-
- )}
- {settings?.showTitlebarAgentActivity !== false ? (
-
-
-
-
- {activeAgentCount}
-
-
-
- 0 ? ' titlebar-agent-hovercard-header-with-list' : ''}`}
- >
- {activeAgentCount === 0
- ? 'No agents active'
- : `${activeAgentCount} ${activeAgentCount === 1 ? 'agent' : 'agents'} active`}
-
- {activeAgentCount > 0 && (
-
- {Object.entries(workingAgentsPerWorktree).map(([worktreeId, { agents }]) => {
- const wt = findWorktreeById(worktreesByRepo, worktreeId)
- // Why: when a transient git error causes worktreesByRepo to
- // lose a worktree, the raw worktreeId (uuid::path) is not
- // useful. Extract a cross-platform path basename as a
- // readable fallback.
- const sepIdx = worktreeId.indexOf('::')
- const pathPart = sepIdx !== -1 ? worktreeId.slice(sepIdx + 2) : worktreeId
- const fallbackName = pathPart.split(/[\\/]/).pop() || pathPart
- return (
-
- {
- // Why: if the worktree is missing from worktreesByRepo
- // (transient git error cleared the list), refresh the
- // repo's worktrees before navigating so the activation
- // lookup succeeds instead of silently failing.
- if (!wt) {
- const repoId = getRepoIdFromWorktreeId(worktreeId)
- void useAppStore
- .getState()
- .fetchWorktrees(repoId)
- .then(() => {
- activateAndRevealWorktree(worktreeId)
- })
- return
- }
- activateAndRevealWorktree(worktreeId)
- }}
- >
-
- {wt?.displayName ?? fallbackName}
-
-
- {agents.map((agent) => (
- {
- activateAndRevealWorktree(worktreeId)
- useAppStore.getState().setActiveTab(agent.tabId)
- if (agent.paneId !== null) {
- // Why: a split-terminal tab can host multiple
- // agents. After selecting the tab, wait one
- // frame so the active TerminalPane can mount
- // and then focus the specific pane the user
- // clicked instead of leaving whichever pane
- // was previously active highlighted.
- requestAnimationFrame(() => {
- window.dispatchEvent(
- new CustomEvent(FOCUS_TERMINAL_PANE_EVENT, {
- detail: { tabId: agent.tabId, paneId: agent.paneId }
- })
- )
- })
- }
- }}
- >
-
- {agent.label}
-
-
-
- ))}
-
- )
- })}
-
- )}
- {
- void actions.updateSettings({ showTitlebarAgentActivity: false })
- toast('Agent activity badge hidden', {
- description: 'You can turn it back on in Settings → Appearance.',
- duration: Infinity,
- dismissible: true
- })
- }}
- >
- Hide from titlebar
-
-
-
- ) : null}
- {/* Why: Back/Forward navigate worktree-activation history. Only
- meaningful while viewing a worktree (terminal view); hidden in
- Settings/Tasks/Landing to keep the titlebar compact and the
- semantics unambiguous. */}
- {activeView === 'terminal' && (
- <>
+
+
+
+ {showSidebar && (
+
+
+
+
+ {`Toggle sidebar (${isMac ? '⌘B' : 'Ctrl+B'})`}
+
+
+ )}
+ {settings?.showTitlebarAgentActivity !== false ? (
+
+
+
+
+ {activeAgentCount}
+
+
+
+ 0 ? ' titlebar-agent-hovercard-header-with-list' : ''}`}
+ >
+ {activeAgentCount === 0
+ ? 'No agents active'
+ : `${activeAgentCount} ${activeAgentCount === 1 ? 'agent' : 'agents'} active`}
+
+ {activeAgentCount > 0 && (
+
+ {Object.entries(workingAgentsPerWorktree).map(([worktreeId, { agents }]) => {
+ const wt = findWorktreeById(worktreesByRepo, worktreeId)
+ // Why: when a transient git error causes worktreesByRepo to
+ // lose a worktree, the raw worktreeId (uuid::path) is not
+ // useful. Extract a cross-platform path basename as a
+ // readable fallback.
+ const sepIdx = worktreeId.indexOf('::')
+ const pathPart = sepIdx !== -1 ? worktreeId.slice(sepIdx + 2) : worktreeId
+ const fallbackName = pathPart.split(/[\\/]/).pop() || pathPart
+ return (
+
+ {
+ // Why: if the worktree is missing from worktreesByRepo
+ // (transient git error cleared the list), refresh the
+ // repo's worktrees before navigating so the activation
+ // lookup succeeds instead of silently failing.
+ if (!wt) {
+ const repoId = getRepoIdFromWorktreeId(worktreeId)
+ void useAppStore
+ .getState()
+ .fetchWorktrees(repoId)
+ .then(() => {
+ activateAndRevealWorktree(worktreeId)
+ })
+ return
+ }
+ activateAndRevealWorktree(worktreeId)
+ }}
+ >
+
+ {wt?.displayName ?? fallbackName}
+
+
+ {agents.map((agent) => (
+ {
+ activateAndRevealWorktree(worktreeId)
+ useAppStore.getState().setActiveTab(agent.tabId)
+ if (agent.paneId !== null) {
+ // Why: a split-terminal tab can host multiple
+ // agents. After selecting the tab, wait one
+ // frame so the active TerminalPane can mount
+ // and then focus the specific pane the user
+ // clicked instead of leaving whichever pane
+ // was previously active highlighted.
+ requestAnimationFrame(() => {
+ window.dispatchEvent(
+ new CustomEvent(FOCUS_TERMINAL_PANE_EVENT, {
+ detail: { tabId: agent.tabId, paneId: agent.paneId }
+ })
+ )
+ })
+ }
+ }}
+ >
+
+ {agent.label}
+
+
+
+ ))}
+
+ )
+ })}
+
+ )}
+ {
+ void actions.updateSettings({ showTitlebarAgentActivity: false })
+ toast('Agent activity badge hidden', {
+ description: 'You can turn it back on in Settings → Appearance.',
+ duration: Infinity,
+ dismissible: true
+ })
+ }}
+ >
+ Hide from titlebar
+
+
+
+ ) : null}
+
+ {/* Why: Back/Forward navigate worktree-activation history. Only
+ meaningful while viewing a worktree (terminal view); hidden in
+ Settings/Tasks/Landing to keep the titlebar compact and the
+ semantics unambiguous. The group sits outside the measured inner
+ container so the sidebar-collapse spacer stays sized to the left
+ controls only. */}
+ {activeView === 'terminal' && (
+
+
+
+ useAppStore.getState().goBackWorktree()}
disabled={!canGoBackWorktree}
aria-label="Go back"
>
-
+
@@ -797,19 +801,19 @@ function App(): React.JSX.Element {
useAppStore.getState().goForwardWorktree()}
disabled={!canGoForwardWorktree}
aria-label="Go forward"
>
-
+
{`Go forward (${isMac ? '⌘⌥→' : 'Ctrl+Alt+→'})`}
- >
+
)}
)
diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css
index b49f9eba5..756b1b2c5 100644
--- a/src/renderer/src/assets/main.css
+++ b/src/renderer/src/assets/main.css
@@ -369,6 +369,13 @@
color: var(--foreground);
}
+/* Why: tighter padding for the back/forward pair so the arrows sit
+ close together as a single navigation group, while the standard
+ .sidebar-toggle spacing stays unchanged for other titlebar icons. */
+.sidebar-toggle-compact {
+ padding: 4px 5px;
+}
+
.sidebar-toggle:disabled {
cursor: default;
opacity: 0.45;