FN-5716: replace base-branch input with branch dropdown

Switch task base-branch selection to prefer existing branches while preserving custom entry when needed.

- fetch local git branches for TaskForm and sort common integration branches (main/master/trunk/develop) first
- render base branch as a dropdown with default and Custom… options, with fallback custom input mode and toggle back to dropdown
- update TaskForm/NewTaskModal tests for branch loading, dropdown ordering, unknown-branch fallback, and fetch failure behavior
- document the new branch dropdown + custom fallback behavior in dashboard guide branch planning rules

Files changed:
 docs/dashboard-guide.md                            |   4 +-
 packages/dashboard/app/components/TaskForm.tsx     | 100 +++++++++++++++++++--
 .../app/components/__tests__/NewTaskModal.test.tsx |   1 +
 .../app/components/__tests__/TaskForm.test.tsx     |  66 +++++++++++++-
 4 files changed, 156 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-5716

Fusion-Task-Lineage: 0ed72020-d8a0-4675-92d3-9476f53a173a
This commit is contained in:
gsxdsm
2026-05-30 09:40:44 -07:00
parent 805eae4237
commit 98e6a7364e
4 changed files with 156 additions and 15 deletions

View File

@@ -108,7 +108,7 @@ Planning Mode now includes branch controls on the summary screen before you crea
- `Use existing branch`
- `Create custom new branch`
- **Branch name** is required when using `existing` or `custom new` strategies.
- **Merge target / base branch (optional)** lets you set the PR base branch (for example `main` or `develop`).
- **Merge target / base branch (optional)** uses a dropdown of existing local branches (with common names like `main`/`master`/`trunk`/`develop` listed first) plus a **Custom…** fallback when you need to type a branch that is not local yet.
These values are sent with the Planning Mode create-task request as `branchSelection`, so created tasks persist branch/base-branch settings consistently with other branch-aware task creation flows.
@@ -126,7 +126,7 @@ Rules:
- `existing` and `custom-new` require a branch name.
- `project-default` leaves `branch` unset.
- `auto-new` creates a branch after task creation using `fusion/{task-id}-{short-name}` (for example `fusion/fn-5671-branch-strategy-dropdown`).
- `Merge target / base branch` stays optional for all modes.
- `Merge target / base branch` stays optional for all modes and uses the same branch-dropdown + `Custom…` fallback behavior as Planning Mode.
## Chat View