[PR #1481] [CLOSED] web: add Copy below code blocks (#1257) #3481

Closed
opened 2026-11-07 14:41:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1481
Author: @BGonnermann
Created: 10/8/2026
Status: ❌ Closed

Base: main ← Head: web/code-copy-footer-1257


📝 Commits (1)

📊 Changes

3 files changed (+93 additions, -2 deletions)

View changed files

➕ serve/test_web_code_copy.py (+89 -0)
📝 serve/web/app.js (+3 -2)
📝 serve/web/components.css (+1 -0)

📄 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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1481 **Author:** [@BGonnermann](https://github.com/BGonnermann) **Created:** 10/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `web/code-copy-footer-1257` --- ### 📝 Commits (1) - [`91056fd`](https://github.com/Niko1221/Strata/commit/91056fdc4a3ced71bf4b2bf52f8b3bd29b59b8e4) web: add Copy below code blocks (#1257) ### 📊 Changes **3 files changed** (+93 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `serve/test_web_code_copy.py` (+89 -0) 📝 `serve/web/app.js` (+3 -2) 📝 `serve/web/components.css` (+1 -0) </details> ### 📄 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:41:46 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3481
No description provided.