Skip to content

feat(web): worktree toggle + cleaner new-session wizard#978

Merged
njbrake merged 2 commits intonjbrake:mainfrom
X-Skoprio:feature/web-ui-worktree-toggle
May 8, 2026
Merged

feat(web): worktree toggle + cleaner new-session wizard#978
njbrake merged 2 commits intonjbrake:mainfrom
X-Skoprio:feature/web-ui-worktree-toggle

Conversation

@X-Skoprio
Copy link
Copy Markdown
Contributor

Description

The web dashboard's "New session" wizard always created a git worktree on a new branch — there was no way to say "just run the agent in the repo folder." The TUI exposes this; the backend already supports it (worktree_branch: Option<String> in CreateSessionBody, gated at src/session/builder.rs:228); only the web UI was forcing a value.

This PR closes that gap and tightens the wizard flow:

  • New "Create a worktree" toggle on the wizard. Off ⇒ frontend sends worktree_branch: undefined and create_new_branch: false, and the backend takes the existing no-worktree path. Default stays on, so existing behaviour is unchanged.
  • Restructured wizard from 3 steps (Project → Settings → Review) into 4 linear steps (Project → Session → Agent → Review). Title and the worktree toggle/branch name now live on a dedicated Session step rather than being buried under "Advanced settings" on the Settings step.

No backend or API changes — CreateSessionBody.worktree_branch was already Option<String> and create_new_branch was already a bool.

Files changed

  • web/src/components/session-wizard/SessionWizard.tsx — adds useWorktree to WizardData; submit body branches on it; new step ordering.
  • web/src/components/session-wizard/StepIndicator.tsx — adds "session" to StepId.
  • web/src/components/session-wizard/steps/SessionStep.tsx — new component (title + worktree toggle + branch/worktree name).
  • web/src/components/session-wizard/steps/AgentStep.tsx — removes the title/branch inputs (moved to SessionStep), keeps agent / sandbox / yolo / advanced.
  • web/src/components/session-wizard/steps/ReviewStep.tsx — Branch row label is now "Branch / worktree" (since the branch name is also the worktree dir name); shows "None — runs in repo folder" when worktree is off.

PR Type

  • New Feature

Checklist

  • I understand the code I am submitting
  • New and existing tests pass
  • Documentation was updated where necessary
  • For UI changes: included screenshot or recording

(Docs unchanged — this is a UI-only refinement of an existing feature, not a new public API. Happy to add a screenshot in a follow-up commit if maintainers want one inline.)

How I tested

  • cargo fmt --check clean
  • cargo clippy --features serve --all-targets -- -D warnings clean
  • cargo test --features serve — 1700+ passing, 0 failed
  • cd web && bun run build clean (TypeScript + Vite)
  • Manually exercised both modes in aoe serve --no-auth: worktree-on creates a new worktree (git worktree list grows); worktree-off runs in the repo folder (git worktree list and git branch --show-current unchanged).

AI Usage

  • AI was used for drafting/refactoring

AI Model/Tool used: Claude Code (Opus 4.7)

Any Additional AI Details you'd like to share:
Used Claude Code to explore the codebase, draft the wizard restructuring, and draft this PR description. All design decisions and the final review were done by me.

  • I am an AI Agent filling out this form (check box if true)

Adds a "Create a worktree" toggle to the web dashboard's new-session
wizard so users can opt out of worktree creation (the backend already
supported worktree_branch=null but the frontend always sent a value).

Also restructures the wizard from 3 steps (Project, Settings, Review)
into 4 linear steps (Project, Session, Agent, Review). Title and the
worktree toggle/branch name now live on a dedicated Session step
instead of being buried under Advanced settings on the Settings step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@X-Skoprio X-Skoprio requested a review from njbrake as a code owner May 8, 2026 09:25
@Seluj78
Copy link
Copy Markdown
Contributor

Seluj78 commented May 8, 2026

Very good idea thanks!

Even though it's only in beta, I feel like it's very important to have the web UI match the TUI as much as possible! I can't test it right now but looking at the PR on my phone it looks good.

@njbrake
Copy link
Copy Markdown
Owner

njbrake commented May 8, 2026

Hi @X-Skoprio thanks so much! Would you mind attaching a screenshot or screen recording of the functionality?

@X-Skoprio
Copy link
Copy Markdown
Contributor Author

X-Skoprio commented May 8, 2026

@njbrake Sure, here are some screens :
image
image
image
image
image

Group is session metadata (organization/naming), not agent runtime
config. Co-locating it with Title on the Session step keeps the Agent
step focused on tool/sandbox/yolo plus advanced runtime settings, and
gives the Session step more substance so it doesn't feel like a
speed-bump for users who skip the worktree toggle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@njbrake njbrake merged commit 1efbaef into njbrake:main May 8, 2026
11 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.

3 participants