diff --git a/solstone/apps/settings/tests/test_workspace_html.py b/solstone/apps/settings/tests/test_workspace_html.py index 9b0ca5c4a..2789cb7f8 100644 --- a/solstone/apps/settings/tests/test_workspace_html.py +++ b/solstone/apps/settings/tests/test_workspace_html.py @@ -4,6 +4,7 @@ from __future__ import annotations import re +from html.parser import HTMLParser from pathlib import Path WORKSPACE = Path(__file__).resolve().parents[1] / "workspace.html" @@ -24,6 +25,38 @@ def _section_block(text: str, section_id: str) -> str: return match.group(0) +class _SettingsFormButtonParser(HTMLParser): + def __init__(self) -> None: + super().__init__(convert_charrefs=True) + self._settings_form_depth = 0 + self.non_button_buttons: list[str] = [] + + def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: + attr_map = dict(attrs) + classes = set((attr_map.get("class") or "").split()) + starts_settings_form = tag == "form" and "settings-form" in classes + in_settings_form = self._settings_form_depth > 0 or starts_settings_form + + if starts_settings_form: + self._settings_form_depth += 1 + + if tag == "button" and in_settings_form and attr_map.get("type") != "button": + self.non_button_buttons.append( + attr_map.get("id") + or attr_map.get("class") + or self.get_starttag_text() + or " +
@@ -2518,7 +2518,7 @@ button:focus:not(:focus-visible) {
- +
@@ -2877,7 +2877,7 @@ button:focus:not(:focus-visible) {
- + reset the name back to "sol"
@@ -5805,6 +5805,13 @@ document.getElementById('saveCustomActivityBtn').addEventListener('click', async // Agent name reset const agentNameInput = document.getElementById('field-agent-name'); if (agentNameInput) { + agentNameInput.addEventListener('keydown', (e) => { + if (e.key === 'Enter') { + e.preventDefault(); + agentNameInput.blur(); + } + }); + agentNameInput.addEventListener('change', async (e) => { const newName = e.target.value.trim() || 'sol'; const today = new Date().toISOString().slice(0, 10);