From 4192d9db26c393ddd2b1ccbf491b6ae760b99a74 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:11:19 -0700 Subject: [PATCH] fix(tasks): rename NewWorkspacePage to TaskPage and give it a proper titlebar (#921) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(tasks): rename NewWorkspacePage to TaskPage and unblock Close on collapsed sidebar Rename the full-page work-item view to TaskPage (file, component, store actions, and the `activeView` literal) so the name matches the surface the user sees. Also fix a regression where the page's Close button was unreachable in workspace view with the sidebar collapsed — the floating titlebar-left strip (traffic lights + sidebar toggle + agent badge) overlapped the Close button, leaving the user stuck. Mirror the TabGroupPanel fix by reserving `var(--collapsed-sidebar-header-width)` of left padding on the Close row, which App.tsx already keeps in sync with the live measured width of that floating header. * fix(tasks): give TaskPage its own 42px titlebar and drop Close below it Rather than cramming the Close button into the same horizontal band that App.tsx uses for the floating traffic-lights/sidebar-toggle strip, give TaskPage its own 42px "Tasks" titlebar (matching the sidebar header and tab rows) and move the Close (X) button into a dedicated row below it. The titlebar is drag-region so the window stays movable from this band. Skipped in non-workspace mode where App.tsx already owns the full-width titlebar, to avoid a duplicate band. * fix(tasks): keep sidebar-expand toggle visible over TaskPage titlebar When the left sidebar is collapsed, App.tsx floats the titlebar-left strip (traffic lights, sidebar-expand toggle, agent badge) over the top-left of the page at z-10. TaskPage's own 42px strip sat at the same stacking level and painted later in DOM, so its solid background hid the expand toggle. Split the strip: keep the reserved region transparent so the floating controls show through, and only paint bg/border on the remainder. The floating titlebar-left already carries the matching bg + border-bottom, so the two segments still read as one continuous band. * fix(tasks): let clicks reach sidebar toggle under TaskPage titlebar The reserved spacer in TaskPage's titlebar strip sits on top of App.tsx's floating titlebar-left (which hosts the sidebar-expand toggle and agent badge). Two things were swallowing clicks meant for the toggle: 1. The outer strip carried WebkitAppRegion='drag', so Electron treated the whole 42px row as window-drag — even the transparent reserved region. 2. The transparent div itself absorbed pointer events before they reached the underlying toggle. Scope the drag region to just the painted "Tasks" segment, and mark the reserved spacer pointer-events-none with an explicit no-drag override. * fix(tasks): stop TaskPage wrapper from blocking sidebar-expand toggle The TaskPage's inner column had z-10, the same z-index as App.tsx's floating titlebar-left cluster (traffic lights, sidebar toggle, agent badge) that hovers in the top-left when the sidebar is collapsed. Tie on z-index + later in DOM meant TaskPage painted over titlebar-left, so clicks on the reserved spacer region fell through pointer-events-none into the wrapper behind the spacer rather than reaching the toggle. Dropping z-10 from the inner column lets titlebar-left paint above the page content and receive clicks cleanly, without changing the visual layout. --- src/renderer/src/App.tsx | 26 +++--- .../{NewWorkspacePage.tsx => TaskPage.tsx} | 88 ++++++++++++++++--- src/renderer/src/components/Terminal.tsx | 6 +- .../src/components/sidebar/SidebarNav.tsx | 12 +-- .../src/components/sidebar/WorktreeCard.tsx | 6 +- .../src/components/sidebar/WorktreeList.tsx | 6 +- src/renderer/src/hooks/resolve-zoom-target.ts | 2 +- src/renderer/src/hooks/useComposerState.ts | 8 +- src/renderer/src/lib/new-workspace.ts | 8 +- src/renderer/src/lib/worktree-activation.ts | 6 +- src/renderer/src/store/slices/ui.test.ts | 14 +-- src/renderer/src/store/slices/ui.ts | 55 ++++++------ 12 files changed, 149 insertions(+), 88 deletions(-) rename src/renderer/src/components/{NewWorkspacePage.tsx => TaskPage.tsx} (89%) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index b1270451e..2c3a4683c 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -15,7 +15,7 @@ import Sidebar from './components/Sidebar' import Terminal from './components/Terminal' import { shutdownBufferCaptures } from './components/terminal-pane/TerminalPane' import Landing from './components/Landing' -import NewWorkspacePage from './components/NewWorkspacePage' +import TaskPage from './components/TaskPage' import Settings from './components/settings/Settings' import RightSidebar from './components/right-sidebar' import QuickOpen from './components/QuickOpen' @@ -447,9 +447,9 @@ function App(): React.JSX.Element { // full-width titlebar is replaced by a sidebar-width left header so the // terminal + tab groups extend to the very top of the window. const workspaceActive = activeView !== 'settings' && activeWorktreeId !== null - // Why: suppress right sidebar controls on new-workspace page since that - // surface is intentionally distraction-free (no right sidebar). - const showRightSidebarControls = activeView !== 'settings' && activeView !== 'new-workspace' + // Why: suppress right sidebar controls on the tasks page since that surface + // is intentionally distraction-free (no right sidebar). + const showRightSidebarControls = activeView !== 'settings' && activeView !== 'tasks' const handleToggleExpand = (): void => { if (!effectiveActiveTabId) { @@ -509,9 +509,9 @@ function App(): React.JSX.Element { // (contentEditable) or a browser guest webContents, both of which bypass // this renderer-side window keydown listener. - // Why: the new-workspace composer should not be able to reveal the right - // sidebar at all, because that surface is intentionally distraction-free. - if (activeView === 'new-workspace') { + // Why: the tasks page should not be able to reveal the right sidebar at + // all, because that surface is intentionally distraction-free. + if (activeView === 'tasks') { return } @@ -739,9 +739,9 @@ function App(): React.JSX.Element { ) : null useEffect(() => { - if (activeView === 'new-workspace' && rightSidebarOpen) { - // Why: hide the right sidebar immediately when entering the composer so - // a previous open state can't bleed into the dedicated workspace flow. + if (activeView === 'tasks' && rightSidebarOpen) { + // Why: hide the right sidebar immediately when entering the tasks page + // so a previous open state can't bleed into that distraction-free view. actions.setRightSidebarOpen(false) } }, [activeView, rightSidebarOpen, actions]) @@ -759,7 +759,7 @@ function App(): React.JSX.Element { {/* Why: in workspace view (split groups always enabled), the full-width titlebar is removed so tab groups + terminal extend to the top of the window. Left titlebar controls move to a header above the sidebar. - Settings, landing, and new-workspace views keep the full-width titlebar. */} + Settings, landing, and the tasks page keep the full-width titlebar. */} {!workspaceActive ? (