feat(worktree): rename worktrees with optional upstream update#161
feat(worktree): rename worktrees with optional upstream update#161Dimillian merged 7 commits intoDimillian:mainfrom
Conversation
Add backend commands and safeguards for worktree rename flow.
Wire rename UI and refresh thread state after rename.
Add hook tests for rename prompt and optimistic updates.
Avoid definite assignment errors in mock promises.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2dfbae7c89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/App.tsx
Outdated
| onRenameSuccess: (workspaceId) => { | ||
| resetWorkspaceThreads(workspaceId); | ||
| const workspace = workspaces.find((entry) => entry.id === workspaceId); | ||
| if (workspace) { | ||
| void listThreadsForWorkspace(workspace); |
There was a problem hiding this comment.
Refresh threads using updated workspace path after rename
The rename success handler looks up the workspace from the workspaces array captured in the render that started the rename, then calls listThreadsForWorkspace(workspace). Because renameWorktree updates the workspace path asynchronously, this callback can still see the pre-rename workspace.path, and listThreadsForWorkspace filters threads by workspace.path (see useThreads.ts listThreadsForWorkspace), so it can clear the list or miss threads after the worktree is moved. This shows up when the rename actually moves the worktree directory (e.g., suffixing the name), leaving the thread list empty until a manual reload.
Useful? React with 👍 / 👎.
|
@Dimillian |
yes no problem |
|
nice! |
…lian#161) Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
Summary
Testing
npm run lintnpm run testnpm run typecheck