From f723196158e365f6df655766089c5ec541ffaf19 Mon Sep 17 00:00:00 2001 From: Ammar Date: Thu, 4 Dec 2025 10:06:59 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20fix:=20make=20StreamError=20stor?= =?UTF-8?q?ybook=20story=20deterministic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable auto-retry in the StreamError story to show the deterministic 'Retry' button instead of a live countdown timer. The countdown was flaky in visual tests because it used Date.now() to calculate remaining time. _Generated with `mux`_ --- src/browser/stories/App.errors.stories.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/browser/stories/App.errors.stories.tsx b/src/browser/stories/App.errors.stories.tsx index 1c3bee0ca4..bbff3fa985 100644 --- a/src/browser/stories/App.errors.stories.tsx +++ b/src/browser/stories/App.errors.stories.tsx @@ -14,6 +14,7 @@ import { createFileEditTool, createStaticChatHandler, } from "./mockFactory"; +import { getAutoRetryKey } from "@/common/constants/storage"; import { selectWorkspace, setupSimpleChatStory, setupCustomChatStory } from "./storyHelpers"; import { createMockORPCClient } from "../../../.storybook/mocks/orpc"; @@ -99,9 +100,13 @@ const LARGE_DIFF = [ export const StreamError: AppStory = { render: () => ( - setupCustomChatStory({ - workspaceId: "ws-error", + setup={() => { + const workspaceId = "ws-error"; + // Disable auto-retry to show deterministic "Retry" button instead of countdown timer + localStorage.setItem(getAutoRetryKey(workspaceId), JSON.stringify(false)); + + return setupCustomChatStory({ + workspaceId, chatHandler: (callback: (event: WorkspaceChatMessage) => void) => { setTimeout(() => { callback( @@ -123,8 +128,8 @@ export const StreamError: AppStory = { // eslint-disable-next-line @typescript-eslint/no-empty-function return () => {}; }, - }) - } + }); + }} /> ), };