feat(desktop): a collapsed repository group counts its plans on hover, and keeps the open plan in sight

Merged
DA
8d ago
+134-13

Summary

Polish for collapsed repository groups in the sidebar (desktop/desktop-sidebar.tsx), as Dean asked:

  • Plan count on hover. A collapsed group's header shows how many plans it holds, as a quiet muted number at its trailing edge, just before the ⋯ and +. It appears with the chevron while the header is hovered or reached from the keyboard (:focus-visible). The number is always laid out while the group is collapsed and only its opacity changes, so the header's height and the label's truncation never move. An expanded group shows no count. Screen readers hear it as "4 plans" / "1 plan", as part of the toggle's name.
  • The open plan stays visible. If the open plan (the aria-current row) belongs to a collapsed group, that one row is drawn under the collapsed header, with its normal selected style and hover buttons. The group otherwise stays collapsed. Opening another plan re-evaluates: the previous plan disappears again if its group is collapsed. ⌥⌘↑/↓ already walked through the open plan under a fold (its drawn list), so back/forward is unchanged.
  • ⌥⌘↑/↓ matches what is drawn. The walk now treats a collapsed group's plan as present only when it is the aria-current row. Before, it went by activePlanId, which stays set while the new-plan page shows, so ⌥⌘↓ from the new-plan page could open a plan the collapsed group was not showing.
  • This applies to "No repository" too. Pinned and Archived are unchanged.

Evidence

  • Platform-independent checks: ./scripts/check.sh exit 0
  • macOS Electron verification (./scripts/verify.sh): not run. This was built in a Linux cloud workspace. CI could not verify this UI change either; it runs on Linux only. A Mac break that lands anyway is caught at the release rehearsal on a tag, not at review (LUKE-159 is the manual Mac pass).
  • Tests (through the public DesktopSidebar; both fail without the change):
    • a collapsed group counts its plans ("2 plans", "1 plan" under No repository), and an expanded one shows no count;
    • the open plan stands under its collapsed group and the group's other plans don't; opening another plan moves it, including to No repository, and the group stays collapsed;
    • from the new-plan page, ⌥⌘↓ skips a collapsed group's last open plan, which the list no longer shows.
    • The hover-only visibility of the count is CSS (:hover / :focus-visible, like the ⋯ and + beside it), which jsdom cannot evaluate, so the screenshots below cover it.

Visual evidence

These are not verify.sh PNGs. The real DesktopSidebar was mounted in headless Chrome on Linux, with the real stylesheet and the shared plansControl builder. next.js and No repository are collapsed.

Collapsed next.js, open plan stays visible under it
Collapsed and hovered: count, ⋯ and +
No repository collapsed and hovered
Expanded and hovered: no count
Light: collapsed and hovered, open plan under collapsed No repository

  • Fixture screenshots inspected: not attached (needs a Mac verify.sh run)

Invariants

  • ./scripts/check.sh green; renderer/UI PRs also ./scripts/verify.sh with evidence inspected. (CI): check green; verify.sh not run (no Mac)
  • JSON Schema goldens unchanged. (CI)
  • Every behavior change has, in this PR, the test that fails without it; no change-detector test added.
  • Gateway envelope goldens unchanged. (CI)
  • No new as type assertion outside the allowlisted files. (CI via anti-slop)
  • No Effect.runPromise/runSync/runFork outside the runtime edges. (CI)
  • No new raw async primitives. (CI)
  • No Effect, Stream, or Layer written as a statement and dropped. (CI via pnpm discarded-effect)

🤖 Generated with Claude Code