Skip to content

fix(Layout): add Storybook controls - #23041

Open
Subhom1 wants to merge 1 commit into
carbon-design-system:mainfrom
Subhom1:fix-preview-layout-storybook-controls-20974
Open

fix(Layout): add Storybook controls#23041
Subhom1 wants to merge 1 commit into
carbon-design-system:mainfrom
Subhom1:fix-preview-layout-storybook-controls-20974

Conversation

@Subhom1

@Subhom1 Subhom1 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Closes #20974

Adds operative Storybook controls for the preview Layout stories in both React and Web Components. The stories now expose matching density and size controls with default args, keeping the control surface focused on props that actually affect the rendered layout demo.

Changelog

New

  • Added default Storybook args for density and size to the React Preview/preview__Layout story.
  • Added default Storybook args for density and size to the Web Components Preview/preview__Layout story.

Changed

  • Added explicit density radio controls and size select controls for React and Web Components Layout stories.
  • Limited visible controls to the operative density and size args.
  • Moved Web Components Layout controls to meta-level story configuration for parity with the React story and shared defaults.

Removed

  • None.

Testing / Reviewing

  1. Use the repository Node version:

    nvm use
    yarn install --immutable
    
  2. Open React Storybook:

    yarn workspace @carbon/react storybook
    
  3. Open the Preview/preview__Layout default story and verify:

    • The controls panel shows density and size.
    • Changing density updates the rendered <Layout> context.
    • Changing size updates the rendered <Layout> context.
    • No unrelated or inoperative controls are shown.
  4. Open Web Components Storybook:

    yarn workspace @carbon/web-components storybook
    
  5. Open the Preview/preview__Layout default story and verify:

    • The controls panel shows density and size.
    • Changing density updates the rendered <cds-layout> context.
    • Changing size updates the rendered <cds-layout> context.
    • The control behavior matches the React story.
  6. Run the focused tests and checks:

    yarn jest packages/react/src/components/Layout/__tests__/Layout-test.js --runInBand
    yarn workspace @carbon/web-components exec web-test-runner src/components/layout/__tests__/layout-test.js --node-resolve --concurrency=1
    yarn prettier --check packages/react/src/components/Layout/Layout.stories.js packages/web-components/src/components/layout/layout.stories.ts
    

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

@Subhom1
Subhom1 requested a review from a team as a code owner August 17, 2026 23:06
@Subhom1
Subhom1 requested review from makafsal and maradwan26 August 17, 2026 23:06
@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit e36cf15
🔍 Latest deploy log https://app.netlify.com/projects/v3-carbon-web-components/deploys/6a8393f311e85300088f333f
😎 Deploy Preview https://deploy-preview-23041--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 17, 2026

Copy link
Copy Markdown

Deploy Preview for v2-carbon-react ready!

Name Link
🔨 Latest commit e36cf15
🔍 Latest deploy log https://app.netlify.com/projects/v2-carbon-react/deploys/6a8393f311e85300088f333d
😎 Deploy Preview https://deploy-preview-23041--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 17, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e36cf15
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a8393f352a56200087caee1
😎 Deploy Preview https://deploy-preview-23041--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 17, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit e36cf15
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a8393f31d71f600080792e6
😎 Deploy Preview https://deploy-preview-23041--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 17, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit e36cf15
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a8393f3e7b336000933b0a2
😎 Deploy Preview https://deploy-preview-23041--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 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.81%. Comparing base (7373f58) to head (e36cf15).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #23041   +/-   ##
=======================================
  Coverage   89.81%   89.81%           
=======================================
  Files         614      614           
  Lines       55161    55161           
  Branches     7863     7863           
=======================================
  Hits        49541    49541           
  Misses       5474     5474           
  Partials      146      146           
Flag Coverage Δ
main-packages 87.90% <ø> (ø)
web-components 90.49% <ø> (+<0.01%) ⬆️

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.

[preview__Layout]: add controls args to every story

1 participant