From b0ee37fe32481008712dab306ec91f7cc4995015 Mon Sep 17 00:00:00 2001 From: Charlie Croom Date: Mon, 14 Sep 2026 17:26:42 -0400 Subject: [PATCH 1/2] Generate only the notification histories the browser journeys need Co-authored-by: Amp Signed-off-by: Charlie Croom --- tests/browser/notifications.spec.mjs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/browser/notifications.spec.mjs b/tests/browser/notifications.spec.mjs index be402427..a64a3fae 100644 --- a/tests/browser/notifications.spec.mjs +++ b/tests/browser/notifications.spec.mjs @@ -7,6 +7,7 @@ test.use({ readState: true, threadUnread: true, pluginFixtures: true, + historyCounts: { alpha: 20, beta: 1 }, }); // Only the browser's OS boundary is replaced. The built host, session, @@ -240,12 +241,6 @@ for (const kind of ["mention", "thread reply"]) { }) => { // Model a real prior contribution in relay history, not a client-side // participation/readiness override. The incoming reply itself has no p tag. - // Keep this prior contribution inside the existing 500-event unread - // evidence window; the default 640-row Alpha fixture would crowd it out. - app.histories.set( - "primary/alpha", - app.histories.get("primary/alpha").slice(-200), - ); const root = kind === "thread reply" ? app.append("primary", "beta", "My prior thread", false) From 4c5c919d080939eb4127e90ab29e3422f4656f58 Mon Sep 17 00:00:00 2001 From: Charlie Croom Date: Tue, 15 Sep 2026 09:32:56 -0400 Subject: [PATCH 2/2] Make thread-history navigation independent of unread badge timing Co-authored-by: Amp Signed-off-by: Charlie Croom Amp-Thread-ID: https://ampcode.com/threads/T-01a0a149-b278-7550-acc4-356168b0c4b5 --- .../browser/navigation-thread-history.spec.mjs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/browser/navigation-thread-history.spec.mjs b/tests/browser/navigation-thread-history.spec.mjs index eb45cf5a..5b2da3ec 100644 --- a/tests/browser/navigation-thread-history.spec.mjs +++ b/tests/browser/navigation-thread-history.spec.mjs @@ -7,7 +7,21 @@ test("Back restores each thread visit before the previous channel", async ({ page, app, }) => { - await open(page, app); + const beta = page + .getByRole("navigation", { name: "Subscribed channels" }) + .locator('button[data-channel-id="beta"]'); + app.relay.holdUnread(); + try { + await open(page, app); + await expect.poll(() => app.report.unreadHolds.length).toBe(1); + await expect(beta).toHaveAccessibleName("Beta"); + } finally { + app.relay.releaseUnread(); + } + // Unread evidence changes the accessible name independently of navigation. + await expect(beta.getByRole("img")).toHaveAccessibleName( + "20 observed unread messages. Not an exact total.", + ); const roots = app.histories .get("primary/alpha") .filter((row) => row.content.startsWith("Thread root")); @@ -36,7 +50,7 @@ test("Back restores each thread visit before the previous channel", async ({ ); await expect(panel.getByText("Thread root 1", { exact: true })).toBeVisible(); expect(await openThread.evaluate((node) => node.isConnected)).toBe(true); - await page.getByRole("button", { name: "Beta", exact: true }).click(); + await beta.click(); await expect( page.getByRole("textbox", { name: "Message #Beta", exact: true }), ).toBeVisible();