From 6ec6db4ad65a0f3f53239c9f364469c1a4589762 Mon Sep 17 00:00:00 2001 From: Brendan Allan <14191578+Brendonovich@users.noreply.github.com> Date: Thu, 25 Jun 2026 13:50:09 +0800 Subject: [PATCH] fix(storybook): support prompt state capture (#33798) --- packages/storybook/.storybook/mocks/app/context/prompt.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/storybook/.storybook/mocks/app/context/prompt.ts b/packages/storybook/.storybook/mocks/app/context/prompt.ts index fa5f06f81d..1ea1fc7983 100644 --- a/packages/storybook/.storybook/mocks/app/context/prompt.ts +++ b/packages/storybook/.storybook/mocks/app/context/prompt.ts @@ -73,7 +73,7 @@ export function createPromptState() { key: item.key ?? `ctx:${++index}`, }) - return { + const value = { ready, current: () => store.prompt, cursor: () => store.cursor, @@ -87,6 +87,7 @@ export function createPromptState() { setStore("cursor", 0) setStore("items", (current) => current.filter((item) => !!item.comment?.trim())) }, + capture: () => value, context: { items: () => store.items, add(item: Omit & { key?: string }) { @@ -116,6 +117,7 @@ export function createPromptState() { }, }, } + return value } const prompt = createPromptState()