From 346689fb438a6d680619f1992ee246be0f3e078c Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Sat, 22 Aug 2026 15:05:51 +1000 Subject: [PATCH] fix(storybook): use production styles and remove synthetic tool stories (#44058) --- .../src/components/basic-tool.stories.tsx | 229 ------------------ .../src/timeline/timeline-row.stories.tsx | 12 - packages/storybook/.storybook/main.ts | 1 + packages/storybook/.storybook/preview.tsx | 4 +- 4 files changed, 2 insertions(+), 244 deletions(-) delete mode 100644 packages/session-ui/src/components/basic-tool.stories.tsx diff --git a/packages/session-ui/src/components/basic-tool.stories.tsx b/packages/session-ui/src/components/basic-tool.stories.tsx deleted file mode 100644 index 9280c308fa6..00000000000 --- a/packages/session-ui/src/components/basic-tool.stories.tsx +++ /dev/null @@ -1,229 +0,0 @@ -import { createSignal, For, Show } from "solid-js" -import { createStore } from "solid-js/store" -import { Button } from "@opencode-ai/ui/button" -import { Icon } from "@opencode-ai/ui/icon" -import { BasicTool } from "./basic-tool" - -export default { - title: "OpenCode/Tools/Disclosure", - id: "components-basic-tool", - component: BasicTool, - parameters: { - docs: { - description: { - component: - "The disclosure frame shared by production tool messages. Use these stories to inspect common resting, running, expanded, and summary-only states.", - }, - }, - }, -} - -export const Completed = { - render: () => ( - -
Loaded the requested file.
-
- ), -} - -export const Running = { - render: () => ( - -
Running timeline tests...
-
- ), -} - -export const Collapsed = { - render: () => ( - -
2 matching files
-
- ), -} - -export const SummaryOnly = { - render: () => ( - - ), -} - -export const Controlled = { - render: () => { - const [state, setState] = createStore({ open: false }) - return ( -
- - setState("open", open)} - trigger={{ title: "Edited", subtitle: "src/session.ts", args: ["+3", "-1"] }} - > -
Changed the active Session label.
-
-
- ) - }, -} - -export const WebFetch = { - render: () => ( - -
- Webfetch - - https://www.figma.com - - -
- - } - /> - ), -} - -const mockSearchUrls = [ - "https://www.figma.com/community/file/1606560040358762787/figma-mcp-console-setup-guide", - "https://designagentlab.com", - "https://www.figma.com/community/whiteboarding?resource_type=widgets", - "https://figma-console-mcp.southleft.com/mcp", - "https://designagentlab.com/figma-console-mcp", - "https://designagentlab.com/figma-tutorials", - "https://github.com/southleft/figma-console-mcp/issues", - "https://designagentlab.com/ui-kits", - "https://designagentlab.com/prototyping-tools", - "https://www.inthepocket.design/guidelines/figma-mcp/setup-figma-mcp", - "https://www.figma.com/community/plugins", - "https://figma-console-mcp.southleft.com/docs", - "https://designagentlab.com/resources", - "https://github.com/southleft/figma-console-mcp/releases", - "https://www.inthepocket.design/blog/figma-mcp", - "https://designagentlab.com/community", -] - -export const WebSearch = { - render: () => { - const [showAll, setShowAll] = createSignal(false) - let firstRevealedRef: HTMLAnchorElement | undefined - const visibleLinks = () => (showAll() ? mockSearchUrls : mockSearchUrls.slice(0, 10)) - const remaining = () => Math.max(0, mockSearchUrls.length - 10) - - const expand = (event: MouseEvent) => { - event.stopPropagation() - setShowAll(true) - requestAnimationFrame(() => { - firstRevealedRef?.focus() - }) - } - - return ( - -
-
- - {(url, index) => ( - { - if (index() === 10) firstRevealedRef = el - }} - data-slot="exa-tool-link" - class="webfetch-link" - href={url} - target="_blank" - rel="noopener noreferrer" - onClick={(event) => event.stopPropagation()} - > - {url} - - - )} - - 0}> - - -
-
-
- ) - }, -} - -export const GatheredContext = { - render: () => ( - -
-
- Shell - opencode2 api get /openapi.json -
-
- Explore - inspect active v2 beta service -
-
- Patch - packages/session-ui/src/tools -
-
-
- ), -} - -export const PatchFileList = { - render: () => ( - -
-
- - packages/app/src/composer/composer.tsx -
-
- - packages/session-ui/src/tools/tool-renderer.tsx -
-
- - packages/session-ui/src/components/basic-tool.css -
-
- - packages/ui/src/icons/icon/icon.tsx -
-
-
- ), -} diff --git a/packages/session-ui/src/timeline/timeline-row.stories.tsx b/packages/session-ui/src/timeline/timeline-row.stories.tsx index dac196af017..6d47a05b274 100644 --- a/packages/session-ui/src/timeline/timeline-row.stories.tsx +++ b/packages/session-ui/src/timeline/timeline-row.stories.tsx @@ -9,7 +9,6 @@ import { requestHistoryDocument, retryDocument, revertDocument, - skillWorkflowDocument, streamingDocument, thinkingDocument, } from "../storybook/current-session-fixtures" @@ -73,17 +72,6 @@ export const CompactionAndContinuation = { ), } -export const AgentAndSkillContext = { - render: () => ( - - ), -} - export const AnsweredQuestionAndDeclinedCommand = { render: () => (