Skip to content

fix(IdPrefix): add Storybook controls - #22860

Open
Subhom1 wants to merge 1 commit into
carbon-design-system:mainfrom
Subhom1:fix-id-prefix-storybook-controls-20929
Open

fix(IdPrefix): add Storybook controls#22860
Subhom1 wants to merge 1 commit into
carbon-design-system:mainfrom
Subhom1:fix-id-prefix-storybook-controls-20929

Conversation

@Subhom1

@Subhom1 Subhom1 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Closes #20929

Adds an operable Storybook prefix control to the React IdPrefix story. The story now renders the provider from args while retaining the side-by-side default and custom-prefix comparison.

Changelog

New

  • Added a text control and default arg for the IdPrefix prefix value.

Changed

  • Updated the IdPrefix story to pass Storybook args into the provider.
  • Hid the children control because the story intentionally renders a fixed context consumer.

Removed

  • None.

Testing / Reviewing

  1. Use the repository Node version and start React Storybook:

    nvm use
    yarn workspace @carbon/react storybook
    
  2. Open Components/IdPrefix.

  3. Verify:

    • The first line continues to show the default empty prefix.
    • The second line initially shows custom.
    • Editing prefix immediately updates only the value inside IdPrefix.
    • No children control is displayed.
  4. Run the focused checks:

    yarn prettier --check packages/react/src/components/IdPrefix/IdPrefix.stories.js
    yarn jest packages/react/src/components/IdPrefix/__tests__/IdPrefix-test.js --runInBand
    yarn workspace @carbon/react storybook:build
    npx --yes serve -l 3000 packages/react/storybook-static
    CI=1 yarn playwright test e2e/components/IdPrefix/IdPrefix-test.avt.e2e.js --project chromium
    

Test Screenshots
Screenshot 2026-08-02 at 2 09 05 a m

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and Storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the [pull request guide](https://github.com/carbon-design-system/carbon/blob/main/docs/guides/reviewing-pull-requests.md).

@Subhom1
Subhom1 requested a review from a team as a code owner August 2, 2026 01:09
@Subhom1
Subhom1 requested review from 2nikhiltom and kennylam August 2, 2026 01:09
@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for v2-carbon-react ready!

Name Link
🔨 Latest commit f30835e
🔍 Latest deploy log https://app.netlify.com/projects/v2-carbon-react/deploys/6a6e98bdd4d48d0008cdcff5
😎 Deploy Preview https://deploy-preview-22860--v2-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for v3-carbon-web-components ready!

Name Link
🔨 Latest commit f30835e
🔍 Latest deploy log https://app.netlify.com/projects/v3-carbon-web-components/deploys/6a6e98bdd8ef7f0008e2b749
😎 Deploy Preview https://deploy-preview-22860--v3-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f30835e
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a6e98bdd7e21800084805d2
😎 Deploy Preview https://deploy-preview-22860--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit f30835e
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a6e98bdbe6da30008209969
😎 Deploy Preview https://deploy-preview-22860--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit f30835e
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a6e98bdbcc37a000852253b
😎 Deploy Preview https://deploy-preview-22860--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.59%. Comparing base (06563e3) to head (f30835e).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22860      +/-   ##
==========================================
- Coverage   89.60%   89.59%   -0.01%     
==========================================
  Files         582      582              
  Lines       53277    53317      +40     
  Branches     7286     7285       -1     
==========================================
+ Hits        47738    47769      +31     
- Misses       5402     5411       +9     
  Partials      137      137              
Flag Coverage Δ
main-packages 87.61% <ø> (+<0.01%) ⬆️
web-components 90.25% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IdPrefix]: add controls args to every story

1 participant