Repository navigation
feat(issues): copy a branch name from the issue menu - #170
Conversation
branchName() already produced the checkout name a developer wants, but only the MCP copy_branch_name tool ever called it, so nobody working in the UI could reach it. Add a Copy branch name item to the issue actions menu on rows and board cards. The menu now renders for everyone rather than only for roles that may delete, since copying a branch name is not a privileged action. The delete item stays gated on the same policy check as before. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds a client-side issue action that derives and copies branch names. The issue menu remains available when deletion is disallowed, while the delete action is hidden. Tests cover naming, workspace readiness, list rows, and board cards. ChangesIssue branch copying
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reading the handle out of an empty member map gave the orbit fallback, so anyone opening the menu during bootstrap copied orbit/eng-42 rather than their own prefix and had no way to tell it was wrong. Move the decision into branchCopy, which reports whether the workspace has loaded alongside the name, and disable the item until it has. A loaded member with no handle set still gets the fallback, which is the case the fallback is for. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/tests/features/issues/copy-branch-name.test.ts`:
- Around line 43-71: Add component tests for CopyBranchNameMenuItem that render
the menu item, mock navigator.clipboard.writeText, and exercise both resolved
and rejected clipboard writes. Assert the corresponding success and failure
toast feedback, while keeping the existing branchCopy state tests unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7af4a594-64b1-4200-8b83-b71303653962
📒 Files selected for processing (4)
apps/web/src/features/issues/copy-branch-name.tsxapps/web/src/features/issues/issue-actions.tsxapps/web/tests/features/issues/copy-branch-name.test.tsapps/web/tests/features/issues/issue-deletion.test.tsx
The pure helpers were covered but the item itself was not, so neither the toast on a successful copy nor the one on a clipboard the browser refuses had a test behind it. Render the item and assert all three outcomes, including that a workspace still loading copies nothing at all. The file moves to .tsx to mirror the component it tests. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
What
Adds a Copy branch name item to the issue actions menu, on list rows and on board cards.
Why
branchName()inpackages/shared/src/utilsalready builds the branch a developer would check out (shashank/eng-42-fan-out-delta-packets), but the only caller was the MCPcopy_branch_nametool. Nobody working in the UI could get at it, which is one of the things people expect from a task manager wired to git.The menu visibility change
issue-actions.tsxpreviously returnednullfor any role withoutissue:delete, because Delete was the only item in the menu. Copying a branch name is not privileged, so the menu now always renders and the Delete item alone stays behind the policy check.The two tests that asserted the menu was absent for such a role now assert the thing that actually matters: the menu opens, Copy branch name is there, and
delete-issue-*is not. Bulk delete and the delete shortcut are still asserted absent, unchanged.Tests
tests/features/issues/copy-branch-name.test.ts, 5 new cases: handle fallback toorbit, identifier lowercasing, a title that slugifies to nothing, and long title trimming.tests/features/issues/issue-deletion.test.tsx, two cases retargeted as described above.Verified in a browser with Playwright, clipboard permissions granted: the item copies
pulkit/eng-16-reconnect-should-replay-missed-deltas-by-sync-id.bun run verifygreen: 1461 pass, 0 fail in@orbit/web.🤖 Generated with Claude Code
Greptile Summary
The PR adds a branch-name clipboard action to issue list and board menus while retaining permission checks specifically for deletion.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (3): Last reviewed commit: "test(issues): cover what the copy branch..." | Re-trigger Greptile