Skip to content

feat(issues): copy a branch name from the issue menu - #170

Merged
imshashank merged 4 commits into
mainfrom
feat/copy-branch-name
Aug 8, 2026
Merged

imshashank merged 4 commits into
mainfrom
feat/copy-branch-name

Conversation

@imshashank

@imshashank imshashank commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds a Copy branch name item to the issue actions menu, on list rows and on board cards.

Why

branchName() in packages/shared/src/utils already builds the branch a developer would check out (shashank/eng-42-fan-out-delta-packets), but the only caller was the MCP copy_branch_name tool. 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.tsx previously returned null for any role without issue: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 to orbit, 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 verify green: 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.

  • Generates branch names from the current workspace member and issue metadata.
  • Disables copying until workspace bootstrap completes.
  • Adds clipboard success, failure, loading-state, formatting, and permission-focused tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/web/src/features/issues/copy-branch-name.tsx Adds the clipboard menu item and prevents interaction until workspace data is ready, resolving the previously reported fallback-prefix issue.
apps/web/src/features/issues/issue-actions.tsx Makes the actions menu available to all roles while continuing to gate deletion by permission.
apps/web/tests/features/issues/copy-branch-name.test.tsx Covers branch formatting, clipboard outcomes, and the loading-state interaction guard.
apps/web/tests/features/issues/issue-deletion.test.tsx Updates permission tests to verify that copying remains available while deletion stays hidden.

Reviews (3): Last reviewed commit: "test(issues): cover what the copy branch..." | Re-trigger Greptile

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]>
@imshashank
imshashank requested a review from pulkitxm as a code owner August 8, 2026 07:24
@vercel

vercel Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
orbit Ready Ready Preview Aug 8, 2026 7:51am

Request Review

@github-actions github-actions Bot added tests Test coverage and test infrastructure area: web The Next.js app and its UI area: issues Issues, lists and boards labels Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Issue branch copying

Layer / File(s) Summary
Branch naming and clipboard behavior
apps/web/src/features/issues/copy-branch-name.tsx, apps/web/tests/features/issues/copy-branch-name.test.ts
Adds branch-name generation, workspace readiness handling, clipboard copying, toast feedback, and tests for naming and fallback behavior.
Issue menu integration
apps/web/src/features/issues/issue-actions.tsx, apps/web/tests/features/issues/issue-deletion.test.tsx
Adds the copy action to issue menus and renders deletion only when permitted. Tests cover issue rows and board cards.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Noveum/orbit#11: Introduced the issue actions and menu UI extended by this change.
  • Noveum/orbit#139: Modified the same IssueActionsMenu used for the copy-branch action.

Suggested reviewers: pulkitxm

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a branch-name copy action to issue menus.
Description check ✅ Passed The description explains the new copy action, permission behavior, workspace readiness, and related tests.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/copy-branch-name

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

imshashank and others added 2 commits August 8, 2026 13:09
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]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between c5bbc90 and 07fe7a4.

📒 Files selected for processing (4)
  • apps/web/src/features/issues/copy-branch-name.tsx
  • apps/web/src/features/issues/issue-actions.tsx
  • apps/web/tests/features/issues/copy-branch-name.test.ts
  • apps/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]>
@imshashank
imshashank merged commit 76302f7 into main Aug 8, 2026
11 checks passed
@imshashank
imshashank deleted the feat/copy-branch-name branch August 8, 2026 07:57

This branch was successfully deployed

1 active deployment
Preview — d671fbf9 Deployed Aug 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: issues Issues, lists and boards area: web The Next.js app and its UI tests Test coverage and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant