shell: copy button in the corner of every markdown code block - #272
shell: copy button in the corner of every markdown code block#272miljanm wants to merge 3 commits into
Conversation
Each fenced code block in chat carries a small copy button pinned to its lower-right corner. It copies the raw block text through the shared copyPlainText helper (clipboard API with textarea fallback) and acknowledges with a brief check icon. The button anchors to a wrapper around the <pre> — not inside it — so it stays pinned while long lines scroll horizontally underneath. Co-authored-by: Möbius Agent <mobius-agent@users.noreply.github.com>
Co-authored-by: Möbius Agent <mobius-agent@users.noreply.github.com>
hamzamerzic
left a comment
There was a problem hiding this comment.
Reviewed the complete diff and added one maintainer follow-up so the always-visible copy control reserves its own row instead of covering the final line. The focused copy contract passes; hosted checks are now running on the updated branch.
|
Thanks for the review and the follow-up commit — reserving the bottom row for the copy control is cleaner than letting it sit over the last line. Pulled it into the local branch and the copy-button unit tests pass with the new padding assertion. |
|
Looked into the e2e failure on c0ed978 — it appears unrelated to this diff:
I can't retrigger checks from this side — a re-run of the e2e job should confirm. Happy to dig deeper if it fails again. |
|
Reviewed and merged to main through #304, preserving your authorship. The integrated version keeps the accessible code-copy action and adds the small line-clearance correction found during review. Thanks, Miljan. |
Every fenced code block rendered in chat now carries a small copy button pinned to its lower-right corner.
copyPlainTexthelper, so clipboard behavior (API + textarea fallback) matches the existing tool-output copy action.<pre>rather than inside it — an absolutely positioned child of the scrolling<pre>would ride along with long lines, so this keeps it pinned to the corner while code scrolls underneath.Tested with three source-wiring unit tests (frontend
node --test), plus manual verification in the running shell: buttons render on every block, a real click copies and shows the check, and a denied clipboard write shows no false acknowledgement.