fix(desktop): the sidebar toggle takes its clicks back, and toolbar buttons draw no fill at rest

Merged
DA
11d ago
+6-3

What

Two things Dean hit testing the merged sidebar and toolbar work on his Mac.

1. The sidebar toggle couldn't be clicked

SidebarToggle (#1827) is absolutely positioned beside the traffic lights, over two drag regions: the sidebar's .desktop-drag-strip when the sidebar is open, and the work column's .desktop-toolbar (its clearance padding) when the sidebar is folded. It has -webkit-app-region: no-drag, but it came first in the document, before <DesktopSidebar> and <main>.

Chromium hands Electron the page's app regions in document order, and since Electron 23 macOS builds the window's drag region by applying them in that order: a drag rect unions in and a no-drag rect cuts out. A later drag rect therefore covers an earlier no-drag one no matter the z-index (Electron's breaking change for 23: "a drag region on top of a no-drag region will correctly cause the region to be draggable"). The OS took the toggle's presses as window drags, so the renderer never saw a click, whichever way the sidebar was.

Fix: the shell now renders the toggle after <main>, so its no-drag rect comes after every drag region it covers. Its position is unchanged (it's absolutely positioned, so it takes no grid cell). There's a one-line "Note that…" comment beside it.

Focus order: the toggle is now the last tab stop in the window instead of the first. I accepted that: it's window chrome beside the traffic lights, ⌘B toggles the sidebar from anywhere, and the shortcut is still announced through aria-keyshortcuts. The alternatives were cutting the drag strips around the toggle, which loses drag area and breaks the toolbar's full-width hairline, or moving the toggle into each page's toolbar. Both cost more than a later tab stop.

Other controls over a drag strip: I checked each one and none needed a change:

  • The right-panel toggle, ⋯ button, Copy plan, Choose folder… and the inline Delete question all live inside .desktop-toolbar-actions (no-drag). That's a descendant of the drag header, so it comes after it in document order.
  • The plan menu (toolbar ⋯ and sidebar right-click) is portaled to the end of document.body.
  • The settings "Back to plans" button and the new-plan page (#1836) sit below their drag strips rather than over them, and the side panel's resize edge sits below the toolbar.
  • Entry sheets hang from 96px, below the 52px drag strips.

No test for item 1. jsdom loads no stylesheet and Electron's drag region exists only in the OS window, so nothing at the renderer layer can see whether a press lands. The only thing a test could check is "the toggle is the shell's last child", which just restates the code (a change-detector test). The real check is a click on a Mac (verify.sh, LUKE-159).

2. Toolbar buttons are ghost

.toolbar-button no longer paints --raised-strong at rest. Every toolbar button, labeled or icon-only (Copy plan, Choose folder…, the failed-plan Close plan, ⋯, both toggles), is now transparent until hovered and uses the existing --selected hover fill. Keyboard focus still gets the platform focus ring, as before. Copy plan keeps its icon, its "Copy plan" label and its Copied swap. .toolbar-icon-button's own background: none override is gone because the base rule now says it. The sidebar's New plan button is untouched (#1836 restyled it).

No test for item 2 either: it's a style-only change, and a test asserting a CSS value would be a change detector.

Mac verification

CI could not verify the Mac UI, and ./scripts/verify.sh was not run. This was built on a Linux cloud VM, and LUKE-159 is the manual Mac verify.sh pass. I rendered the real DesktopShell (open plan, sidebar open and folded) with the built stylesheet in headless Chrome to check the layout. The toggle sits where it did, and the toolbar buttons show no fill at rest and the hover fill on Copy plan. A browser can't show drag regions, so the clickability fix itself needs a Mac. The screenshots were not uploaded to this PR.

./scripts/check.sh exits 0. Rebased on main after #1836; the desktop renderer tests pass after the rebase.

🤖 Generated with Claude Code


Open workspace in Conductor


Devin Review