Prevent selecting message action buttons

Mark message action button chrome as non-selectable so copy/paste captures message text without toolbar icon labels.

Add a static regression for the shared action-buttons stylesheet.
This commit is contained in:
Alessandro 2026-07-01 16:27:08 +02:00
parent 8ecd7a7f52
commit 09fb555ec7
3 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,17 @@
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parents[1]
def test_message_action_buttons_are_not_text_selectable() -> None:
css = PROJECT_ROOT.joinpath(
"webui",
"components",
"messages",
"action-buttons",
"simple-action-buttons.css",
).read_text(encoding="utf-8")
block = css[css.index(".step-action-buttons {"):css.index("}", css.index(".step-action-buttons {"))]
assert "user-select: none;" in block

View file

@ -15,6 +15,7 @@
- Keep message DOM helpers compatible with extension points that modify rendered messages.
- Sanitize or safely render model/user-provided content through shared rendering paths.
- Avoid layout shifts that break long-running message streaming.
- Keep message action chrome out of text selection so copy/paste captures message content without button labels or icons.
## Work Guidance

View file

@ -12,6 +12,7 @@
opacity: 0;
transition: opacity 0.2s ease-in-out;
pointer-events: none;
user-select: none;
}
.step-action-buttons .expand-btn {