Repository navigation
Conversation
4fa65b6 to
3c90cf9
Compare
6855cf8 to
bdb756d
Compare
|
/move no longer exists in opencode2. behaviour has changed a lot. We have /worktrees: upon selecting a worktree, we get a new session, so this no longer moves the existing session, and there is /cd which sees to move the session to a new directory, which can be a worktree I think, but it doesn't do smart things like reading direnv in the new worktree. So in my opinion this is a regression in opencode2, which won't benefit from this PR. |
bdd1b0e to
63941e3
Compare
|
Thanks so much for the helpful context on the This PR targets the default |
63941e3 to
93f8f93
Compare
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
Issue for this PR
Closes #49212
Closes #40200
Closes #43938
Closes #35306
Type of change
What does this PR do?
The
/movesession command currently only surfaces worktrees of the current project and rejects destinations outside the project's worktree (DestinationProjectMismatchError). Searching for nested projects returns "No results found" (#49212), previously visited project directories never appear (#40200), the footer directory indicator stays stale after moving (#43938), and the palette description duplicates the command title (#35306).This PR:
moveSessionto allow moving sessions to arbitrary directories and across distinct projects, updatingSessionTable.project_id, persistingprojectIDonSessionEvent.Moved, and registering the destination inProjectTable.fs.ensureDir./move#40200): Queriessdk.client.project.list()andsdk.client.project.directories()to surface all registered project directories across the database under the "Other" section, allowing nested projects (e.g./work/repos/HomeLab) and sibling projects to appear and match fuzzy search.ctrl+m: Pressingctrl+m("new") opensDialogPromptallowing the user to enter any target path directly, while falling back to automatic git worktree creation if left blank.~expansion: Normalizes paths against true filesystem casing on disk viafs.realpathSync.nativeand expands~to the home directory.useDirectory()inpackages/tui/src/context/directory.tsto inspect the active session's directory. (Credit to @timrichardson for the earlier investigation in fix(tui): refresh directory after move [v2] #44829; this PR provides the active-session resolution for the currentdevarchitecture incontext/directory.ts).How did you verify your code works?
packages/schema/test/session-event.test.ts.packages/core/test/move-session.test.ts:moves session across distinct project repositories without transferring git changes.All 4 move-session tests pass (
bun test test/move-session.test.ts).packages/tui/test/component/dialog-move-session.test.ts(includingmergeProjectDirectories) andpackages/tui/test/context/directory.test.ts.bun turbo typecheckpasses cleanly across all 30 workspace packages.Checklist