PR #9851 review: pin and unpin sections on the navigation rail
Summary
The PR lets each user choose which sections sit on the desktop navigation rail. A new useRailDestinations hook is the single list of sections, shared by the rail and the More menu. A persisted zustand store (rail-pins) keeps per-section overrides on top of fixed defaults, so users who never pin see the same rail as before. Rail buttons get a right-click Pin/Unpin menu, and the More menu lists every section with a pin toggle.
Verdict
Minor issues
The design is sound (one source list, overrides on defaults, registered bounded localStorage key), but the PR breaks an existing CI test that must be updated before merge. The other items are small.
Findings
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/TasksView.test.ts:120-124
The test "renders Tasks and Pull requests as separate left-rail destinations" greps NavigationRail.tsx for onClick={navigation.openTasks}. The PR moved those entries into useRailDestinations.tsx as object fields, so the Test CI job fails (reproduced locally: 1 fail).
Fix: read ../../../components/NavigationRail/hooks/useRailDestinations/useRailDestinations.tsx for the rail, and match onClick: navigation.openTasks / onClick: navigation.openPullRequests there (keep the JSX form for DashboardSidebarHeader.tsx).
NavigationRail/components/RailMoreMenu/RailMoreMenu.tsx:91-110
A <button> is nested inside a role="menuitem". Screen readers announce the row as one item, and keyboard users can only activate the row (navigate), never the toggle. The PR lists this as a known limitation. Mouse behavior is correct: Radix closes on the item's onClick (react-menu 2.1.16, composeEventHandlers(props.onClick, handleSelect)), and stopPropagation on the inner button stops that, so the menu stays open.
Fix: give the row a key to toggle (e.g. onKeyDown for p), or move pinning to a "Show on rail" group of DropdownMenuCheckboxItems with onSelect={e => e.preventDefault()}, which is keyboard-reachable and announced as checked/unchecked.
NavigationRail/NavigationRail.tsx:33, PinnableRailButton/PinnableRailButton.tsx:36
Unpinning the section that is open has no visible effect: the button stays because isActive keeps it on the rail. It leaves only after the user navigates away. The user may think Unpin did not work.
Fix: give an unpinned-but-active button a small visual cue (e.g. reduced opacity or a dashed outline), or close the gap with a toast. Or keep it and confirm that is the intent (see questions).
hooks/useRailDestinations/useRailDestinations.tsx:29, stores/railPinsStore/railPinsStore.ts:32
The two JSDoc lines restate the names and the PR description. AGENTS.md says to comment only what code cannot say. Fix: delete them; the bound rationale is already in the PR body.
Evidence
Desktop (Electron renderer) — not verified end-to-end
The rail is only visible after sign-in, which needs the local API. What I tried:
- The workspace had no
.env. I ran.paradev/setup.cloud.sh(exit 0: Neon branch ready, dev account seeded). - Started
.paradev/dev-stack.cloud.shwithRENDERER_REMOTE_DEBUG_PORT=9333(a local, reverted edit). The desktop came up and CDP attached tohttp://localhost:3005/#/sign-in. - The API (
@superset/web+@superset/apiunder turbo) exited with code 1. Next.js printed a "known security vulnerability, upgrade Next.js" notice and stopped. Retried withturbo run dev --filter=@superset/apialone: same exit. With no API on :3001 the app stays at "Restoring your session", so the rail, the More menu and the context menu could not be reached.
Not run: every state from the PR's QA list (pin/unpin from the rail, unpinned active section on the rail, More menu toggles, restart persistence, Channels flag off, Shift+F10).
Questions for the author
- Is it intended that Unpin on the open section does nothing visible until you leave it? A cue would help.
- Should Home (or at least one section) always stay pinned? A user can unpin all seven and be left with Home + More only, which is fine, but worth a deliberate call.
- Do you plan to make the More-menu toggle keyboard-reachable in this PR or in a follow-up?
- When #9835 lands, will this be rebased to main before merge so CI runs against the final base?
Test / CI notes (at a1ce77bd)
bun testNavigationRail + lib/persisted-keys: 14 pass, 0 fail.bun test ./src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/TasksView.test.ts: 1 fail (see finding 1). Same failure as the CI Test job (run 43979617511).tsc --noEmitinapps/desktop: passes (after the dev build generated the route tree; a first run before that showed only route-tree errors unrelated to this PR).biome checkonNavigationRail/: clean, 13 files.- Other CI checks were still running or passing when I looked; only Test had failed.