From e49af5667fc17e0e56af0849844a5ee38f18da98 Mon Sep 17 00:00:00 2001 From: Nathan Lewis Date: Wed, 18 Nov 2026 09:32:40 -0600 Subject: [PATCH] Stop browsers restoring stale values into the date inputs on Back Chromium re-fills form fields from history when you go Back, so /team showed the old custom dates beside the 30d metrics. autocomplete=off makes the browser keep the server-rendered values. Co-Authored-By: Claude Opus 5.5 --- components/dashboard.tsx | 2 ++ tests/dashboard.e2e.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/components/dashboard.tsx b/components/dashboard.tsx index 7473061..e642bb4 100644 --- a/components/dashboard.tsx +++ b/components/dashboard.tsx @@ -129,6 +129,7 @@ export function WindowControls({ name="start" defaultValue={window.start} key={window.start} + autoComplete="off" required /> @@ -139,6 +140,7 @@ export function WindowControls({ name="end" defaultValue={window.end} key={window.end} + autoComplete="off" required /> diff --git a/tests/dashboard.e2e.ts b/tests/dashboard.e2e.ts index 3e5eb5f..4f68c02 100644 --- a/tests/dashboard.e2e.ts +++ b/tests/dashboard.e2e.ts @@ -36,6 +36,22 @@ test("preset and custom date windows survive navigation", async ({ /start=2026-08-01.*end=2026-08-07/, ); }); +test("date inputs match the window after Back to the default", async ({ + app, + screen, + browser, +}) => { + await app.open("/team"); + await screen.getByLabel("Start", { exact: true }).fill("2026-10-01"); + await screen.getByLabel("End", { exact: true }).fill("2026-10-31"); + await screen.getByRole("button", "Apply dates").tap(); + await expect(browser).toHaveURL(/start=2026-10-01.*end=2026-10-31/); + await app.open("/team?start=2026-10-01&end=2026-10-31"); + await browser.back(); + await expect(browser).toHaveURL(/\/team$/); + await expect(screen.getByLabel("Start", { exact: true })).not.toHaveValue("2026-10-01"); + await expect(screen.getByLabel("End", { exact: true })).not.toHaveValue("2026-10-31"); +}); test("review and DAG filters use URL state", async ({ app, screen,