Skip to content

fix(storybook): exclude internal patterns from production - #6930

Open
rubencarvalho wants to merge 1 commit into
mainfrom
ruben/review-pr-6925
Open

rubencarvalho wants to merge 1 commit into
mainfrom
ruben/review-pr-6925

Conversation

@rubencarvalho

Copy link
Copy Markdown
Contributor

Description

Exclude pattern .internal.stories.ts and .internal.mdx files from the production gen2 Storybook build, using the same globs as components and icons. Development, CI accessibility, and VRT modes are unchanged.

Expected outcomes:

  • Given a production build, when pattern stories and docs are indexed, internal files are excluded and public files remain included.
  • Given development or CI accessibility mode, when pattern files are indexed, internal stories and docs remain available.

Motivation and context

Reviewing #6925 exposed that production pattern globs still included internal-only files, such as Pixel Loader, despite the build's documented exclusion policy. This is a separate, two-line configuration fix; it does not change the documentation PR.

Validation:

  • node --test /Users/ruben/.copilot/session-state/cdaf386e-885d-49b8-a2e9-7150f962d50b/files/storybook-pattern-globs.test.mjs (Node 24.22.1): passed all four checks against the actual configuration declarations and pattern files. Checks cover production internal exclusion, retention of all public stories/docs, and unchanged internal discovery in development and CI accessibility modes. The production checks failed before the fix. This is a local verification script, not a committed regression test.
  • npx --yes prettier@3.8.1 --check gen2/packages/swc/.storybook/main.ts: passed.
  • git diff --cached --check: passed.
  • yarn lint:ai: blocked because this worktree has no installed dependency state. Running the validator directly was also blocked by the missing prettier dependency.
  • Full Storybook build, ESLint, and browser/accessibility checks: not run; workspace dependencies are not installed.

Related issue(s)

Screenshots (if appropriate)

N/A. Story discovery configuration only; no component rendering changes.


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

No published-package change or changeset is needed. The configuration now matches its existing comment. Validation used a local script rather than adding a test harness for this two-line config change. The linked PULL_REQUESTS.md does not exist in this checkout.


Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Production excludes internal patterns but retains public patterns

    1. Run the gen2 production Storybook build and open it.
    2. Inspect Patterns / AI toolkit.
    3. Expect Pixel Loader's internal stories and docs to be absent, while public patterns such as Prompt Field remain available.
  • Development still includes internal patterns

    1. Start the gen2 development Storybook.
    2. Open Patterns / AI toolkit.
    3. Expect Pixel Loader's internal stories and docs to remain available.

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

Required: Complete each applicable item and document your testing steps (replace the placeholders with your component-specific instructions).

No component semantics, keyboard handling, or focus behavior changed. The following are optional surrounding-Storybook smoke checks and have not been performed.

  • Keyboard (required — document steps below) — What to test for: Focus order is logical; Tab reaches the component and all interactive descendants; Enter/Space activate where appropriate; arrow keys work for tabs, menus, sliders, etc.; no focus traps; Escape dismisses when applicable; focus indicator is visible.

    1. Open the production Storybook and navigate its Patterns sidebar with the keyboard.
    2. Open a retained public pattern such as Prompt Field.
    3. Expect normal keyboard navigation and visible focus, with no internal Pixel Loader entry.
  • Screen reader (required — document steps below) — What to test for: Role and name are announced correctly; state changes (e.g. expanded, selected) are announced; labels and relationships are clear; no unnecessary or duplicate announcements.

    1. Open the production Storybook with VoiceOver.
    2. Navigate the Patterns sidebar and open a retained public pattern.
    3. Expect public pattern names to be announced normally and internal Pixel Loader entries to be absent.

Cross-model review

  • Claude Opus 5.5: OK to merge; no blockers or major issues.
  • Gemini 4 Argon: approve; no findings.
  • Deferred minor findings: the public AI toolkit overview and Pixel Loader dev-warning URL currently link to Pixel Loader's internal docs. Those destinations will no longer be published after this fix. Updating the Pixel Loader documentation references is separate from the requested production-discovery correction.
  • Findings fixed or rejected: none.

@rubencarvalho
rubencarvalho requested a review from a team as a code owner November 11, 2026 12:39
@rubencarvalho rubencarvalho added the Status:Ready for review PR ready for review or re-review. label Nov 11, 2026
@changeset-bot

changeset-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ebd2c32

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6930

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant