From 9f51ea5e84a7aec0dcefefbdabdefee3626b3c30 Mon Sep 17 00:00:00 2001 From: KimiSwitch Dev Date: Wed, 7 Oct 2026 23:35:30 +0800 Subject: [PATCH] =?UTF-8?q?perf(dashboard):=20=E5=8A=A0=E8=BD=BD=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=8E=BB=E6=8E=89=E5=AF=B9=E6=95=B4=E4=B8=AA=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E7=9A=84=20JSON.stringify=EF=BC=88=E6=95=B0?= =?UTF-8?q?=20MB=20=E5=A4=A7=E5=AF=B9=E8=B1=A1=E5=9C=A8=20webview=20?= =?UTF-8?q?=E4=B8=BB=E7=BA=BF=E7=A8=8B=E5=BA=8F=E5=88=97=E5=8C=96=E9=80=A0?= =?UTF-8?q?=E6=88=90=E5=8D=A1=E9=A1=BF=EF=BC=89=EF=BC=8CloadStats=20?= =?UTF-8?q?=E4=BB=85=E4=BF=9D=E7=95=99=E8=80=97=E6=97=B6=20ms=EF=BC=8C?= =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E6=A1=88=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dashboard/DashboardPage.tsx | 2 +- src/hooks/useDashboard.ts | 7 ++----- src/i18n/en.ts | 2 +- src/i18n/zh.ts | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/dashboard/DashboardPage.tsx b/src/components/dashboard/DashboardPage.tsx index 39a0818..4fc56d5 100644 --- a/src/components/dashboard/DashboardPage.tsx +++ b/src/components/dashboard/DashboardPage.tsx @@ -179,7 +179,7 @@ export function DashboardPage() { {loadStats && !loading && ( - {t("loadStats", { ms: loadStats.ms, kb: loadStats.kb })} + {t("loadStats", { ms: loadStats.ms })} )} diff --git a/src/hooks/useDashboard.ts b/src/hooks/useDashboard.ts index 122c630..6880fe2 100644 --- a/src/hooks/useDashboard.ts +++ b/src/hooks/useDashboard.ts @@ -23,7 +23,7 @@ export function useDashboard() { const [loading, setLoading] = useState(false); const [error, setError] = useState(null); /** Round-trip timing for the last get_summary call (user-perceived lag). */ - const [loadStats, setLoadStats] = useState<{ ms: number; kb: number } | null>(null); + const [loadStats, setLoadStats] = useState<{ ms: number } | null>(null); const refresh = useCallback(async (force = false) => { setLoading(true); @@ -35,10 +35,7 @@ export function useDashboard() { refresh: force, }); setData(result); - setLoadStats({ - ms: Math.round(performance.now() - start), - kb: Math.round(JSON.stringify(result).length / 1024), - }); + setLoadStats({ ms: Math.round(performance.now() - start) }); } catch (err) { const msg = err instanceof Error ? err.message : String(err); setError(msg); diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 1a417b8..b4cb181 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -257,7 +257,7 @@ export const enTranslations: Record = { scanning: "Scanning…", refresh: "Refresh", refreshing: "Refreshing…", - loadStats: "Loaded in {ms} ms · {kb} KB payload", + loadStats: "Loaded in {ms} ms", refreshed: "Refreshed", cancel: "Cancel", confirmDeleteTitle: "Delete session forever?", diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index 41ecfa3..8880ea1 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -249,7 +249,7 @@ export const zhTranslations = { scanning: "扫描中…", refresh: "刷新", refreshing: "刷新中…", - loadStats: "加载 {ms} ms · 数据 {kb} KB", + loadStats: "加载 {ms} ms", refreshed: "已刷新", cancel: "取消", confirmDeleteTitle: "永久删除会话?",