Skip to content

feat(worktree): rename worktrees with optional upstream update#161

Merged
Dimillian merged 7 commits intoDimillian:mainfrom
moehaje:moehaje/worktree-naming
Jan 20, 2026
Merged

feat(worktree): rename worktrees with optional upstream update#161
Dimillian merged 7 commits intoDimillian:mainfrom
moehaje:moehaje/worktree-naming

Conversation

@moehaje
Copy link
Contributor

@moehaje moehaje commented Jan 20, 2026

Summary

  • add worktree rename UX in the popover with inline input, confirm button, and optional upstream‑rename prompt
  • make rename operations safer (unique path handling, rollback on worktree move failure, upstream push uses new local ref)
  • refresh thread state after rename to avoid stale/duplicate thread items
  • add hook tests for rename flows
Screenshot 2026-01-20 at 19 55 18

Testing

  • npm run lint
  • npm run test
  • npm run typecheck

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.
@Dimillian
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Comment on lines +787 to +791
onRenameSuccess: (workspaceId) => {
resetWorkspaceThreads(workspaceId);
const workspace = workspaces.find((entry) => entry.id === workspaceId);
if (workspace) {
void listThreadsForWorkspace(workspace);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@moehaje
Copy link
Contributor Author

moehaje commented Jan 20, 2026

@Dimillian
i'm off now. Could you maybe tweak this?

@Dimillian
Copy link
Owner

@Dimillian i'm off now. Could you maybe tweak this?

yes no problem

@Dimillian Dimillian merged commit 36d516d into Dimillian:main Jan 20, 2026
5 checks passed
@moehaje
Copy link
Contributor Author

moehaje commented Jan 20, 2026

nice!

gersmann pushed a commit to gersmann/codex-monitor-web that referenced this pull request Mar 10, 2026
…lian#161)

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
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.

2 participants