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 ? (
{activeView === 'settings' ? : null} - {activeView === 'new-workspace' ? : null} + {activeView === 'tasks' ? : null} {activeView === 'terminal' && !activeWorktreeId ? : null}
{/* Why: keep RightSidebar mounted even when closed so that its child components (FileExplorer, SourceControl, etc.) and their filesystem watchers + cached directory trees survive across - open/close toggles. Unmount on new-workspace view since that + open/close toggles. Unmount on the tasks view since that surface is intentionally distraction-free. */} {showRightSidebarControls ? : null} diff --git a/src/renderer/src/components/NewWorkspacePage.tsx b/src/renderer/src/components/TaskPage.tsx similarity index 89% rename from src/renderer/src/components/NewWorkspacePage.tsx rename to src/renderer/src/components/TaskPage.tsx index 8d45e4aa3..60bfb4690 100644 --- a/src/renderer/src/components/NewWorkspacePage.tsx +++ b/src/renderer/src/components/TaskPage.tsx @@ -139,10 +139,10 @@ function getTaskStatusTone(item: GitHubWorkItem): string { return 'border-cyan-500/30 bg-cyan-500/10 text-cyan-700 dark:text-cyan-200' } -export default function NewWorkspacePage(): React.JSX.Element { +export default function TaskPage(): React.JSX.Element { const settings = useAppStore((s) => s.settings) - const pageData = useAppStore((s) => s.newWorkspacePageData) - const closeNewWorkspacePage = useAppStore((s) => s.closeNewWorkspacePage) + const pageData = useAppStore((s) => s.taskPageData) + const closeTaskPage = useAppStore((s) => s.closeTaskPage) const activeModal = useAppStore((s) => s.activeModal) const repos = useAppStore((s) => s.repos) const activeRepoId = useAppStore((s) => s.activeRepoId) @@ -150,6 +150,18 @@ export default function NewWorkspacePage(): React.JSX.Element { const updateSettings = useAppStore((s) => s.updateSettings) const fetchWorkItems = useAppStore((s) => s.fetchWorkItems) const getCachedWorkItems = useAppStore((s) => s.getCachedWorkItems) + // Why: in workspace view (a worktree is active) App.tsx hides its + // full-width titlebar, so this page renders its own 42px titlebar strip to + // keep the top band continuous with the sidebar header and tab rows. When + // the sidebar is also collapsed, App.tsx floats its titlebar-left controls + // (traffic lights, sidebar toggle, agent badge) over our strip — reserve + // the measured width of those controls on the left so our "Tasks" label + // never sits behind them. In non-workspace mode App.tsx already owns the + // top titlebar, so skip our strip to avoid a duplicate band. + const sidebarOpen = useAppStore((s) => s.sidebarOpen) + const activeWorktreeId = useAppStore((s) => s.activeWorktreeId) + const workspaceActive = activeWorktreeId !== null + const reserveCollapsedHeaderSpace = workspaceActive && !sidebarOpen const eligibleRepos = useMemo(() => repos.filter((repo) => isGitRepoKind(repo)), [repos]) @@ -489,27 +501,79 @@ export default function NewWorkspacePage(): React.JSX.Element { } event.preventDefault() - closeNewWorkspacePage() + closeTaskPage() } window.addEventListener('keydown', onKeyDown, { capture: true }) return () => window.removeEventListener('keydown', onKeyDown, { capture: true }) - }, [activeModal, closeNewWorkspacePage, drawerWorkItem, newIssueOpen]) + }, [activeModal, closeTaskPage, drawerWorkItem, newIssueOpen]) return (
-
- {/* Why: left-aligned so it doesn't collide with the app sidebar on the - right edge. The GitHub preview is a modal sheet that overlays the - whole surface, so this button is hidden behind it while it's open. */} -
+ {/* Why: no z-index here. App.tsx's floating titlebar-left (traffic lights + + sidebar-expand toggle + agent badge) is absolutely positioned at + z-10 in the root stacking context when the sidebar is collapsed. If + this wrapper also sits at z-10 it ties with titlebar-left on + z-index and wins on DOM order (later sibling), so even though our + top-left spacer is pointer-events-none, the click still lands on + this wrapper behind the spacer instead of falling through to the + sidebar toggle. Keeping this at z-auto lets titlebar-left's z-10 + paint above our content and receive the click cleanly. */} +
+ {/* Why: in workspace view App.tsx suppresses its full-width titlebar, + so render a matching 42px strip here to keep the top band + continuous with the sidebar header and tab rows. When the sidebar + is collapsed, App.tsx floats its titlebar-left controls (traffic + lights, sidebar toggle, agent badge) over the top-left of this + page at z-10, and the page wrapper stays at z-auto so that float + always paints above our content. Keep the reserved region + transparent so the floating titlebar-left's own bg + border-bottom + is what the user sees on the left — the two segments then read as + one continuous band. The painted remainder is a drag-region so the + window stays movable here, matching other top chrome. Skipped in + non-workspace mode because App.tsx already owns the top titlebar + and a second strip would produce a duplicate band. */} + {workspaceActive ? ( +
+ {reserveCollapsedHeaderSpace ? ( + // Why: the floating titlebar-left hosts real interactive chrome + // (sidebar-expand toggle, agent badge) under this segment. Both + // pointer-events-none AND WebkitAppRegion='no-drag' are needed: + // without pointer-events-none, this transparent div absorbs + // clicks before they reach the toggle; without no-drag, Electron + // marks the area as window-drag and still consumes clicks even + // when the element itself is click-through. +
+ ) : null} +
+ Tasks +
+
+ ) : null} + + {/* Why: Close sits in its own row below the titlebar strip so it can + never overlap the floating macOS traffic lights. Kept left-aligned + to stay out of the app sidebar on the right edge. */} +