Skip to content

feat(sidebar): add task rename via context menu#631

Merged
arnestrickmann merged 10 commits intogeneralaction:mainfrom
saadnvd1:feat/task-rename
Jan 16, 2026
Merged

feat(sidebar): add task rename via context menu#631
arnestrickmann merged 10 commits intogeneralaction:mainfrom
saadnvd1:feat/task-rename

Conversation

@saadnvd1
Copy link
Contributor

@saadnvd1 saadnvd1 commented Jan 15, 2026

  • Add right-click context menu on tasks with "Rename" option
  • Inline editing with Enter to confirm, Escape to cancel
  • Auto-select text when rename starts for quick typing
  • Optimistic UI updates with rollback on error
  • New context-menu UI component using @radix-ui/react-context-menu

Loom: https://www.loom.com/share/16490420be944260bf9b98cb460c98fb

Addresses this issue: #548


Note

Introduces task renaming from the sidebar with inline editing and ties it to git branch renames, including remote updates when applicable.

  • Adds ContextMenu UI and integrates a "Rename" action on task items with inline input (Enter confirms, Escape cancels), name normalization, and text auto-select
  • Wires rename through LeftSidebarApp (onRenameTask) with optimistic UI update, rollback on error, and toast feedback; disables for multi-agent tasks
  • Computes new branch slug while preserving prefix/...-hash; invokes new IPC git:rename-branch to rename local branch, delete old remote ref, and push new branch (sets upstream); exposed via preload and typed in electron-api.d.ts
  • Adds @radix-ui/react-context-menu dependency and a lightweight ui/context-menu wrapper component

Written by Cursor Bugbot for commit b3c0ddd. This will update automatically on new commits. Configure here.

- Add right-click context menu on tasks with "Rename" option
- Inline editing with Enter to confirm, Escape to cancel
- Auto-select text when rename starts for quick typing
- Optimistic UI updates with rollback on error
- New context-menu UI component using @radix-ui/react-context-menu
@vercel
Copy link

vercel bot commented Jan 15, 2026

@saadnvd1 is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@arnestrickmann
Copy link
Contributor

Thank you!
Is it also renaming the underlying branch or just the name that is displayed in the left sidebar?

@saadnvd1
Copy link
Contributor Author

Thank you! Is it also renaming the underlying branch or just the name that is displayed in the left sidebar?

ah yes, thanks for pointing out. will update

saadnvd1 and others added 3 commits January 15, 2026 12:48
- Add git:rename-branch IPC handler for local + remote branch renaming
- Detect if branch was pushed and update remote accordingly
- Update task's branch field in database after rename
- Show toast notification when remote branch is updated
@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 16, 2026 1:49am

Review with Vercel Agent

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

- Query git remote config before branch rename (config section gets renamed)
- Disable rename for multi-agent tasks (variant metadata would become stale)
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

- Use execFileAsync to prevent shell command injection
- Rollback git branch rename if save task fails
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@rabanspiegel
Copy link
Contributor

Ready to merge / review @arnestrickmann. Thank you for the PR @saadnvd1. Simplified the UI a bit by deleting the 'x' and 'check' symbol to leave more space for renamed task. And fixed bugs.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issues.

log.info('Pushed new branch to remote');
}

return { success: true, remotePushed };
Copy link

Choose a reason for hiding this comment

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

Partial rename failure leaves git state inconsistent with app

Medium Severity

When git:rename-branch renames the local branch successfully (line 804) but the subsequent remote push fails (line 822), the handler returns success: false. However, the local branch is already renamed. In App.tsx, when success is false, branchRenamed never gets set to true (line 1881), so no rollback is attempted (line 1906). The UI reverts to showing the old branch name, but the local git branch actually has the new name. This mismatch causes the task to reference a non-existent branch.

Additional Locations (1)

Fix in Cursor Fix in Web

}
setIsEditing(false);
await onRename?.(normalized);
}, [editValue, task.name, onRename, handleCancelEdit]);
Copy link

Choose a reason for hiding this comment

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

Rename allows duplicate task names within a project

Medium Severity

Task creation enforces unique names within a project via TaskModal validation (checking against existingNames), but the rename operation in handleConfirmEdit and handleRenameTask has no such check. A user can rename "task-a" to "task-b" even if "task-b" already exists, creating duplicate display names. This violates the uniqueness invariant established during creation and could cause confusion when selecting or managing tasks.

Additional Locations (1)

Fix in Cursor Fix in Web

@arnestrickmann
Copy link
Contributor

nice, good stuff

@arnestrickmann arnestrickmann merged commit 56b503c into generalaction:main Jan 16, 2026
4 checks passed
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.

3 participants