anomalyco / anomalyco/opencode
[FEATURE] One-click copy for inline code in chat (desktop/web), configurable
@Hona is already working on this.
Since Aug 21, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
Add a one-click copy affordance for inline code spans (`code` fragments inside messages) in the desktop and web UIs — not just fenced code blocks.
Motivation
Inline code shows up constantly in conversations: command names, flags, file paths, identifiers, short snippets. Copying one today requires precise text selection with the mouse, which is slow and error-prone (it's easy to grab surrounding whitespace or punctuation).
Other AI platforms already ship this exact UX — for example, z.ai copies an inline code span on click and gives brief visual feedback. It's a small interaction that removes a lot of day-to-day friction.
Proposed behavior
- Hovering an inline code span shows a pointer cursor plus a subtle affordance (e.g., dashed outline).
- Clicking it copies its text content to the clipboard and shows brief visual feedback (outline flash or toast).
- Guardrails so normal interactions keep working:
- Don't hijack the click when the user has an active text selection.
- Don't apply inside fenced code blocks (
pre code), links (a code), or diff/hunk views, where click/selection semantics already mean something else.
Configurable
Expose a setting so users can tune or disable it, e.g.:
{
"ui": {
"inline_code_click_to_copy": true,
"inline_code_copy_feedback": "flash"
}
}
("flash" | "toast" | "none")
Related issues
- #29913 — Allow copying code or file changes from the desktop app conversation history
- #30467 — Copy directly from diff text windows in opencode desktop
- #7696 — Message actions on AI messages (copy button etc.)
- #5641 — Add copy to clipboard functionality for outputted snippets of code
Those cover code blocks, diffs, and message-level actions; this request is specifically about inline spans within prose.
Environment
- OpenCode Desktop (Electron) on Windows 11
- Same behavior would apply to the web UI
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.