Skip to content

feat(native): reuse previous worktrees from the composer - #205

Merged
rynfar merged 3 commits into
nativefrom
nw/180-previous-worktree
Nov 4, 2026
Merged

rynfar merged 3 commits into
nativefrom
nw/180-previous-worktree

Conversation

@rynfar

@rynfar rynfar commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Drafts can reuse the newest eligible worktree in their selected environment/project from the workspace menu or composer.previousWorktree. The picker excludes archived/current worktrees, shows the branch label, persists the destination-scoped choice, and launches through the existing existing_worktree strategy.

Composer searches and provider workspace snapshots now resolve against that same checkout. Changing workspace/environment clears stale menu results and guards delayed search completion. Failed preparation or launch restores the captured original draft, including attachments/context, even after navigation; a newer edit in that target takes precedence. Workspace popup arrows, Enter and Escape own their actions before the prompt, with a bounded highlighted selection. The direct previous-worktree shortcut remains available. Workspace visibility and shortcut/key eligibility share one predicate: non-repository projects cannot open an invisible popup, error/retry remains visible during refresh, and losing availability closes an open menu and releases prompt keys.

Partial follow-up for #180 / GT-BRANCH. Cleanup is wholly deferred. All 130 other capability rows retain identical cell values against fork/native, including AP-NOTIFY/#12; formatting realigns only table padding.

Validation:

  • Hidden non-repository guard regression: /private/tmp/native-205-r3-red.log fails with “non-repository shortcut opened an invisible workspace popup”. The green fixture /private/tmp/native-205-r3-green.log passes through actual open/key/Enter handlers: hidden shortcuts/keys are refused, empty Enter reaches an intercepted submit, visible error/retry remains accessible while refreshing, and availability loss releases keys. No launch RPC or actual non-repository project mutation. Reproduce with --new-thread --workspace-availability-fixture on the offscreen snapshot binary and copied smoke home. Local capture: /private/tmp/native-205-r3-green.png.
  • Red-first search cwd assertion: /repo versus expected /wt/feature in /private/tmp/native-205-r2-cwd-red.log. The extended existing core case checks file/skill request params and environment/root fallback.
  • Red-first offscreen failure completion: /private/tmp/native-205-r2-recovery-red.log fails with “failed send lost original draft”. The same real begin-send/switch-draft/completion path now passes destination-change and RPC-failure recovery, attachment/context ownership, persisted data, concurrent original-target edits, and unchanged selected-target text: /private/tmp/native-205-r2-recovery-green.log.
  • Red popup keyboard audit records one attempted submission (intercepted before RPC) and a changed prompt: /private/tmp/native-205-r2-keys-red.json. Green audit records zero submissions, unchanged prompt and menuCwd=/fixture/worktrees/previous: /private/tmp/native-205-r2-keys-green.json. Up/wrap, Escape and the direct shortcut also pass: /private/tmp/native-205-r2-navigation.json and native-205-r2-keys-green-assert.log.
  • Fresh checks on native 72033f6926a77957819bb0e6e91e365cab73ae6b: cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace (1,354 tests), cargo build -p t3-native, theme check, parity sync (42 tests), conformance drift check, and vp run check:changed fork/native. Raw logs: /private/tmp/native-205-r3-{clippy,tests,build,theme,parity,conformance,check-changed}.log.
  • Local evidence: original baseline /private/tmp/native-180-before.png; keyboard before /private/tmp/native-205-r2-keys-red.png; after /private/tmp/native-205-r2-keys-green.png; navigation/highlight /private/tmp/native-205-r2-navigation.png. All captures use the offscreen renderer and copied smoke14658 state. No new server, provider turn, checkout mutation, clipboard use, or real window.

Remaining in #180:

  • Cleanup: normalized shared/orphan guards across threads, authoritative occupant lookup when shell families omit children, failed-read keep behavior, scratch-project exclusion, destination write permissions and destructive confirmation, deletion/removal ordering, pending state, separate removal/refresh errors and recovery. This PR adds no removal path.
  • Full draft/base and branch selector controls, including start-from-origin and native multi-model forced-new UI (the current composer launches one model).
  • Persisted/offline ref snapshots and recovery; PR checkout; repository publishing UI.

Live launch/removal mutations, multi-environment UI switching and real missing-root/permission-denied server responses remain unverified end to end. Failure completion and request parameters are exercised without server/provider mutation. Worktree retained for review; #180 remains open and partial.

Built with GPT-6.1 Sol in Codex

@rynfar rynfar mentioned this pull request Nov 4, 2026
1 of 6 tasks
@rynfar
rynfar force-pushed the nw/180-previous-worktree branch from 0333ca4 to 1735e75 Compare November 4, 2026 12:32
@rynfar
rynfar force-pushed the nw/180-previous-worktree branch from 1735e75 to 3f1149b Compare November 4, 2026 13:04
@rynfar
rynfar merged commit db6b7fb into native Nov 4, 2026
@rynfar rynfar mentioned this pull request Nov 4, 2026
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