From 1a78ae2b9913718c8ce8a502a505d336a0ce4779 Mon Sep 17 00:00:00 2001 From: chengyongru <2755839590@qq.com> Date: Thu, 24 Sep 2026 23:10:57 +0800 Subject: [PATCH] perf(webui): restore cached threads and load mention catalogs on demand --- webui/index.html | 60 +++++--------- webui/src/App.tsx | 30 +++---- webui/src/components/StartupShell.tsx | 17 ++++ .../src/components/thread/ThreadComposer.tsx | 7 ++ webui/src/components/thread/ThreadShell.tsx | 23 ++++-- webui/src/hooks/useSessions.ts | 7 +- webui/src/lib/api.ts | 2 +- webui/src/lib/reload-cache.ts | 79 +++++++++++++++++++ webui/src/lib/webui-thread-cache.ts | 38 ++++++++- webui/src/tests/app-layout.test.tsx | 10 +++ webui/src/tests/reload-cache.test.ts | 62 +++++++++++++++ webui/src/tests/thread-shell.test.tsx | 24 ++++++ webui/src/tests/useSessions.test.tsx | 22 ++++++ 13 files changed, 316 insertions(+), 65 deletions(-) create mode 100644 webui/src/components/StartupShell.tsx create mode 100644 webui/src/lib/reload-cache.ts create mode 100644 webui/src/tests/reload-cache.test.ts diff --git a/webui/index.html b/webui/index.html index 95bcba358..7a4f88e0b 100644 --- a/webui/index.html +++ b/webui/index.html @@ -57,45 +57,21 @@ color: #fafafa; } - .boot-splash { - display: flex; - height: 100%; - align-items: center; - justify-content: center; + .startup-shell { position: relative; height: 100%; } + .startup-header { display: flex; justify-content: space-between; padding: 5px 13px; } + .startup-control-shadow { + width: 28px; height: 28px; border-radius: 8px; background: rgba(0,0,0,0.025); } - - .boot-splash-inner { - display: flex; - align-items: center; - gap: 10px; - color: rgba(255, 255, 255, 0.74); - font-size: 14px; + .startup-composer { + position: absolute; inset-inline: 16px; bottom: max(24px, env(safe-area-inset-bottom)); + box-sizing: border-box; max-width: 768px; margin-inline: auto; + height: 96px; border-radius: 24px; background: rgba(0,0,0,0.025); } - - html:not(.dark) .boot-splash-inner { - color: rgba(10, 10, 10, 0.64); - } - - .boot-dot { - width: 8px; - height: 8px; - border-radius: 9999px; - background: currentColor; - opacity: 0.75; - animation: boot-pulse 1s ease-in-out infinite; - } - - @keyframes boot-pulse { - 0%, - 100% { - transform: scale(0.9); - opacity: 0.45; - } - 50% { - transform: scale(1); - opacity: 0.85; - } + .startup-status { + position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; + overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; } + html.dark :is(.startup-control-shadow, .startup-composer) { background: rgba(255,255,255,0.035); }