From 28488d4aed30858d97201b8eb429828cfc8161f7 Mon Sep 17 00:00:00 2001 From: yibaiba <946100224@qq.com> Date: Fri, 14 Aug 2026 09:55:04 +0800 Subject: [PATCH] fix(web): refine global loading state --- web/src/components/LoadingScreen.vue | 104 +++++++++++++++----------- web/tests/loadingScreenSource.test.ts | 19 +++++ 2 files changed, 81 insertions(+), 42 deletions(-) create mode 100644 web/tests/loadingScreenSource.test.ts diff --git a/web/src/components/LoadingScreen.vue b/web/src/components/LoadingScreen.vue index af5dabb3..ef4c12df 100644 --- a/web/src/components/LoadingScreen.vue +++ b/web/src/components/LoadingScreen.vue @@ -6,75 +6,95 @@ defineProps({ diff --git a/web/tests/loadingScreenSource.test.ts b/web/tests/loadingScreenSource.test.ts new file mode 100644 index 00000000..7a2e7abe --- /dev/null +++ b/web/tests/loadingScreenSource.test.ts @@ -0,0 +1,19 @@ +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import test from 'node:test' + +const source = readFileSync(new URL('../src/components/LoadingScreen.vue', import.meta.url), 'utf8') + +test('loading state uses a lightweight workspace surface instead of a notification card', () => { + assert.match(source, /class="loading-screen" role="status" aria-live="polite"/) + assert.match(source, /class="loading-state"/) + assert.match(source, /VOHIVE CONTROL PLANE/) + assert.doesNotMatch(source, /loading-panel|loading-mark|loading-spinner/) +}) + +test('loading state motion is brief, transform-opacity only, and reduced-motion safe', () => { + assert.match(source, /animation: loading-state-enter 220ms var\(--ui-ease-out\) both/) + assert.match(source, /@keyframes loading-state-enter\s*\{[^}]*opacity: 0; transform: translateY\(6px\)/s) + assert.doesNotMatch(source, /animation:[^;]*infinite/) + assert.match(source, /@media \(prefers-reduced-motion: reduce\)[\s\S]*animation-name: loading-state-fade/) +})