feat(desktop): per-lane visibility toggles on the workspaces board

Merged
KI
3mo ago
+169-12

Links

  • Builds on and supersedes #6563 (its two commits are included in this branch — merging this PR lands both).

Summary

  • Adds a Lanes section to the board's Display dropdown: one checkbox per lane (Idle, Working, Needs attention, Needs review, Merged, Deleted), each with its BoardColumnIcon status glyph, so any lane can be hidden — not just the empty archived ones.
  • Includes #6563 as its base: board view by default, archived hidden by default, and empty Merged/Deleted lanes omitted while archived workspaces are hidden.

Why / Context

#6563 fixed the empty Merged/Deleted lanes left behind by the archived filter, but hiding was implicit and hard-coded to those two lanes. The actual intent is user-controlled column visibility. Linear's board (our reference) offers per-column "Hide column" plus a "Show empty columns" toggle; this PR brings the per-lane control to our board in the Display menu where the other board options already live.

How It Works

  • v2WorkspacesFilterStore gains hiddenLanes: V2WorkspacesBoardLane[] and toggleLane(). The lane union is defined self-contained in the store (mirroring BoardColumnKey) to avoid the store → deriveBoardColumn → useAccessibleV2Workspaces → store import cycle; reset() restores all lanes.
  • V2WorkspacesHeader renders the Lanes checkbox section only in board view, reusing BOARD_COLUMN_LABELS and BoardColumnIcon so the menu rows match the column headers 1:1. onSelect is prevented so the menu stays open while toggling several lanes.
  • V2WorkspacesBoard filters getVisibleBoardColumns(...) (from #6563) by hiddenLanes.

Manual QA Checklist

Verified end-to-end over CDP against the dev app (renderer on this branch, real signed-in session):

  • Display menu shows the Lanes section with all six lanes checked and their status icons
  • Unchecking "Needs attention" removes the lane from the board immediately; menu stays open
  • Re-checking restores the lane
  • Lanes section absent in list view
  • #6563 behavior intact: archived hidden by default omits empty Merged/Deleted lanes; "Past week" restores them
  • Zero renderer console errors during the flow

Testing

  • bun run --cwd apps/desktop typecheck
  • bun test for the v2-workspaces suite (16 pass: new toggleLane/reset tests + existing store, board-column, and filter tests)
  • Mutation check: no-op'ing toggleLane makes the new test fail
  • Scoped biome check --write on all touched files

Known Limitations / Follow-ups

  • hiddenLanes is in-memory only — not persisted to the URL or across restarts (same as other filter state pre-#6563; URL persistence is a natural follow-up).
  • Hiding all six lanes yields an empty board; Linear solves discoverability with an always-visible "Hidden columns" rail at the board's end — good follow-up if we want parity.
  • No per-lane-header hide affordance (Linear's ⋯ → Hide column) yet; the Display menu is the single control surface for now.

Summary by cubic

Adds per-lane visibility toggles to the Workspaces board and sets Board as the default view with archived items hidden by default. Previously only empty Merged/Deleted lanes were implicitly hidden when archived were hidden; now users can show/hide any lane from the Display menu.

Review notes

  • UI: Display dropdown adds a Lanes section (Idle, Working, Needs attention, Needs review, Merged, Deleted) with status icons; shown only in board view; the menu stays open while toggling.
  • Store: adds hiddenLanes and toggleLane(lane); defaults now viewMode: "board" and archivedWindow: "none"; reset() clears filters and hidden lanes, preserves the chosen view, and restores archived to "none".
  • Rendering: board uses getVisibleBoardColumns(...); when archivedWindow === "none", empty Merged/Deleted lanes are omitted; visible lanes are further filtered by hiddenLanes.
  • Routing: view accepts "board" or "list"; default values are omitted from the URL (view omitted when board, archived omitted when none); parsing handles both.
  • Tests: adds unit tests for getVisibleBoardColumns and the filter store. Hidden lanes are not persisted (URL/app state persistence is a follow-up).
  • Supersedes and includes #6563.

Summary by CodeRabbit

  • New Features
    • Added board display controls to show or hide individual workspace lanes.
    • Board columns now adapt to archive settings and available workspace counts.
    • Preserved selected board or list view and filters when navigating or sharing URLs.
  • Bug Fixes
    • Corrected empty-state behavior for all archive-window filters.
    • Archived columns now remain visible when they contain workspaces.
  • Tests
    • Added coverage for lane visibility, archive column behavior, filter resets, and lane toggling.