Skip to content

feat(app): copy session ID from tab and session menus - #50805

Closed
iysun wants to merge 2 commits into
anomalyco:devfrom
iysun:feat/copy-session-id
Closed

iysun wants to merge 2 commits into
anomalyco:devfrom
iysun:feat/copy-session-id

Conversation

@iysun

@iysun iysun commented Sep 23, 2026 •

Copy link
Copy Markdown

Issue for this PR

Refs #47746 (the TUI counterpart of this request).

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The palette command session.copyID was the only way to copy a session ID. This adds the same action to the tab context menu and to the session list row menu — the two places where the ID is on screen and people actually reach for it.

packages/app/src/shell/clipboard.ts is new: it holds the clipboard write plus the toast, and all three call sites go through it so the success and failure feedback cannot drift apart. use-session-commands.tsx drops its inline copy of that logic, and the tab and session menus gain one Menu.Item each.

Kept to packages/app — no new dependencies, and nothing in the server, schema or core packages changes.

How did you verify your code works?

Ran both new menu items in the desktop app on Windows: the ID lands on the clipboard and the toast shows it. I also checked the failure path by forcing the clipboard write to reject, which surfaces the error toast rather than failing silently.

bun run typecheck, bun run lint and bun run test:unit for packages/app all pass (916 pass, 0 fail).

I did not add translations. Every key this uses already exists in packages/app/src/runtime/i18n/en.ts from the palette command, so there is nothing new to translate, and the other 62 locales fall back to English for them — which is how they already behave today.

Screenshots / recordings

Can attach a recording of both menus if that would help the review.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

The command palette was the only way to copy a session ID. Add the same
action to the tab context menu and the session list row menu, and share
the clipboard write plus toast feedback through a single helper so the
three call sites cannot drift. The palette command now uses it too.

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:15
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant