Pull requests / #1481
#1481 web: add Copy below code blocks (#1257)
open · @BGonnermann · 0 comments · View on GitHub
Description
Fixes #1257. Copying a long code block currently requires scrolling back to its header. Add a matching Copy button below the code so the action is available at either end. Both buttons use the existing handler to copy that block's exact text, with the existing checkmark feedback and clipboard fallback. The footer uses the existing code-block and icon-button styling. Complete, empty, and unfinished fenced blocks all have both controls. Code and language text remain escaped. Validation on Windows 11, Python 3.14.7, and Node 24.19.0: - `python -m unittest serve.test_web_code_copy -v`: three tests pass. The missing-footer assertions fail on the original renderer. - `python -m unittest discover -s serve -p 'test_*.py' -v`: 566 tests, OK, six skipped in the normal Windows user environment. - Actual Chat UI through the HTTP/SSE mock engine, Playwright 1.63.0 and Chromium 149.0.7827.55, at desktop 1280x850 and mobile 390x850: exact copy payloads for long and independent blocks, both controls during a paused stream, an unfinished fence after completion, success feedback, and the fallback path. Clipboard writes were intercepted to preserve the host clipboard. - `node --check serve/web/app.js` and `git diff --check` pass. Independent source/test review found no issues.
Related on strata.com
Editorial links to help you install, pick models, or read release notes — not part of the upstream thread.