fix(web-console): align status cards and command history
This commit is contained in:
@@ -1363,7 +1363,7 @@ operations:
|
||||
self.assertIn('canvas.addEventListener("webglcontextlost"', app_script)
|
||||
self.assertIn('"cognitive-agent:module-change"', app_script)
|
||||
self.assertIn(
|
||||
'const CACHE_VERSION = "cognitive-agent-pad-v315-vue-vite"',
|
||||
'const CACHE_VERSION = "cognitive-agent-pad-v316-sidebar-accordion"',
|
||||
service_worker,
|
||||
)
|
||||
self.assertIn('/console-v2.css?v=delivery-state-69', service_worker)
|
||||
|
||||
@@ -27,7 +27,7 @@ def test_console_contains_ai_assistant_surface():
|
||||
def test_codex_assistant_assets_are_versioned_together_in_the_service_worker():
|
||||
service_worker = (ROOT / "apps/web-console/service-worker.js").read_text(encoding="utf-8")
|
||||
assert (
|
||||
'const CACHE_VERSION = "cognitive-agent-pad-v315-vue-vite"'
|
||||
'const CACHE_VERSION = "cognitive-agent-pad-v316-sidebar-accordion"'
|
||||
in service_worker
|
||||
)
|
||||
assert '"/assistant-chat.css?v=codex-assistant-29"' in service_worker
|
||||
@@ -120,6 +120,22 @@ def test_validated_controls_are_mirrored_into_a_compact_assistant_card():
|
||||
assert ".assistant-dispatched-controls[open]" in css
|
||||
|
||||
|
||||
def test_latest_dispatched_control_group_is_the_only_group_expanded():
|
||||
assistant = (ROOT / "apps/web-console/assistant-chat.js").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
vue_ui = (ROOT / "apps/web-console/vue-ui.js").read_text(encoding="utf-8")
|
||||
|
||||
assert "function focusLatestDispatchedControls(container)" in assistant
|
||||
assert 'transcript.querySelectorAll(".assistant-dispatched-controls")' in assistant
|
||||
assert "card.open = card === activeCard" in assistant
|
||||
assert "focusLatestDispatchedControls(host)" in assistant
|
||||
assert "focusLatestDispatchedControls(card)" in assistant
|
||||
assert 'querySelectorAll(".assistant-dispatched-controls[open]")' in assistant
|
||||
assert 'querySelectorAll(".assistant-dispatched-controls[open]")' in vue_ui
|
||||
assert "if (card !== event.currentTarget) card.open = false" in vue_ui
|
||||
|
||||
|
||||
def test_saved_mode_execution_opens_with_pending_flow_before_http_completion():
|
||||
app = (ROOT / "apps/web-console/app.js").read_text(encoding="utf-8")
|
||||
flow = app.split(
|
||||
|
||||
@@ -41,7 +41,7 @@ def test_energy_monitor_assets_are_versioned_and_cached() -> None:
|
||||
"/energy-monitor.js?v=energy-monitor-4"
|
||||
)
|
||||
assert (
|
||||
'const CACHE_VERSION = "cognitive-agent-pad-v315-vue-vite"'
|
||||
'const CACHE_VERSION = "cognitive-agent-pad-v316-sidebar-accordion"'
|
||||
in service_worker
|
||||
)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ def test_theme_asset_versions_are_consistent_with_the_pwa_shell() -> None:
|
||||
assert source_asset in main
|
||||
assert f'"{cached_asset}"' in service_worker
|
||||
assert 'import "./styles/design-system.css"' in main
|
||||
assert 'const CACHE_VERSION = "cognitive-agent-pad-v315-vue-vite"' in service_worker
|
||||
assert 'const CACHE_VERSION = "cognitive-agent-pad-v316-sidebar-accordion"' in service_worker
|
||||
|
||||
|
||||
def test_reference_glass_theme_covers_the_complete_workspace() -> None:
|
||||
@@ -247,6 +247,22 @@ def test_command_fields_use_distinct_semantic_colors() -> None:
|
||||
assert mapping in console
|
||||
|
||||
|
||||
def test_sidebar_command_and_transport_status_use_theme_semantics() -> None:
|
||||
console = source("console-v2.js")
|
||||
design_system = source("src/styles/design-system.css")
|
||||
|
||||
assert '"v2-sidebar-footer v2-control-link-card"' in console
|
||||
assert 'transport === "wireless_mqtt" ? "无线 CAN" : "有线 CAN"' in console
|
||||
assert 'MQTT ${transportOnline ? "已连接" : "未连接"}' in console
|
||||
assert 'footer.dataset.state = presentationState' in console
|
||||
assert 'attributeFilter: ["aria-pressed", "class", "data-connection-state", "title"]' in console
|
||||
assert ".v2-control-link-card" in design_system
|
||||
assert 'data-state="online"' in design_system
|
||||
assert 'data-state="offline"' in design_system
|
||||
assert ".v2-can-command-actual code" in design_system
|
||||
assert "color: var(--card-foreground) !important" in design_system
|
||||
|
||||
|
||||
def test_function_modes_use_an_inline_accessible_collapsible() -> None:
|
||||
html = source("index.html")
|
||||
app = source("app.js")
|
||||
|
||||
@@ -133,6 +133,22 @@ def test_compact_sidebar_overrides_cannot_break_shared_geometry() -> None:
|
||||
assert "white-space: nowrap" in design_system
|
||||
|
||||
|
||||
def test_runtime_log_starts_collapsed_with_an_accessible_disclosure() -> None:
|
||||
console = source("console-v2.js")
|
||||
design_system = source("src/styles/design-system.css")
|
||||
|
||||
assert 'class="v2-sync-log" aria-labelledby="v2SyncLogTitle" data-collapsed="true"' in console
|
||||
assert 'id="v2SyncLogList" aria-live="polite" hidden' in console
|
||||
assert 'id="v2SyncLogToggle"' in console
|
||||
assert 'aria-controls="v2SyncLogList"' in console
|
||||
assert 'aria-expanded="false"' in console
|
||||
assert "function setSyncLogCollapsed(collapsed)" in console
|
||||
assert "setSyncLogCollapsed(true)" in console
|
||||
assert '.v2-sync-log[data-collapsed="true"]' in design_system
|
||||
assert '.v2-sync-log[data-collapsed="true"] #v2LogFilter' in design_system
|
||||
assert '#v2SyncLogList[hidden]' in design_system
|
||||
|
||||
|
||||
def test_assistant_composer_hint_stays_inside_narrow_input() -> None:
|
||||
styles = source("ui-consistency.css")
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ def test_vue_vite_application_is_the_primary_frontend_entry() -> None:
|
||||
assert package["scripts"]["build"] == "vite build"
|
||||
assert 'import vue from "@vitejs/plugin-vue"' in vite
|
||||
assert 'outDir: outputRoot' in vite
|
||||
assert 'const CACHE_VERSION = "cognitive-agent-pad-v315-vue-vite"' in service_worker
|
||||
assert 'const CACHE_VERSION = "cognitive-agent-pad-v316-sidebar-accordion"' in service_worker
|
||||
assert "unpkg.com" not in html
|
||||
assert "cdn.jsdelivr.net" not in html
|
||||
|
||||
|
||||
Reference in New Issue
Block a user