feat: implement approved restrained motion and state audit (HEL-813)

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-10-23 18:00:46 +08:00
co-authored by multica-agent
parent e2f139806f
commit fe4759b788
39 changed files with 736 additions and 132 deletions
@@ -6,10 +6,10 @@
import { page } from "$app/state";
import LanguageSwitcher from "$lib/components/LanguageSwitcher.svelte";
import Icon from "$lib/components/ui/Icon.svelte";
import Switch from "$lib/components/ui/Switch.svelte";
import MotionChoices from "./MotionChoices.svelte";
import { settings, jobsApi, comfy } from "$lib/api";
import { t } from "$lib/i18n.svelte";
import { reduceMotion, setReduceMotion } from "$lib/reduceMotion.svelte";
import { reduceMotion } from "$lib/reduceMotion.svelte";
import CommandPalette from "./CommandPalette.svelte";
import ProjectScope from "./ProjectScope.svelte";
import QueueTray from "./QueueTray.svelte";
@@ -230,7 +230,7 @@
aria-label="查看生成任务"
>
<Icon name="nav-queue" />
{#if genJobs.some((j) => j.status === "running") && !reduceMotion.manual && !reduceMotion.system}<span
{#if genJobs.some((j) => j.status === "running") && reduceMotion.mode !== "off"}<span
class="queue-ring"
aria-hidden="true"
></span>{/if}
@@ -324,14 +324,7 @@
><Icon name="search" size={16} /><span>搜索</span><kbd>Ctrl K</kbd
></button
>
<label class="motion"
><Switch
checked={reduceMotion.system || reduceMotion.manual}
disabled={reduceMotion.system}
label={t("shell.reduceMotion")}
onchange={setReduceMotion}
/><span>减少动效</span></label
>
<MotionChoices />
<LanguageSwitcher /><QueueTray jobs={genJobs} />
</header>
{/if}
@@ -343,11 +336,7 @@
{#snippet headerActions()}<span class="theme-subtitle">同一布局与功能,只换灯光</span>{/snippet}
<ThemeChoices compact />
{#snippet footer()}
<div class="theme-motion"><span class="theme-foot-note" role="status"><Icon name={$themeStorageUnavailable ? "close" : "check"} size={18} />{$themeStorageUnavailable ? "浏览器禁止本地存储:本次有效,其他操作不受影响" : "已记住,下次打开沿用 · 正在编辑的内容不受影响"}</span><button class="a-btn secondary sm"
disabled={reduceMotion.system}
onclick={() => setReduceMotion(!reduceMotion.manual)}
aria-pressed={!reduceMotion.system && !reduceMotion.manual}
><Icon name="motion" size={14} />{reduceMotion.system || reduceMotion.manual ? "动效关" : "动效开"}</button></div>
<div class="theme-motion"><span class="theme-foot-note" role="status"><Icon name={$themeStorageUnavailable ? "close" : "check"} size={18} />{$themeStorageUnavailable ? "浏览器禁止本地存储:本次有效,其他操作不受影响" : "已记住,下次打开沿用 · 正在编辑的内容不受影响"}</span><MotionChoices /></div>
{/snippet}
</Modal>
@@ -367,6 +356,7 @@
.theme-subtitle { font-size: var(--theme-pop-note-size); color: var(--tx-3); }
.theme-foot-note { display: flex; align-items: center; gap: var(--theme-pop-footer-gap); }
.theme-motion {
flex-wrap: wrap;
--button-sm-height: var(--theme-pop-button-height);
--button-sm-padding: var(--theme-pop-button-padding);
--button-sm-font-size: var(--theme-pop-button-size);
@@ -540,9 +530,9 @@
border-radius: var(--rail-queue-ring-radius);
border: var(--rail-queue-ring-border) solid transparent;
border-top-color: var(--sc-video);
animation: rail-spin var(--rail-queue-ring-duration) linear infinite;
animation: var(--queue-loop, rail-spin) var(--rail-queue-ring-duration) linear infinite;
}
@keyframes rail-spin {
@keyframes -global-rail-spin {
to {
transform: rotate(360deg);
}
@@ -571,7 +561,7 @@
text-decoration: none;
}
.app-body {
animation: a-page-enter var(--t-slow) var(--ease-out);
animation: a-page-enter var(--page-enter-duration) var(--ease-out);
display: flex;
flex-direction: column;
min-height: 0;
@@ -622,13 +612,6 @@
color: var(--tx-3);
margin-left: 8px;
}
.motion {
display: flex;
align-items: center;
gap: 6px;
font-size: 10px;
color: var(--text-3);
}
.body {
flex: 1;
min-height: 0;