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

feat(feature-board): stage assignment at creation and workspace adoption (#80) - #91

Merged
64ix merged 1 commit into
mainfrom
64ix/issue-80-stage-assignment-adoption
Aug 26, 2026
Merged

64ix merged 1 commit into
mainfrom
64ix/issue-80-stage-assignment-adoption

Conversation

@64ix

@64ix 64ix commented Aug 26, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​187 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​173
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​239 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​226

Summary

Adds the two missing entry points onto the feature board that #80 calls out — a composer stage picker at creation, and a non-drag adoption path for an already-existing unstaged workspace — both routed through the same decideFeatureBoardCardDrop authority gate the board's drag/panel paths already use. The sidebar's existing group-by-Stage drag path is untouched.

Closes #80

Acceptance criteria

Criterion Verdict Evidence
Creating a workspace from the composer can assign a stage in one flow ✅ NewWorkspaceStageField in the composer's advanced drawer (git-worktree targets), defaulting to idea; declared post-create via decideComposerStageAssignment in useComposerState.ts submit()
An unstaged workspace can be moved onto the board without drag (discoverable menu/dialog path) ✅ "Move to feature board…" submenu in WorktreeContextMenu → WorktreeFeatureBoardStageMenu, visible only while the workspace is unstaged
Drag-to-stage-group behavior unchanged ✅ sidebar-workflow-stage-drop.ts untouched; its test suite (16 tests) still passes unmodified
Authority rules (fact governance, shipped human-or-fact) still enforced on all new entry points ✅ Both new entry points call decideFeatureBoardCardDrop (composer via composer-stage-assignment.ts, adoption menu via the reused useTaskDetailPanelStageChange hook) — no direct workflowStage meta writes anywhere new

Changes by theme

Composer stage picker

  • src/renderer/src/components/new-workspace/NewWorkspaceStageField.tsx — new Select field (all WORKFLOW_STAGE_IDS + "No stage"), display-only.
  • src/renderer/src/components/feature-board/composer-stage-assignment.ts — pure helper wrapping decideFeatureBoardCardDrop for a freshly-created worktree (no facts/consumed-merges yet).
  • src/renderer/src/hooks/useComposerState.ts — workflowStage state (defaults 'idea', resets to 'idea' between sequential creates), wired into submit()'s post-create meta write and ComposerCardProps. Scoped to git-worktree targets — folder-workspace creation runs a separate submit path (submitFolderTarget) that doesn't plumb a stage write through yet.
  • src/renderer/src/components/NewWorkspaceComposerCard.tsx — renders the field in the Advanced drawer next to Note, git repos only.

Adoption entry point

  • src/renderer/src/components/sidebar/WorktreeFeatureBoardStageMenu.tsx — new submenu, reuses buildTaskDetailStageSelector (option gating + lock copy) and useTaskDetailPanelStageChange (the write). Hidden once staged or for a lineage child (its stage is inherited from the root ancestor, same rule the drag path enforces).
  • src/renderer/src/components/sidebar/WorktreeContextMenu.tsx — mounts the submenu.
  • src/renderer/src/components/feature-board/task-detail-panel/use-task-detail-panel-stage-change.ts (+ TaskDetailPanelStageSelector.tsx) — generalized to take a Worktree directly instead of a FeatureBoardCard, so a non-board surface can reuse the exact same guard delegate without duplicating it.

Localization

  • src/renderer/src/i18n/locales/en.json — 3 new keys via sync:localization-catalog.

Problem → Resolution

  • Extend FeatureBoardAdoptionDialog vs. add alongside: that dialog's fields (repo picker, name, issue/PR link) are about creating a new worktree; adoption of an existing one needs none of them, just a stage. Added a separate, focused surface (WorktreeFeatureBoardStageMenu) rather than overloading the dialog with a second, unrelated mode.
  • Folder-workspace stage at creation: the composer's folder-workspace submit path (submitFolderTarget → submitFolderWorkspaceCreate) is a materially different flow that doesn't currently return a worktree id in a place a stage write could hook into without materially larger surgery. Scoped the picker to git-worktree creation (same scoping precedent as branchNameOverride/baseBranch), and folder workspaces remain adoptable after creation via the new context-menu path regardless of workspace kind.

QA plan

  • Open the composer from the sidebar "+", leave Advanced closed — creating still defaults the workspace onto the feature board's Idea column.
  • Open Advanced in the composer, change the stage picker to e.g. Review, create — the new card lands in the Review column.
  • Right-click an unstaged workspace in the sidebar — "Move to feature board…" appears; picking a stage moves it onto the board and the item disappears from the menu afterward.
  • Right-click an already-staged workspace — no "Move to feature board…" item (board panel/drag cover changing it from there).
  • Right-click a lineage child of a staged parent — no "Move to feature board…" item.
  • With a workspace that has an open PR, sidebar drag onto a stage group still works exactly as before (unchanged code path).

…spaces (#80)

- Composer: optional stage picker (defaults to idea) for git-worktree creation,
  declared post-create through the same authority gate as every other stage-write
  entry point (decideComposerStageAssignment -> decideFeatureBoardCardDrop).
- Sidebar: "Move to feature board..." submenu on an unstaged, non-lineage-child
  workspace, reusing the task-detail panel's stage model/gate so option gating,
  lock copy, and authority rules can't drift from the board's own picker.
- Generalize useTaskDetailPanelStageChange to take a Worktree directly (not a
  FeatureBoardCard) so the sidebar surface can reuse it too.
- Sidebar drag-onto-stage-group path is untouched; its existing tests still pass.

Closes #80
@64ix
64ix merged commit 3e8732e into main Aug 26, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stage assignment at workspace creation and adoption of existing workspaces onto the feature board

1 participant