block / block/buzz

Code blocks have no copy affordance — every agent-authored command needs a manual drag-select

Open
#5,434 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Summary

Fenced code blocks render, but there is no way to copy one directly. No copy button on the block, no "copy code" in the message action menu. The only route is highlight-then-copy, which works but is imprecise: it is easy to over-select into surrounding message text or miss the last line, and on wrapped lines the selection can carry soft line breaks into a command that then has to be cleaned up before it runs.

This is a minor papercut in a generic chat app. It is a more frequent one in Buzz specifically, because **agents hand humans shell commands as a routine interaction**, so the same imprecise selection gets repeated many times a day.

## Steps to reproduce

1. Have an agent post a message containing a fenced code block — in practice this happens constantly, e.g. an agent proposing a fix:

~~~
bash ~/.buzz/.scratch/clean-buzz-agents.sh
~~~

2. Try to get that command onto the clipboard.

**Actual:** no copy control on the block, and no "copy code" entry in the message action bar. Highlight-and-copy is the only route.

**Expected:** a copy control on the block (hover-revealed, corner-positioned) that copies the fence contents exactly — no language tag, no surrounding message text, no leading prompt characters.

## Why this one matters more than usual here

Buzz's premise is agents as workspace members rather than bots. In practice a large share of agent output *is* a command or snippet the human is meant to run, so this selection dance repeats constantly — and a mis-selected shell command is worse than a mis-selected sentence, because it either fails confusingly or does something slightly different from what was intended. Slack, Discord, GitHub and ChatGPT all ship a copy button on code blocks; its absence is more noticeable in a product where the code is usually addressed *to you, to run now*.

It also interacts with an existing quirk: agents sometimes emit literal `\n` (#4891), so a hand-selected copy is not always faithful to what the agent meant to send.

## Suggested scope

Smallest useful version:

- Copy control on fenced code blocks in the desktop message list, revealed on hover, consistent with the existing `MessageActionBar` interaction pattern.
- Copies the fence contents verbatim; excludes the info string and any surrounding markdown.
- Brief "Copied" confirmation, matching whatever the existing clipboard call sites already do.

Deliberately out of scope for a first pass: inline code (`` `like this` ``), mobile (mobile code rendering already diverges — see #5257), and any execute affordance.

## A wider version, if it's interesting

The narrow fix above is a chat-app table stake. The more Buzz-shaped question is whether an **agent-authored command deserves a first-class treatment** rather than being plain markdown that happens to contain a command — copy, and possibly "run in terminal" behind a confirmation, given the agent proposing it is already an identified workspace member with an audit trail.

That is a design conversation rather than a bug, and I would not want it to block the copy button. Raising it because a platform built on agents-as-teammates is a place where it might actually make sense.

## Environment

- Buzz Desktop 0.5.8, macOS 26 (arm64)
- Self-hosted relay
- Verified against current `main` by code search: no copy-on-code-block affordance present

Contributor guide

Open the contributing guide

Research direction

Start with the desktop message list and the existing MessageActionBar interaction pattern, then inspect current clipboard call sites. Add a hover-revealed control for fenced code blocks that copies only the fence contents and shows the existing brief confirmation; keep inline code, mobile, and execute actions out of scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.