feat(web-console): unify spatial UI and chat reset
This commit is contained in:
@@ -12,7 +12,7 @@ def source(name: str) -> str:
|
||||
def test_spatial_ui_contract_is_loaded_last_and_cached() -> None:
|
||||
html = source("index.html")
|
||||
service_worker = source("service-worker.js")
|
||||
asset = "/ui-consistency.css?v=spatial-ui-4"
|
||||
asset = "/ui-consistency.css?v=spatial-ui-5"
|
||||
|
||||
assert asset in html
|
||||
assert f'"{asset}"' in service_worker
|
||||
@@ -25,6 +25,10 @@ def test_same_kind_surfaces_share_geometry_tokens() -> None:
|
||||
for token in (
|
||||
"--ui-control-height-compact:",
|
||||
"--ui-control-height:",
|
||||
"--ui-font-card-title:",
|
||||
"--ui-font-section-title:",
|
||||
"--ui-font-panel-title:",
|
||||
"--ui-inline-action-width:",
|
||||
"--ui-radius-control:",
|
||||
"--ui-radius-item:",
|
||||
"--ui-radius-section:",
|
||||
@@ -59,6 +63,7 @@ def test_same_kind_controls_share_sizes_and_focus_treatment() -> None:
|
||||
"#v2PanelControlDock > .v2-panel-control-button",
|
||||
".v2-mode-rail .mode-rail-actions > button",
|
||||
".v2-device-adjust-toggle",
|
||||
".v2-pet-settings-launch",
|
||||
".v2-extension-nfc-launch",
|
||||
".energy-trend-tabs button",
|
||||
".mode-gallery-close",
|
||||
@@ -71,6 +76,44 @@ def test_same_kind_controls_share_sizes_and_focus_treatment() -> None:
|
||||
assert "outline: none" in styles
|
||||
|
||||
|
||||
def test_panel_titles_and_extension_actions_share_type_and_size_tokens() -> None:
|
||||
styles = source("ui-consistency.css")
|
||||
|
||||
for selector in (
|
||||
".v2-operation-heading h2",
|
||||
".joint-twin-shell .twin-heading h3",
|
||||
".v2-device-sync-board > header h3",
|
||||
".v2-extension-sync-heading h3",
|
||||
".v2-device-card-focus strong",
|
||||
".v2-nfc-inline strong",
|
||||
".v2-extension-gateway strong",
|
||||
):
|
||||
assert selector in styles
|
||||
|
||||
assert "font-size: var(--ui-font-panel-title) !important" in styles
|
||||
assert "font-size: var(--ui-font-card-title) !important" in styles
|
||||
assert "grid-template-columns: repeat(2, minmax(0, 1fr))" in styles
|
||||
assert "width: var(--ui-inline-action-width)" in styles
|
||||
|
||||
|
||||
def test_pet_and_tcp_dialog_controls_keep_accessible_aligned_layout() -> None:
|
||||
styles = source("self-extension.css")
|
||||
extension = source("self-extension.js")
|
||||
tcp_form = styles.split(".v2-gscu-config-form {", 1)[1].split("}", 1)[0]
|
||||
tcp_submit = styles.split(
|
||||
".v2-gscu-config-form > .v2-extension-primary {", 1
|
||||
)[1].split("}", 1)[0]
|
||||
|
||||
assert ".v2-extension-dialog .v2-pet-card-region > header > button" in styles
|
||||
assert "min-width: 104px" in styles
|
||||
assert "align-items: end" in tcp_form
|
||||
assert "height: 40px" in tcp_submit
|
||||
assert "margin: 0" in tcp_submit
|
||||
assert 'id="extensionGscuTcpHostHint"' in extension
|
||||
assert 'id="extensionGscuTcpPortHint"' in extension
|
||||
assert 'class="visually-hidden" id="extensionPetSettingsDescription"' in extension
|
||||
|
||||
|
||||
def test_compact_sidebar_overrides_cannot_break_shared_geometry() -> None:
|
||||
styles = source("ui-consistency.css")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user