Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

[Spec #24] Feature board view - #63

Merged
64ix merged 27 commits into
mainfrom
spec/24-feature-board
Aug 25, 2026
Merged

64ix merged 27 commits into
mainfrom
spec/24-feature-board

Conversation

@64ix

@64ix 64ix commented Aug 24, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1586 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1585
Prod 48 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3324 $\color{#cf222e}{\Huge{\mathbf{−}}}$​46 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3278

Summary

Implements the Feature board: a first-class delivery-tracking view with 7 fixed pipeline columns (idea → exploring → spec → implementing → review → shipped + triage), full card anatomy, authority-gated drag & drop stage declaration, an adoption "+" on every column, and search & filters.

Built on the merged foundation specs — stage storage (#21), derivation (#22), authority (#23). The board and the classic kanban drawer are mutually exclusive: staged workspaces appear only here, unstaged ones only there. Ghost cards (#25), the archived sink and fade timing (#26), the task detail panel (#27), and sidebar stage groups (#28) remain owned by their own specs and are out of scope.

Spec & Tickets

Closes #24
Closes #44
Closes #47
Closes #48
Closes #50

Acceptance criteria

Criterion Verdict Evidence
#44 Sidebar entry opens the board in one click ✅ store/slices/ui.ts openBoardPage; shared/top-level-view.ts
#44 Project picker scopes the board per repo ✅ FeatureBoardPage.tsx:116; feature-board-project-scope.test.ts
#44 Column membership from effective stage; 7 fixed columns never rearrange ✅ feature-board-view-model.ts:69; test "always returns all seven fixed columns"
#44 Card anatomy: name, repo chip, branch, agent dot, PR chip, children ✅ FeatureBoardCard.tsx (reuses WorktreeCard); feature-board-card-model.test.ts
#44 Column order persists per project; stale ids filtered at read ✅ shared/feature-board-column-order.ts; 11 cases in its test
#44 Awaiting-input cards elevate (amber), frozen during drag ✅ feature-board-view-model.ts:58; "drag freeze" suite
#44 Remote-host workspaces appear like local ones ✅ No host filtering in the board data path; use-feature-board-columns.test.tsx
#47 Dragging a card to a column declares the stage ✅ use-feature-board-card-drop.ts; test "declares the target stage…"
#47 Blocked drops show the guard's explanation, card stays put ✅ use-feature-board-card-drop.ts:78; feature-board-drop-handler.test.ts
#47 Human can drop onto shipped and de-ship without re-shipping ✅ feature-board-drop-handler.ts:86; test "records the consumed merge…"
#47 Existing DnD machinery reused (previews, indicators, resize) ✅ use-feature-board-card-pointer-drag.ts imports the drawer's DOM modules; drawer suite unaffected
#47 Drop gating tested at the drop-handler seam ✅ feature-board-drop-handler.test.ts (8 cases)
#48 "+" on any column creates a worktree in that column ⚠️ Direct-launch path ✅ (feature-board-adoption-action.test.ts); composer-fallback gap below
#48 An issue/PR can optionally be linked at creation ✅ FeatureBoardAdoptionDialog.tsx; feature-board-adoption-link-query.test.ts
#48 A grabbed [Spec] lands at spec via derivation ✅ feature-board-adoption-plan.test.ts; no derivation change needed
#48 Creation rides the existing Use-issue flow ✅ feature-board-adoption-action.ts calls launchWorkItemDirect
#48 Dialog outcomes tested at the adoption-action seam ✅ 3 test files, 22 cases
#50 Search matches card content ✅ feature-board-search.ts reuses matchWorkspaceBoardWorktrees
#50 Filters cover stage, agent state, PR state, needs-attention, and combine ✅ feature-board-filters.test.ts (4 dimensions + AND combination)
#50 Empty states stay quiet ✅ FeatureBoardColumn.tsx:53; all 7 columns persist when filtered empty
#50 Pattern parity with the drawer's search ✅ Reuses searchWorktrees with evidencePolicy: 'board'; mirrors useDeferredValue + Set stabilization

Changes

Board view & navigation — new board TopLevelView, sidebar entry, store actions, routing in AppWorkspaceShell.tsx.

Pure view-model — feature-board-view-model.ts (column membership, order, awaiting-input elevation), project scope, card model. Kept pure so DnD, adoption, and filtering compose without redesign.

Per-project card order (new) — shared/feature-board-column-order.ts + persistence. Spec #21 specified this model but no prior ticket built it; follows the applyManualRepoOrder precedent so stale ids are structurally never consulted.

Drag & drop — reuses the drawer's pointer machinery (no new dnd-kit). Every drop passes the authority guard as callerKind: 'human'; de-ship records the consumed merge so the old merge cannot re-ship. Shared helpers were generalized, not duplicated: CardDragIdentity on the drag-preview DOM, an extracted kanban-lane-drop-target-rects.ts, and a shared resolveWorkflowStageDerivationInputs.

Adoption — per-column "+" opening FeatureBoardAdoptionDialog, riding launchWorkItemDirect. No stage logic duplicated: derivation already promotes any open linked issue to spec, so [Spec] needs no title sniffing.

Search & filters — render-time only, never persisted. Reuses the drawer's fuzzy ranked matcher and its re-render discipline.

Decisions & arbitration

  • Per-project order storage did not exist despite spec [Spec] Board state storage & two-board model #21 specifying it — Feature board skeleton: view, columns, cards, order #44 built it rather than blocking.
  • The RPC was deliberately not extended with a client-reported caller kind. A self-reported callerKind: 'human' travels the same channel CLI/MCP/mobile callers use, so any agent could set it and defeat the fail-closed shipped guard. Instead the refusal surfaces through updateWorktreeMeta's { ok, error } contract and is toasted, with the optimistic write reconciled away. Traced end-to-end through the RPC/IPC error chain during final review.
  • Multi-project column order concatenates per project rather than globally re-ranking — no natural cross-project ordering exists.
  • Project-picker selection is session-local, so Tasks and Board scoping never fight.
  • Board eligibility includes folder repos (unlike Tasks) since folder workspaces ride the pipeline in a manual regime.
  • Adoption "+" is hidden for folder-only scopes — adoption creates a git worktree.

Cross-unit bug found and fixed in integration review

Dragging a card while a filter was active corrupted the persisted column order. The drop handler wrote the new order from the rendered (filter-narrowed) card list, so same-project cards hidden by the filter were silently dropped from the persisted per-column order and bumped to the bottom once the filter cleared. Fixed by threading the unfiltered card list through and restoring hidden-but-valid ids anchored to their prior visible neighbor (restoreHiddenFeatureBoardColumnOrderIds), with unit and integration coverage.

Known gaps for human attention

  1. Adoption on a setup-policy-ask repo lands unstaged (medium). The "+" falls back to NewWorkspaceComposerModal, which has no create-time stage slot, so the worktree is created without the pressed column's stage. Deeper than it first appears: submitQuick → runBackgroundWorktreeCreation → executeWorktreeCreation is fire-and-forget with no completion hook, so the fix needs new completion-event plumbing rather than a callback reuse. Deliberately left as a follow-up rather than attempted inside this PR.
  2. Multi-host project collapsing (medium). The picker reuses TaskPage's pattern of collapsing host-clones of a project into one selection. Safe for Tasks (issues are host-independent), but board cards are per-host worktrees — with a project cloned locally and over SSH, only one host's cards show at a time. Inherited from shared picker semantics; changing it would affect Tasks too, so it wants a product decision.
  3. useFeatureBoardCards is computed twice per render (low, harmless). Pure and deterministic; left alone to avoid churning Feature board skeleton: view, columns, cards, order #44's tested hook signature.

QA plan

  • Sidebar "Board" entry opens the Feature board in one click
  • All 7 columns are visible on an empty board and stay in fixed order
  • Project picker switches scope; cards change to match the selected repo
  • A card shows name, repo chip, branch, agent-state dot, and PR chip
  • A feature with children shows them as sub-entries with PR state
  • Staged workspaces appear ONLY on this board; unstaged ONLY in the classic drawer
  • Archived workspaces do not appear in the columns
  • A workspace whose agent is blocked/waiting floats to its column top with an amber marker
  • Reordering cards in a column survives an app restart, scoped to that project
  • A remote/SSH workspace renders identically to a local one
  • A folder workspace appears with a folder marker and keeps its declared stage
  • Dragging a card between columns declares the new stage
  • Dragging a card on a remote workspace onto shipped shows the guard's explanation and the card reverts
  • Dropping a card off shipped de-ships it without the old merge immediately re-shipping
  • Reordering with a search/filter active does not disturb the order of cards hidden by that filter
  • Columns can be resized and the width persists
  • "+" on a column opens the adoption dialog and creates a worktree in that column
  • Adopting with a linked [Spec] issue lands the card in spec
  • "+" is absent when only folder repos are in scope
  • Search narrows cards; all 7 columns remain visible when results are empty
  • Stage / agent-state / PR-state / needs-attention filters combine
  • The classic kanban drawer's drag, search, and selection still behave as before

64ix added 27 commits August 24, 2026 20:24
…mbly

Implements the testable seams for #44 (feature board skeleton, part of spec #24):
- buildFeatureBoardColumns: column membership from effective stage, persisted
  order stability, stale-id filtering, awaiting-input elevation, and the
  drag-freeze (#47) / search-filter (#50) extension seams.
- getFeatureBoardScopedWorktrees: per-project, non-archived scoping.
- buildFeatureBoardCards: assembles cards + lineage children (#5) from
  pre-resolved effective-stage/awaiting-input inputs.
- feature-board-column-order: per-project, per-column persisted order model
  (spec 21), following the applyManualRepoOrder rank-map precedent.
…ard UI

Implements the rest of #44 (feature board skeleton, spec #24):
- New 'board' TopLevelView wired through ui-chrome-types, top-level-view,
  right-sidebar-visibility, client-ui-schemas (remote wire parity), and the
  UISlice's open/closeBoardPage + previousViewBeforeBoard round trip.
- Sidebar 'Board' nav entry (SidebarNav.tsx) opens the board in one click.
- FeatureBoardPage: TaskPage repo-selection-pattern project picker, seven
  always-visible columns in WORKFLOW_STAGE_IDS order.
- FeatureBoardCard: builds on WorktreeCard (repo chip, branch, agent-state
  dot, PR chip), adds an amber awaiting-input marker and a folder-workspace
  marker; children render as nested read-only WorktreeCards (#5 lineage).
- FeatureBoardColumn/-Header carry documented, unused extension points for
  #47 (onDropCard) and #48 (headerAction).
- setFeatureBoardColumnOrder store action + featureBoardColumnOrder
  persisted-UI-state field (read/update normalization wired in main).
…actor sees literal keys

translate() calls with variable args (a [key, fallback] tuple pulled from a
Record) are invisible to the static localization scanner used by #44's lint
gate; a switch/case over literal translate() calls fixes the catalog check
and adds the new auto/manual keys to en.json.
… card-property setting

WorktreeCard's own branch row is gated behind the user's worktreeCardProperties
preference ('branch' is not in DEFAULT_WORKTREE_CARD_PROPERTIES), so a default
profile would render the board card anatomy without branch — one of #44's
explicit acceptance criteria. Adds a standalone branch row using the same
branchName()/TruncatedSidebarLabel building blocks the sidebar uses, so the
board is honest about branch identity independent of that setting.
…to-end store wiring

Covers effective-stage-based column membership, persisted column order,
and awaiting-input elevation together through a real store snapshot —
the pure buildFeatureBoardColumns/buildFeatureBoardCards tests already
cover the algorithms in isolation, but nothing exercised the hook that
wires prCache/issueCache/agentStatusByPaneKey/featureBoardColumnOrder
into them (#44).
…#50)

Adds text search + stage/agent-state/PR-state/needs-attention filters
combined into buildFeatureBoardColumns's visibleCardIds seam.

Refs #50
…taleness

Covers matchFeatureBoardCardIdsByQuery, combineFeatureBoardVisibleCardIds,
matchFeatureBoardCardsByFilters (each dimension + AND combination),
useFeatureBoardSearchFilters end-to-end through the store, and the
exported knownPullRequestFor merged-staleness rule reused by the PR-state
filter.

Refs #50
… test

The WIP checkpoint's merged-PR test set a partial settings object directly
against useAppStore.setState, which requires the full GlobalSettings shape.
Cast to AppState['settings'], matching existing test precedent (e.g.
browser-remote-tab-creation.test.ts).

Refs #50
- Add a per-column "+" that opens an adoption dialog: name a new feature or
  link an existing GitHub issue/PR, declaring the pressed column's stage.
- Ride the existing launchWorkItemDirect() Use-issue flow via a new pure
  decision function (feature-board-adoption-plan.ts) and a thin, injectable
  action seam (feature-board-adoption-action.ts) so dialog outcomes are
  testable without exercising the whole launch pipeline.
- Extend LaunchWorkItemDirectArgs with an optional onWorktreeCreated hook so
  callers can declare state right after creation without re-deriving the id.
- No changes to stage derivation: any linked open issue (including a grabbed
  [Spec]) already promotes idea/exploring to spec via the existing engine.
…48)

- buildFeatureBoardAdoptionPlan: declares the pressed column regardless of a
  link, plain-name vs linked-issue/PR item shapes, and composes with the
  unmodified deriveWorkflowStage to show a linked [Spec] issue lands at
  spec via the existing engine.
- runFeatureBoardAdoption: stage declared once the worktree exists, issue/PR
  attachment, and the composer-modal fallback path with no stage write.
- parseFeatureBoardAdoptionLinkQuery: bare number, #-number, issue/pull URL,
  and rejection cases.
vi.fn() without an explicit generic infers Constructable|Procedure, which
tripped typecheck under strict mode. Type both mocks explicitly and use
satisfies to keep FeatureBoardAdoptionActionDeps as the contract.
Parameterizes resolveWorkspaceStatusDropTargetFromRects's rect-hit-testing
into a lane-key-generic helper so the feature board (#47) can reuse the
same geometry instead of duplicating it. Also exports the shared
drop-indicator DOM singleton for cross-board reuse.

Refs #47
…ores

decideFeatureBoardCardDrop wraps the shared stage-authority gate
(decideStageWrite, callerKind: 'human' from the board) so a drop's
outcome — allowed/refused, the guard's own explanation, and the
resulting meta write including the de-ship consumed-merge bookkeeping —
is pure and directly testable.

computeFeatureBoardColumnOrderAfterDrop is the per-project column-order
math for persisting card position on drop.

Refs #47
getFeatureBoardCardDropTarget resolves which column/index a pointer
point targets, reusing the classic drawer's rect-math (lane hit-test,
card index/indicator placement) and its shared drop-indicator DOM
singleton — the board has no virtualization/pin-drop to special-case.

Refs #47
Wires the checkpointed drop-decision/DOM-resolution primitives into a real
pointer drag: use-feature-board-card-pointer-drag (single-card, reuses the
classic drawer's preview/indicator DOM + start/ignore heuristics), and
use-feature-board-card-drop (authority-gated commit: resolves current
governing facts, calls decideFeatureBoardCardDrop as callerKind:'human',
persists workflowStage + column order on success, toasts the guard's
explanation on refusal).

Also:
- Generalizes workspace-kanban-card-drag-preview-dom.ts with a CardDragIdentity
  param so the feature board can reuse the preview/dragging-state DOM without
  duplicating it (classic drawer callers keep their default identity).
- Extracts resolveWorkflowStageDerivationInputs from effective-workflow-stage.ts
  so the drop handler can reuse the same fact lookup independent of a
  particular declared stage.
- Threads frozenColumnOrder through use-feature-board-columns.ts, owned by
  FeatureBoardPage and snapshotted at drag start / cleared at drag end.
- Adds feature board column resize (useWorkspaceKanbanColumnResize reused
  as-is) with its own persisted featureBoardColumnWidth setting.
…-drop test

Follow-up to #47: the dragged card must appear in its source column for the
hook to find it, and the expected persisted order must include the dropped
card at its drop index.
Matches the classic drawer's WorkspaceKanbanLaneGrid width templating
instead of relying on React's implicit unit for the width CSS property.
Ref #47.
useFeatureBoardCardDrop persisted the target column's order from the
rendered (search/filter-narrowed) card list only. Dropping a card while
a filter hid same-project siblings silently dropped their ids from the
persisted per-project order — buildFeatureBoardColumns then treated
them as unranked and bumped them to the bottom next time the filter
cleared.

Thread the full unfiltered card list into the drop hook so it can tell
'hidden by the active filter' apart from 'no longer a member of this
stage', and restore hidden-but-still-valid ids into the freshly
computed order, anchored to the visible neighbor they followed before
the drop.
Fixes the 'Ref mutated during render' React Doctor error (Bugs
category) flagged on PR #63 for spec #24. Three sites wrote to
ref.current unconditionally during render:

- FeatureBoardPage.tsx: columnsRef
- use-feature-board-card-drop.ts: columnsRef/allCardsRef/repoMapRef
- use-feature-board-card-pointer-drag.ts: onDropCardRef/
  onDragActiveChangeRef/onDragTargetChangeRef

All three refs are read only from native pointer-event handlers
(pointermove/pointerup/pointercancel/blur) registered in an effect,
which run long after render+effect flush completes, so switching the
writes to useEffect(() => { ref.current = value }, [value]) cannot
change which render's value a handler observes. This preserves the
documented drop-order contract: the drop commit still reads the
*pre*-unfreeze columns because the unfreeze state update
(setFrozenColumnOrder(null)) is asynchronous and does not re-render
synchronously before the drop's onDropCardRef.current(...) call.

Also applies a small, low-risk Performance fix already used
elsewhere in the codebase: array.toSorted() instead of
[...array].sort() in applyAwaitingInputElevation.

Ref: #24
@64ix
64ix marked this pull request as ready for review August 24, 2026 22:21
@64ix
64ix merged commit 5ee7a60 into main Aug 25, 2026
95 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

1 participant