mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-09 17:08:29 +00:00
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:
parent
8ecd7a7f52
commit
09fb555ec7
3 changed files with 19 additions and 0 deletions
17
tests/test_message_action_buttons_static.py
Normal file
17
tests/test_message_action_buttons_static.py
Normal 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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
opacity: 0;
|
||||
transition: opacity 0.2s ease-in-out;
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.step-action-buttons .expand-btn {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue