From 7b8ff467b8c1e0ad289dd60f968858e703be8b75 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Tue, 24 Nov 2026 02:19:44 +0000 Subject: [PATCH] fix(ui): load each overview panel once The download trend, leaderboards and scanner health sat inside the stats loading branch. A stats refresh unmounted and remounted them, so every panel fetched its data twice on each visit. --- frontend/src/components/Overview.spec.ts | 9 +++++++++ frontend/src/components/Overview.vue | 19 +++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/Overview.spec.ts b/frontend/src/components/Overview.spec.ts index bdce22f..a0289ad 100644 --- a/frontend/src/components/Overview.spec.ts +++ b/frontend/src/components/Overview.spec.ts @@ -46,6 +46,15 @@ async function open() { } describe('Overview', () => { + it('fetches each panel once while the stats load', async () => { + await open() + const urls = vi.mocked(axios.get).mock.calls.map(([url]) => String(url)) + const count = (prefix: string) => urls.filter((u) => u.startsWith(prefix)).length + expect(count('/api/stats/timeseries')).toBe(1) + expect(count('/api/analytics/trending')).toBe(1) + expect(urls.filter((u) => u.includes('layout=rows')).length).toBe(1) + }) + it('counts each verdict from the stats', async () => { const { wrapper, problems } = await open() expect(problems).toEqual([]) diff --git a/frontend/src/components/Overview.vue b/frontend/src/components/Overview.vue index 129ea4e..7832e88 100644 --- a/frontend/src/components/Overview.vue +++ b/frontend/src/components/Overview.vue @@ -40,17 +40,25 @@ + -
- - -
+ +
+ + + +
- + Live activity What the proxy just did. @@ -67,7 +75,6 @@
-