Skip to content

feat(web): "Fork from current state" toggle + base-branch input#173

Merged
saucam merged 3 commits into
mainfrom
feat/fork-basebranch-default-main
Jul 14, 2026
Merged

feat(web): "Fork from current state" toggle + base-branch input#173
saucam merged 3 commits into
mainfrom
feat/fork-basebranch-default-main

Conversation

@saucam

@saucam saucam commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Reworks the fork dropdown's base-branch UX per feedback (supersedes the earlier "prefill main" approach).

Design

  • No prefill. The default remains fork from current state (carry the parent's uncommitted changes) — the deliberate default is preserved.
  • "Fork from current state" toggle (default on):
    • On → the base-branch input is disabled (placeholder "— using current state —"). There's no base to pick; you're branching from where you are.
    • Off → the input enables for a base branch (e.g. main); the fork is a clean checkout of it.
  • The branch input takes a branch only (shown under isolation; the daemon validates the ref).
  • Fork actions are disabled when "from a base" is selected but no branch is entered (no confusing no-op). The footer reflects the active mode.

So: current-state ⇄ base-branch is now an explicit toggle, and you can't type a branch while forking from current state.

Tests

Default fork sends no isolate/baseBranch; base input disabled while current-state is on; isolate-off sends isolate:false; toggling current-state off + entering a branch sends baseBranch; empty base blocks the fork. Web suite 220 pass, tsc clean.

🤖 Generated with Claude Code

The fork dropdown's base-branch box now defaults to "main", so the common
"branch a fresh worktree off main" flow is one click. The dropdown footer
reflects the choice ("Clean branch off `main` …" vs "carrying your current
changes" when cleared).

Behavior note: with a base set, the fork is a CLEAN checkout of that ref — it
does NOT carry the parent's uncommitted changes. Clear the box to fork from the
parent's current state instead. (Repos whose default branch isn't "main" can
edit the box; the daemon validates the ref and errors clearly on a bad base.)

Test: default fork now sends baseBranch:"main"; the input shows "main"
prefilled. Web suite green, tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.90%. Comparing base (3bb2fc4) to head (a73ef47).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #173   +/-   ##
=======================================
  Coverage   84.90%   84.90%           
=======================================
  Files         106      106           
  Lines       18678    18678           
=======================================
  Hits        15858    15858           
  Misses       2820     2820           
Flag Coverage Δ
daemon 84.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…branch input

Reworks the fork dropdown per feedback (supersedes the "prefill main" idea):

- No prefill. Default stays "fork from current state" (carry uncommitted
  changes) — the earlier deliberate default is preserved.
- Add a "Fork from current state" toggle (default on). When ON, the base-branch
  input is DISABLED (placeholder "— using current state —") — there's no base
  to pick. When OFF, the input enables for a base branch (e.g. main) and the
  fork is a clean checkout of it.
- The base-branch input is for a branch only (shown under isolation; the daemon
  validates the ref).
- Fork actions are disabled when "from a base" is selected but no branch is
  entered (prevents a confusing no-op); footer reflects the active mode.

Tests: default fork sends no isolate/baseBranch (current state); base input
disabled while current-state is on; isolate-off sends isolate:false; toggling
current-state off + entering a branch sends baseBranch; empty base blocks fork.
Web suite 220 pass, tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@saucam saucam changed the title feat(web): prefill the fork base-branch input with "main" feat(web): "Fork from current state" toggle + base-branch input Jul 13, 2026
…anch mode

Refinement: turning "Fork from current state" OFF now defaults the (newly
enabled) branch input to "main" when it's empty — so "fork off main" is one
step — while current-state stays the default and nothing is prefilled until you
opt into base mode. Still editable/clearable (clearing it blocks the fork).

Tests: toggling off prefills "main" and forks from it; clearing the branch
after toggling off blocks the fork. Web suite green, tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@saucam saucam merged commit f4139b7 into main Jul 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant