Skip to content

Commit f786fb0

Browse files
cliffhallclaude
andcommitted
fix(stories): inline SVG for WithIcon stories so they render reliably
The Wikipedia-hosted PNG used in the AppListItem and AppDetailPanel WithIcon stories returned a broken image in Storybook (rate-limited / hot-link blocked). Replace it with an inline SVG sun icon as a data URI so the stories render offline, in Chromatic, and on any network. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2dd8730 commit f786fb0

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

clients/web/src/components/groups/AppDetailPanel/AppDetailPanel.stories.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,15 @@ const multiParamTool: Tool = {
5353
},
5454
};
5555

56+
// Inline SVG so stories render offline and in Chromatic without external fetches.
57+
const SUN_ICON_SVG =
58+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='gold'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cg stroke='gold' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='12' y1='2' x2='12' y2='5'/%3E%3Cline x1='12' y1='19' x2='12' y2='22'/%3E%3Cline x1='2' y1='12' x2='5' y2='12'/%3E%3Cline x1='19' y1='12' x2='22' y2='12'/%3E%3Cline x1='4.93' y1='4.93' x2='7.05' y2='7.05'/%3E%3Cline x1='16.95' y1='16.95' x2='19.07' y2='19.07'/%3E%3Cline x1='4.93' y1='19.07' x2='7.05' y2='16.95'/%3E%3Cline x1='16.95' y1='7.05' x2='19.07' y2='4.93'/%3E%3C/g%3E%3C/svg%3E";
59+
5660
const iconTool: Tool = {
5761
name: "weather_widget",
5862
title: "Weather Widget",
5963
description: "Displays the current weather for a given city.",
60-
icons: [
61-
{
62-
src: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Sun_in_X-Ray.png/120px-Sun_in_X-Ray.png",
63-
mimeType: "image/png",
64-
sizes: ["120x120"],
65-
},
66-
],
64+
icons: [{ src: SUN_ICON_SVG, mimeType: "image/svg+xml" }],
6765
inputSchema: {
6866
type: "object",
6967
properties: {

clients/web/src/components/groups/AppListItem/AppListItem.stories.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,16 @@ const noDescriptionTool: Tool = {
2727
inputSchema: { type: "object" },
2828
};
2929

30+
// Inline SVG so stories render offline and in Chromatic without external fetches.
31+
const SUN_ICON_SVG =
32+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='gold'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cg stroke='gold' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='12' y1='2' x2='12' y2='5'/%3E%3Cline x1='12' y1='19' x2='12' y2='22'/%3E%3Cline x1='2' y1='12' x2='5' y2='12'/%3E%3Cline x1='19' y1='12' x2='22' y2='12'/%3E%3Cline x1='4.93' y1='4.93' x2='7.05' y2='7.05'/%3E%3Cline x1='16.95' y1='16.95' x2='19.07' y2='19.07'/%3E%3Cline x1='4.93' y1='19.07' x2='7.05' y2='16.95'/%3E%3Cline x1='16.95' y1='7.05' x2='19.07' y2='4.93'/%3E%3C/g%3E%3C/svg%3E";
33+
3034
const withIconTool: Tool = {
3135
name: "weather_widget",
3236
title: "Weather Widget",
3337
description:
3438
"Displays the current weather and a five-day forecast for any city.",
35-
icons: [
36-
{
37-
src: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Sun_in_X-Ray.png/120px-Sun_in_X-Ray.png",
38-
mimeType: "image/png",
39-
sizes: ["120x120"],
40-
},
41-
],
39+
icons: [{ src: SUN_ICON_SVG, mimeType: "image/svg+xml" }],
4240
inputSchema: { type: "object" },
4341
};
4442

0 commit comments

Comments
 (0)