GeezerVison is showing github.com — feat(site): add a copy submenu to agent chat menus by jakehwll · Pull Request #30016 · coder/coder
Conversation
jakehwll
commented
Sep 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
🤖 This PR was modified by Coder Agents on behalf of Jake Howell.
Stacked on #30015.
A chat's ID and branch name were only reachable from the URL or the git panel, so copying either meant leaving the sidebar.
Chat menus (right-click, sidebar ⋮, and top bar) expose Copy ID directly when it is the only copy action. When a head branch is available, a Copy submenu groups Copy ID and Copy branch.
Copying is read-only, so copy actions also render where the menu used to be suppressed entirely: another user's shared chat and archived child chats.
Implementation notes
ContextMenu gained Sub, SubTrigger, and SubContent wrappers so the right-click menu keeps parity with DropdownMenu; ChatActionsMenuItems takes them as props alongside Item and Separator.
- Because every chat now has at least Copy ID, the menu can never be empty, so
chatHasMenuActions is gone and both call sites always render their trigger.
- The separator that used to sit above the archive actions now sits above the copy actions, which always render, so the archive block keeps its own unconditional separator.
- Copy items are built once; their count determines whether to render them directly or in a submenu, without duplicating action handlers.
- The branch comes from
chat.diff_status.head_branch, the same source the remote diff panel copies from.
- Radix submenu items do not respond to
userEvent clicks in jsdom, so the Vitest coverage opens the submenu with userEvent and selects the item with fireEvent. The missing-branch, shared-chat, and archived-child states are Storybook stories.
Latest validation after merging main: 133 sidebar/menu unit tests and 75 sidebar Storybook tests pass. pnpm format, pnpm check, and full pnpm lint (including types) pass. Browser-rendered Storybook screenshots were returned in chat.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The chat read cursor only moved when a chat's stream connected or
disconnected, so there was no way to clear an unread dot without
opening the chat, or to flag a chat to come back to.
UpdateChatRequest gains a Read field that advances the owner's read
cursor or clears it, and the sidebar's right-click and actions menus
expose it under Show subagents. The cursor is owner-scoped, so the
endpoint rejects non-owners even when they may otherwise update the
chat, and the menu item is hidden for the chat that is already open
because opening a chat marks it read.
- reject an unauthorized read change before any other PATCH field is
written, so a rejected multi-field update commits nothing
- drop the chat from read-status-filtered list caches instead of
leaving a row the filter excludes, and patch nested subagent rows
- snapshot and restore the list caches on mutation failure rather than
relying on a refetch that may also fail
- move the active-chat menu check from Vitest to a Storybook story
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-09-27T20:38:53.202374Z |
d9b98f4 |
Draft marked ready |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this 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: d9b98f4267
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Preserve main’s trailing chat content alongside the always-available copy submenu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the copy menu item has only a single option, why make it open a separate menu instead of changing the main menu option to copy ID or copy branch? Seems like the extra menu level is only needed if there are multiple menu options
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
jaaydenh
jaaydenh approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|