fix(desktop): use config-relative glob so desktop stories load on Windows - #4541
Closed
bytelazy wants to merge 1 commit into
Closed
fix(desktop): use config-relative glob so desktop stories load on Windows#4541bytelazy wants to merge 1 commit into
bytelazy wants to merge 1 commit into
Conversation
…dows The desktop stories entry was built with resolve(REPO_ROOT, ...), which produces a backslash absolute path on Windows. Glob matchers treat backslashes as escape characters, so the pattern matched nothing and the desktop stories were silently dropped from the index (53 entries instead of 251). The neighboring packages/ui entry is a forward-slash, config-relative glob, which is why only the UI stories kept working. Use the same config-relative form for the desktop entry so the glob matches on all platforms. Fixes apache#4516 Generated-by: Claude (Claude Code)
bytelazy
force-pushed
the
fix/desktop-storybook-windows-glob
branch
from
September 2, 2026 06:48
9db8136 to
f1d46d5
Compare
4 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows, Storybook run from
apps/desktopnever indexes the desktop storyfiles:
index.jsonreports 53 entries (only thepackages/uistories) andnone of the desktop stories appear in the sidebar. The desktop stories glob was
built with
resolve(REPO_ROOT, 'apps/desktop/stories/**/*.stories.@(ts|tsx)'),which produces a backslash absolute path on Windows. Glob matchers treat
backslashes as escape characters, so the pattern matches nothing and the entry
is silently dropped. The neighboring
packages/uientry is a forward-slash,config-relative glob — which is why exactly the UI stories kept working, and
why CI (Linux) never caught it: a resolved absolute POSIX path still globs
correctly.
Switch the desktop entry to the same config-relative, forward-slash form
(
'../stories/**/*.stories.@(ts|tsx)') so the glob matches on all platforms.Fixes #4516
Verification
Verified the glob behavior directly with
fast-glob(the matcher Storybookuses) against a clean checkout:
../stories/**/*.stories.@(ts|tsx)resolvesfrom
apps/desktop/.storybook/and matches all 15 desktop story files(including the
settings/andsubagent-sessionsentries).CI (Linux) never caught the bug.
E:\...\stories\**)matches 0 files, reproducing the reported Windows failure.
Not run: a full Storybook launch on Windows (no Windows machine here), and the
repo's lint/typecheck/test suites (a full
npm cicould not complete from thisnetwork). The glob-level reproduction above demonstrates both the bug and the
fix; a reviewer on Windows can confirm end-to-end with
npm run storybookinapps/desktopand check http://localhost:6006/index.json (expected: 251entries, all desktop stories present).
AI use
Tool(s) and scope: Claude Code — identified the fix, edited
apps/desktop/.storybook/main.ts, and authored the commit. The commit carriesa
Generated-by: Claude (Claude Code)trailer.Checklist
Does this PR entail a change in behavior?