PR #9851 review: pin and unpin sections on the navigation rail

PR #9851 · Review workspace · author AviPeltz · base workspaces-icon-reorder-c-0a494331 (stacked on #9835) · head a1ce77bd

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

CI breakapps/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).

Minor · a11yNavigationRail/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.

Minor · UXNavigationRail/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).

Nit · AGENTS.md commentshooks/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.

Checked and fine: persisted key registered in persisted-key-registry.test-data.ts and bounded (7 booleans); i18n strings reuse existing ids ("Pin", "Unpin", "Chat"); feature-flag gating for Chat and Plugins preserved; Chat icon keeps the filled rendering it had in the old menu; context menu wraps the button in a <div> but the rail's gap-1.5 still applies to it, so spacing is unchanged.

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:

  1. The workspace had no .env. I ran .paradev/setup.cloud.sh (exit 0: Neon branch ready, dev account seeded).
  2. Started .paradev/dev-stack.cloud.sh with RENDERER_REMOTE_DEBUG_PORT=9333 (a local, reverted edit). The desktop came up and CDP attached to http://localhost:3005/#/sign-in.
  3. The API (@superset/web + @superset/api under turbo) exited with code 1. Next.js printed a "known security vulnerability, upgrade Next.js" notice and stopped. Retried with turbo run dev --filter=@superset/api alone: 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.
Desktop renderer stuck on the sign-in screen

Desktop renderer at PR head, attached over CDP: the sign-in screen, as far as the app gets without the API.

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

Test / CI notes (at a1ce77bd)