From 98836ea99060ca46e236d093e2a81a8571274875 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Thu, 24 Sep 2026 07:10:31 +0300 Subject: [PATCH] fix(frontend): fix Dashboard contrast and web-ui-sweep empty-fleet checks Dashboard's usage-view first-run CTA used opacity-60 on inherited text color instead of the themed base-content token, producing low-contrast text against bg-base-200 in some themes. Switch to text-base-content/60. The web-ui-sweep servers-list and Activity/Usage checks assumed a non-empty fleet; a sweep run without a fixture upstream renders the first-run empty states instead of the KPI tiles and usage tile (#1049/#1216), which made those two checks fail. Anchor on whichever state the instance should show and assert accordingly instead of assuming a populated fleet. --- e2e/web-ui-sweep/web-ui-sweep.spec.ts | 23 +++++++++++++++++++---- frontend/src/views/Dashboard.vue | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/e2e/web-ui-sweep/web-ui-sweep.spec.ts b/e2e/web-ui-sweep/web-ui-sweep.spec.ts index 95e0d2dc8..e89af10e6 100644 --- a/e2e/web-ui-sweep/web-ui-sweep.spec.ts +++ b/e2e/web-ui-sweep/web-ui-sweep.spec.ts @@ -47,9 +47,16 @@ async function goto(page: Page, route: string, anchor: string) { test('servers list renders the fleet with KPI counters', async ({ page }) => { const errors = watchPageErrors(page) - await goto(page, '/servers', '[data-test="kpi-card-total"]') - - await expect(page.locator('[data-test="kpi-card-total"]')).toContainText(/\d/) + // An empty fleet (no fixture registered) renders the first-run empty state + // INSTEAD of the KPI tiles — deliberately hidden until a server exists + // (#1049/#1216) — so anchor on whichever of the two the instance should show. + await goto(page, '/servers', '[data-test="kpi-card-total"], [data-test="servers-first-run-empty"]') + + if (!SERVER && (await page.locator('[data-test="servers-first-run-empty"]').isVisible())) { + await expect(page.locator('[data-test="kpi-card-total"]')).toHaveCount(0) + } else { + await expect(page.locator('[data-test="kpi-card-total"]')).toContainText(/\d/) + } if (SERVER) { await expect(page.locator('[data-test="server-card-title"]', { hasText: SERVER }).first()) .toBeVisible() @@ -187,7 +194,15 @@ test('Activity and Usage report the same 24h numbers as the API', async ({ page, } // The Usage tile must show the SAME call count the Activity header does. - await goto(page, '/usage', '[data-test="usage-view"]') + // With no upstream configured, /usage shows the first-run CTA instead of the + // charts (#1049) — there is no Usage tile to compare, so stop at the API and + // Activity halves above. + await goto(page, '/usage', '[data-test="usage-view"], [data-test="dashboard-usage-first-run"]') + if (await page.locator('[data-test="dashboard-usage-first-run"]').isVisible()) { + expect(SERVER, `/usage shows the first-run CTA although fixture ${SERVER} is registered`).toBe('') + expect(errors, `page exceptions: ${errors.join(', ')}`).toHaveLength(0) + return + } await expect( page.locator('[data-test="usage-calls-tile"] .stat-value'), 'Usage "Calls" disagrees with the call count Activity prints for the same window', diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue index d89aab733..afa24ca03 100644 --- a/frontend/src/views/Dashboard.vue +++ b/frontend/src/views/Dashboard.vue @@ -157,7 +157,7 @@

Add your first server to see usage

-

+

No upstream MCP servers are configured yet, so there is nothing to chart. Add one and this page will show call volume, token sinks, error rates and a timeline.