Skip to content

fix(desktop): load desktop stories on Windows with a config-relative glob - #4517

Merged
Astro-Han merged 1 commit into
apache:mainfrom
ggbdpq:fix/storybook-windows-glob
Sep 2, 2026
Merged

fix(desktop): load desktop stories on Windows with a config-relative glob#4517
Astro-Han merged 1 commit into
apache:mainfrom
ggbdpq:fix/storybook-windows-glob

Conversation

@ggbdpq

@ggbdpq ggbdpq commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • On Windows, Storybook in apps/desktop silently indexed only packages/ui/stories (53 entries, zero desktop story files): the desktop stories glob was built with resolve(REPO_ROOT, ...), handing the globber a backslash absolute path, and glob matchers treat backslashes as escape characters (fix(desktop): desktop stories never load in Storybook on Windows (backslash stories glob) #4516).
  • The desktop glob now uses the same forward-slash config-relative form the neighboring packages/ui entry already uses ('../stories/**/*.stories.@(ts|tsx)'), so it resolves against the config dir on every platform.

Verification

Claim Command Result
Desktop stories load on Windows npm run storybook (apps/desktop), then fetch http://localhost:6006/index.json Before: 53 entries, no product-agent-graph--* / product-onboarding-* / etc. After: 251 entries including all 11 desktop story files; the Product/Agent Graph stories render and play
Linux behavior unchanged - Relative globs resolve against the config dir on both platforms; the packages/ui entry has always used this form
Repo format npm run format:check Checked 1854 files, no issues
ASF headers npm run check:asf-headers Every source file carries the ASF header or a reviewed exclusion

AI use

Analysis and the fix were produced with GLM-5.3-Flash (ZCode) under the contributor's direction; the contributor reviewed and is the human contributor of record.

Checklist

  • Tests and checks pass locally (see Verification)
  • Behavior change: No - config-only fix; Storybook story discovery on Linux is unchanged, on Windows it goes from broken to working

@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Sep 1, 2026
…glob

The desktop stories glob was built with resolve(REPO_ROOT, ...), which on
Windows hands the globber a backslash absolute path; glob matchers treat
backslashes as escape characters, so the pattern matched nothing and
Storybook silently indexed only packages/ui/stories (53 entries, zero
desktop story files). The neighboring packages/ui entry already uses a
forward-slash config-relative glob, which is why those kept working.

Use the same config-relative form for the desktop stories ('../stories/
**/*.stories.@(ts|tsx)'). index.json goes from 53 entries to 251 on
Windows, including all 11 desktop story files; Linux behavior is
unchanged since the relative glob resolves against the same config dir.

Fixes apache#4516

Generated-by: GLM-5.3-Flash (ZCode)
@ggbdpq
ggbdpq force-pushed the fix/storybook-windows-glob branch from 8ec1e70 to 402e3df Compare September 2, 2026 04:11

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving 402e3df1. The desktop entry now uses the same config-relative form the packages/ui entry has always used, so the config directory resolves it on every platform; Linux behaviour and CI are unchanged. Thanks for the index.json before and after counts.

@Astro-Han
Astro-Han merged commit be3eb62 into apache:main Sep 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants