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.
Alessandro committed
Jul 1, 2026 at 16:27 UTC
09fb555ec715c2850931ce119e4b84da7964a3c3
3 files changed
+19
tests/test_message_action_buttons_static.py
new
+17
@@ -0,0 +1,17 @@
1
+from pathlib import Path
2
+
3
+
4
+PROJECT_ROOT = Path(__file__).resolve().parents[1]
5
+
6
+
7
+def test_message_action_buttons_are_not_text_selectable() -> None:
8
+ css = PROJECT_ROOT.joinpath(
9
+ "webui",
10
+ "components",
11
+ "messages",
12
+ "action-buttons",
13
+ "simple-action-buttons.css",
14
+ ).read_text(encoding="utf-8")
15
+
16
+ block = css[css.index(".step-action-buttons {"):css.index("}", css.index(".step-action-buttons {"))]
17
+ assert "user-select: none;" in block
webui/components/messages/AGENTS.md
+1
@@ -15,6 +15,7 @@
15
- Keep message DOM helpers compatible with extension points that modify rendered messages.
16
- Sanitize or safely render model/user-provided content through shared rendering paths.
17
- Avoid layout shifts that break long-running message streaming.
18
+- Keep message action chrome out of text selection so copy/paste captures message content without button labels or icons.
19
20
## Work Guidance
21
webui/components/messages/action-buttons/simple-action-buttons.css
+1
@@ -12,6 +12,7 @@
12
opacity: 0;
13
transition: opacity 0.2s ease-in-out;
14
pointer-events: none;
15
+ user-select: none;
16
}
17
18
.step-action-buttons .expand-btn {