feat(tui): add worktree support for session creation#13528
feat(tui): add worktree support for session creation#13528abrekhov wants to merge 2 commits intoanomalyco:devfrom
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found one potentially related PR: PR #12008: fix: filter CLI sessions by current directory for worktree support Why it might be related: This PR addresses worktree support at the CLI level by filtering sessions based on the current directory. Since the current PR (13528) adds worktree support to the TUI with directory-based session isolation, these two PRs are working on related aspects of the same worktree feature - one for CLI and one for TUI. All other search results either returned the current PR itself (13528) or unrelated PRs about memory leaks, layouts, snapshots, etc. |
…on sync - Replace standalone signal with KV-derived accessor for worktree selection - Forward global.event RPC channel in createEventSource for cross-worktree events - Add directory field to SessionRoute for worktree-scoped navigation - Use worktree-scoped client in session.sync when directory is provided - Track resolved directory through submit flow for correct routing
Summary
/workspaceslash command (aliases:/worktree,/sandbox)Changes
context/sync.tsx— Tracksandboxeslist in sync store, fetch viasdk.client.worktree.list(), refresh onproject.updatedeventscontext/sdk.tsx— AddcreateClient(directory)helper to create SDK clients targeting specific worktree directoriescomponent/dialog-worktree.tsx(new) — Worktree selector dialog with options: main workspace, existing sandboxes, create newroutes/home.tsx— Workspace state persisted via KV, workspace label in footer barcomponent/prompt/index.tsx— Worktree-aware submit: creates worktree via API if needed, routes session/prompt calls through worktree-specific clientcomponent/dialog-session-list.tsx— Shows[workspace-name]for sessions belonging to a worktreeapp.tsx— Register/workspaceslash command (only for git projects)Testing
bun turbo typecheckpasses all 12 packagespackages/app/src/components/prompt-input/submit.ts,session-new-view.tsx)