feat(web-console): add personalized seat weighing evolution

This commit is contained in:
vee
2026-08-14 15:53:08 +08:00
parent f77dda70fe
commit 344f662970
7 changed files with 1970 additions and 766 deletions
+44 -13
View File
@@ -184,13 +184,21 @@ operations:
) as response:
gesture_script = response.read().decode("utf-8")
with self.opener.open(
f"{self.base_url}/console-v2.js?v=desktop-refactor-35", timeout=3
f"{self.base_url}/console-v2.js?v=desktop-refactor-36", timeout=3
) as response:
console_script = response.read().decode("utf-8")
with self.opener.open(
f"{self.base_url}/console-v2.css?v=desktop-refactor-106", timeout=3
f"{self.base_url}/console-v2.css?v=desktop-refactor-107", timeout=3
) as response:
console_styles = response.read().decode("utf-8")
with self.opener.open(
f"{self.base_url}/self-evolution.js?v=seat-weighing-2", timeout=3
) as response:
evolution_script = response.read().decode("utf-8")
with self.opener.open(
f"{self.base_url}/self-evolution.css?v=seat-weighing-5", timeout=3
) as response:
evolution_styles = response.read().decode("utf-8")
with self.opener.open(
f"{self.base_url}/self-extension.js?v=extension-21", timeout=3
) as response:
@@ -227,8 +235,10 @@ operations:
self.assertIn('href="/styles.css?v=dual-seat-9"', html)
self.assertIn('src="/gesture-control.js?v=android-pad-7"', html)
self.assertNotIn('class="vehicle-system-hud"', html)
self.assertIn('src="/console-v2.js?v=desktop-refactor-35"', html)
self.assertIn('href="/console-v2.css?v=desktop-refactor-106"', html)
self.assertIn('src="/console-v2.js?v=desktop-refactor-36"', html)
self.assertIn('href="/console-v2.css?v=desktop-refactor-107"', html)
self.assertIn('src="/self-evolution.js?v=seat-weighing-2"', html)
self.assertIn('href="/self-evolution.css?v=seat-weighing-5"', html)
self.assertIn('src="/self-extension.js?v=extension-21"', html)
self.assertIn('href="/self-extension.css?v=extension-19"', html)
self.assertNotIn("滚动查看更多", html)
@@ -268,13 +278,26 @@ operations:
self.assertIn('label: "自修复"', console_script)
self.assertIn('id: "self-evolution", label: "自进化", available: true', console_script)
self.assertIn(
'evolution.setAttribute("aria-label", "自进化能力日志")',
'window.CognitiveAgentSelfEvolution?.mount(mainPanel)',
console_script,
)
self.assertIn('<span class="section-kicker">SELF-EVOLUTION</span>', console_script)
self.assertIn('v2-evolution-heading v2-module-heading', console_script)
self.assertIn('data-evolution-index', console_script)
self.assertIn('NEXT EVOLUTION · v0.6', console_script)
self.assertIn('caption.textContent = evolutionMode ? "进化视图" : "控制方式"', console_script)
self.assertIn('{ label: "座椅称重进化", icon: "scale"', console_script)
self.assertIn('{ label: "系统能力日志", icon: "scroll-text"', console_script)
self.assertIn('aria-label", "自进化 · 座椅称重个性化模型进化"', evolution_script)
self.assertIn('SELF-EVOLUTION · SEAT WEIGHING', evolution_script)
self.assertIn('座椅称重模型进化', evolution_script)
self.assertIn('系统能力日志', evolution_script)
self.assertIn('data-family-model="${model.id}"', evolution_script)
self.assertIn('用户 A', evolution_script)
self.assertIn('用户 B', evolution_script)
self.assertIn('用户 C', evolution_script)
self.assertIn('访客', evolution_script)
self.assertIn('退化保护已触发', evolution_script)
self.assertIn('本次未参与发布', evolution_script)
self.assertIn('演示进化过程', evolution_script)
self.assertIn('家庭体脂秤', evolution_script)
self.assertIn('目标误差', evolution_script)
self.assertIn('["self-orchestration", "self-extension", "self-evolution"]', console_script)
self.assertIn('roleSelect.disabled = ui.activeModule === "self-repair"', console_script)
self.assertNotIn('label: "自诊断"', console_script)
@@ -299,7 +322,7 @@ operations:
self.assertIn('.v2-control-switch {', console_styles)
self.assertIn('.v2-module-switcher {', console_styles)
self.assertIn('grid-template-columns: repeat(5, minmax(0, 1fr))', console_styles)
self.assertIn('[data-module="self-evolution"] .v2-self-evolution', console_styles)
self.assertIn('[data-module="self-evolution"] .v2-self-evolution', evolution_styles)
self.assertIn(
'.console-v2 .v2-module-heading.v2-module-heading h1',
console_styles,
@@ -319,8 +342,14 @@ operations:
'[data-module="self-repair"] .v2-self-repair',
console_styles,
)
self.assertIn('.v2-evolution-version.active', console_styles)
self.assertIn('[data-evolution-scope="admin"]', console_styles)
self.assertIn('.v2-evolution-version.active', evolution_styles)
self.assertIn('[data-evolution-scope="admin"]', evolution_styles)
self.assertIn('.v2-weighing-workspace', evolution_styles)
self.assertIn('.v2-family-model.active', evolution_styles)
self.assertIn('.v2-personal-line', evolution_styles)
self.assertIn('.v2-linkage-guard', evolution_styles)
self.assertIn('.v2-parameter-grid', evolution_styles)
self.assertIn('[data-demo-role="admin"] [data-evolution-scope="admin"]', evolution_styles)
self.assertIn(
'color-mix(in srgb, var(--v2-accent-soft) 86%, white)',
console_styles,
@@ -455,7 +484,9 @@ operations:
self.assertIn("window.requestAnimationFrame(initSeatTwin)", app_script)
self.assertIn('canvas.addEventListener("webglcontextlost"', app_script)
self.assertIn('"cognitive-agent:module-change"', app_script)
self.assertIn('const CACHE_VERSION = "cognitive-agent-pad-v119"', service_worker)
self.assertIn('const CACHE_VERSION = "cognitive-agent-pad-v120"', service_worker)
self.assertIn('"/self-evolution.js?v=seat-weighing-2"', service_worker)
self.assertIn('"/self-evolution.css?v=seat-weighing-5"', service_worker)
self.assertIn(
'"/assets/models/n7_seat.glb?v=e7f50f03"', service_worker
)