Skip to content

feat: add explicit worktree setup flow#286

Merged
AmethystLiang merged 4 commits into
mainfrom
support-setup-script
Apr 4, 2026
Merged

feat: add explicit worktree setup flow#286
AmethystLiang merged 4 commits into
mainfrom
support-setup-script

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Problem

Orca worktree creation did not treat repo setup as an explicit product flow. Users could not choose whether setup should run for a new worktree, setup failures were hard to inspect, CLI-created worktrees did not feed the renderer startup path consistently, and several related worktree/terminal regressions around path handling and teardown were still open.

Solution

Promote setup to a first-class worktree creation flow while keeping the existing hook plumbing. The change adds repo-level setup run policy and per-create decisions, generates runner scripts plus PTY env injection for interactive setup terminals, wires both UI and CLI worktree creation through the same activation path, preserves Windows path normalization and delete-time terminal shutdown behavior, and updates the settings/create-worktree UI plus tests to cover the new setup lifecycle end to end.

- Centralize worktree activation setup flow

- fix: render orca.yaml file contents in settings repo pane instead of tags when using config file

- fix: command preview title for yaml configs

- fix: update UI copy and styling to better reflect yaml setup hooks

- fix: run setup hook in background if CLI worktree is created while GUI is closed

- fix: prevent duplicate terminal tab creation when creating worktrees from the UI

- fix: ensure CLI worktree create returns correct payload type and hooks up UI setup flow

- Squashed commits

- fix minor regression

- fix: close worktree context menu when deleting

- fix: keep delete dialog open while archive hook runs and support inline yaml scripts

- chore: fix lint, typecheck and react state mutations during render for setup script feature
Extract Windows path-handling tests into worktrees-windows.test.ts
to bring the original file under the 300-line oxlint max-lines rule.
The computeWorktreePathMock and ensurePathWithinWorkspaceMock were
cleared by afterEach but not re-established in the test, causing
areWorktreePathsEqual to receive undefined and crash.
@AmethystLiang AmethystLiang merged commit 90d0fae into main Apr 4, 2026
1 check passed
thomaszdxsn pushed a commit to thomaszdxsn/orca that referenced this pull request Jun 15, 2026
* feat: add explicit worktree setup flow

- Centralize worktree activation setup flow

- fix: render orca.yaml file contents in settings repo pane instead of tags when using config file

- fix: command preview title for yaml configs

- fix: update UI copy and styling to better reflect yaml setup hooks

- fix: run setup hook in background if CLI worktree is created while GUI is closed

- fix: prevent duplicate terminal tab creation when creating worktrees from the UI

- fix: ensure CLI worktree create returns correct payload type and hooks up UI setup flow

- Squashed commits

- fix minor regression

- fix: close worktree context menu when deleting

- fix: keep delete dialog open while archive hook runs and support inline yaml scripts

- chore: fix lint, typecheck and react state mutations during render for setup script feature

* fix(lint): split worktrees.test.ts to stay under max-lines limit

Extract Windows path-handling tests into worktrees-windows.test.ts
to bring the original file under the 300-line oxlint max-lines rule.

* fix(test): set up path mocks for setup launch payload test

The computeWorktreePathMock and ensurePathWithinWorkspaceMock were
cleared by afterEach but not re-established in the test, causing
areWorktreePathsEqual to receive undefined and crash.
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