feat(web): "Fork from current state" toggle + base-branch input#173
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…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>
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks the fork dropdown's base-branch UX per feedback (supersedes the earlier "prefill main" approach).
Design
main); the fork is a clean checkout of it.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 sendsisolate:false; toggling current-state off + entering a branch sendsbaseBranch; empty base blocks the fork. Web suite 220 pass, tsc clean.🤖 Generated with Claude Code