Skip to content

UI: Fix regression on addon panel empty content fontsize#33021

Merged
yannbf merged 4 commits into
nextfrom
a11y/addon-panel-font-size
Nov 25, 2025
Merged

UI: Fix regression on addon panel empty content fontsize#33021
yannbf merged 4 commits into
nextfrom
a11y/addon-panel-font-size

Conversation

@Sidnioulz
Copy link
Copy Markdown
Member

@Sidnioulz Sidnioulz commented Nov 12, 2025

What I did

https://www.chromatic.com/test?appId=635781f3500dd2c49e189caf&id=6913769e99ba81e2674e541c

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Style
    • Footer in tabs now renders inside a styled wrapper only when provided, improving layout consistency and visual presentation.
    • Addon panel typography now adapts to the active theme with a responsive font size for better visual harmony across themes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 12, 2025

📝 Walkthrough

Walkthrough

Two styling-only changes: EmptyTabContent now conditionally wraps provided footer content in an internal Footer styled component; addon-panel replaces a static root style with a theme-aware function to derive fontSize from theme.typography.size.s2 - 1.

Changes

Cohort / File(s) Summary
Tabs footer wrapper
code/core/src/components/components/Tabs/EmptyTabContent.tsx
Adds an internal Footer styled component and renders the footer prop inside that wrapper only when footer is provided (conditional rendering). No public API changes.
Theme-aware addon panel
code/core/src/components/components/addon-panel/addon-panel.tsx
Converts the root Div from a static style object to a function-style styled.div(({ theme }) => ({})), deriving fontSize from theme.typography.size.s2 - 1 while preserving existing height and layout. No public API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Check EmptyTabContent.tsx for correct conditional rendering and styled-component scope.
  • Verify addon-panel.tsx theme usage and that theme.typography.size.s2 exists and yields expected units.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0d3da9 and 860e8e8.

📒 Files selected for processing (1)
  • code/core/src/components/components/Tabs/EmptyTabContent.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{js,jsx,json,html,ts,tsx,mjs}: Run Prettier formatting on changed files before committing
Run ESLint on changed files and fix all errors/warnings before committing (use yarn lint:js:cmd <file>)

Files:

  • code/core/src/components/components/Tabs/EmptyTabContent.tsx
**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Export functions from modules when they need to be unit-tested

Files:

  • code/core/src/components/components/Tabs/EmptyTabContent.tsx
code/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

In application code, use Storybook loggers instead of console.* (client code: storybook/internal/client-logger; server code: storybook/internal/node-logger)

Files:

  • code/core/src/components/components/Tabs/EmptyTabContent.tsx
{code/**,scripts/**}/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • code/core/src/components/components/Tabs/EmptyTabContent.tsx
🧠 Learnings (1)
📓 Common learnings
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: normal
  • GitHub Check: Danger JS
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (2)
code/core/src/components/components/Tabs/EmptyTabContent.tsx (2)

30-32: LGTM: Consistent font size applied to footer.

The new Footer styled component correctly applies fontSize: theme.typography.size.s2 - 1, matching the font size used in Title and Description. This fixes the regression while keeping the styling minimal, allowing footer content to control its own alignment and color properties.


54-54: LGTM: Correct conditional rendering pattern.

The footer is now properly wrapped in the Footer styled component only when content is provided. This ensures the font size styling is applied while avoiding an empty div in the DOM when no footer is present.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
code/core/src/components/components/Tabs/EmptyTabContent.tsx (1)

54-54: Consider conditional rendering for consistency.

The footer prop is always wrapped in the Footer component, even when undefined, which will render an empty <div> in the DOM. For consistency with how description is handled on line 52, consider conditional rendering.

Apply this diff to match the pattern used for description:

-      <Footer>{footer}</Footer>
+      {footer && <Footer>{footer}</Footer>}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a6dc2e and a0d3da9.

📒 Files selected for processing (2)
  • code/core/src/components/components/Tabs/EmptyTabContent.tsx (2 hunks)
  • code/core/src/components/components/addon-panel/addon-panel.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{js,jsx,json,html,ts,tsx,mjs}: Run Prettier formatting on changed files before committing
Run ESLint on changed files and fix all errors/warnings before committing (use yarn lint:js:cmd <file>)

Files:

  • code/core/src/components/components/Tabs/EmptyTabContent.tsx
  • code/core/src/components/components/addon-panel/addon-panel.tsx
**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Export functions from modules when they need to be unit-tested

Files:

  • code/core/src/components/components/Tabs/EmptyTabContent.tsx
  • code/core/src/components/components/addon-panel/addon-panel.tsx
code/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

In application code, use Storybook loggers instead of console.* (client code: storybook/internal/client-logger; server code: storybook/internal/node-logger)

Files:

  • code/core/src/components/components/Tabs/EmptyTabContent.tsx
  • code/core/src/components/components/addon-panel/addon-panel.tsx
{code/**,scripts/**}/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • code/core/src/components/components/Tabs/EmptyTabContent.tsx
  • code/core/src/components/components/addon-panel/addon-panel.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.
📚 Learning: 2025-09-19T15:49:02.264Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32270
File: code/core/src/components/components/AriaTabs/AriaTabPanel.tsx:27-30
Timestamp: 2025-09-19T15:49:02.264Z
Learning: In AriaTabPanel component, when hasScrollbar=false, the Panel container intentionally maintains overflowY: hidden. This forces consumers to implement their own scrolling within tab content rather than relying on automatic browser scrolling, preventing double scrollbars and giving full control over scroll behavior.

Applied to files:

  • code/core/src/components/components/addon-panel/addon-panel.tsx
🧬 Code graph analysis (1)
code/core/src/components/components/addon-panel/addon-panel.tsx (1)
code/core/src/components/index.ts (1)
  • Div (10-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Danger JS
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (2)
code/core/src/components/components/Tabs/EmptyTabContent.tsx (1)

30-32: LGTM! Footer component applies theme-based font size.

The new Footer styled component correctly applies the theme-based font size (theme.typography.size.s2 - 1), fixing the regression. The minimal styling (only fontSize) provides flexibility for footer content to supply its own color, weight, and alignment.

code/core/src/components/components/addon-panel/addon-panel.tsx (1)

31-34: LGTM! Theme-based font size correctly applied.

The Div styled component now derives fontSize from the theme (theme.typography.size.s2 - 1), fixing the regression. The implementation is consistent with the pattern used in EmptyTabContent.tsx and preserves the height: '100%' styling.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Nov 12, 2025

View your CI Pipeline Execution ↗ for commit 651e0d6

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 43s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-25 14:48:52 UTC

@storybook-app-bot
Copy link
Copy Markdown

storybook-app-bot Bot commented Nov 12, 2025

Package Benchmarks

Commit: 860e8e8, ran on 12 November 2025 at 16:38:36 UTC

The following packages have significant changes to their size or dependencies:

@storybook/addon-a11y

Before After Difference
Dependency count 2 2 0
Self size 414 KB 479 KB 🚨 +65 KB 🚨
Dependency size 2.97 MB 2.97 MB 0 B
Bundle Size Analyzer Link Link

@storybook/addon-docs

Before After Difference
Dependency count 18 18 0
Self size 1.65 MB 1.89 MB 🚨 +234 KB 🚨
Dependency size 10.21 MB 10.21 MB 🚨 +5 KB 🚨
Bundle Size Analyzer Link Link

@storybook/addon-onboarding

Before After Difference
Dependency count 0 0 0
Self size 326 KB 368 KB 🚨 +42 KB 🚨
Dependency size 673 B 673 B 0 B
Bundle Size Analyzer Link Link

storybook-addon-pseudo-states

Before After Difference
Dependency count 0 0 0
Self size 21 KB 23 KB 🚨 +2 KB 🚨
Dependency size 692 B 692 B 0 B
Bundle Size Analyzer Link Link

@storybook/addon-vitest

Before After Difference
Dependency count 6 6 0
Self size 442 KB 508 KB 🚨 +67 KB 🚨
Dependency size 1.53 MB 1.53 MB 0 B
Bundle Size Analyzer Link Link

@storybook/builder-vite

Before After Difference
Dependency count 11 11 0
Self size 292 KB 330 KB 🚨 +38 KB 🚨
Dependency size 1.30 MB 1.30 MB 🚨 +1 KB 🚨
Bundle Size Analyzer Link Link

@storybook/builder-webpack5

Before After Difference
Dependency count 187 187 0
Self size 66 KB 73 KB 🚨 +6 KB 🚨
Dependency size 31.88 MB 31.87 MB 🎉 -17 KB 🎉
Bundle Size Analyzer Link Link

storybook

Before After Difference
Dependency count 44 44 0
Self size 21.64 MB 24.16 MB 🚨 +2.53 MB 🚨
Dependency size 17.39 MB 17.39 MB 0 B
Bundle Size Analyzer Link Link

@storybook/angular

Before After Difference
Dependency count 187 187 0
Self size 114 KB 126 KB 🚨 +12 KB 🚨
Dependency size 30.01 MB 30.00 MB 🎉 -11 KB 🎉
Bundle Size Analyzer Link Link

@storybook/ember

Before After Difference
Dependency count 191 191 0
Self size 15 KB 17 KB 🚨 +1 KB 🚨
Dependency size 28.60 MB 28.58 MB 🎉 -11 KB 🎉
Bundle Size Analyzer Link Link

@storybook/html-vite

Before After Difference
Dependency count 14 14 0
Self size 22 KB 23 KB 🚨 +910 B 🚨
Dependency size 1.63 MB 1.67 MB 🚨 +40 KB 🚨
Bundle Size Analyzer Link Link

@storybook/nextjs

Before After Difference
Dependency count 533 533 0
Self size 646 KB 749 KB 🚨 +103 KB 🚨
Dependency size 58.80 MB 58.91 MB 🚨 +112 KB 🚨
Bundle Size Analyzer Link Link

@storybook/nextjs-vite

Before After Difference
Dependency count 124 124 0
Self size 1.12 MB 1.27 MB 🚨 +154 KB 🚨
Dependency size 21.71 MB 21.87 MB 🚨 +162 KB 🚨
Bundle Size Analyzer Link Link

@storybook/preact-vite

Before After Difference
Dependency count 14 14 0
Self size 13 KB 14 KB 🚨 +983 B 🚨
Dependency size 1.61 MB 1.65 MB 🚨 +40 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 156 156 0
Self size 30 KB 31 KB 🚨 +1 KB 🚨
Dependency size 22.89 MB 23.05 MB 🚨 +162 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-vite

Before After Difference
Dependency count 114 114 0
Self size 35 KB 37 KB 🚨 +2 KB 🚨
Dependency size 19.51 MB 19.67 MB 🚨 +161 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-webpack5

Before After Difference
Dependency count 273 273 0
Self size 24 KB 25 KB 🚨 +1 KB 🚨
Dependency size 43.76 MB 43.87 MB 🚨 +112 KB 🚨
Bundle Size Analyzer Link Link

@storybook/svelte-vite

Before After Difference
Dependency count 19 19 0
Self size 56 KB 59 KB 🚨 +3 KB 🚨
Dependency size 26.75 MB 26.79 MB 🚨 +42 KB 🚨
Bundle Size Analyzer Link Link

@storybook/sveltekit

Before After Difference
Dependency count 20 20 0
Self size 56 KB 58 KB 🚨 +2 KB 🚨
Dependency size 26.80 MB 26.85 MB 🚨 +45 KB 🚨
Bundle Size Analyzer Link Link

@storybook/vue3-vite

Before After Difference
Dependency count 109 109 0
Self size 36 KB 38 KB 🚨 +3 KB 🚨
Dependency size 43.90 MB 43.95 MB 🚨 +45 KB 🚨
Bundle Size Analyzer Link Link

@storybook/web-components-vite

Before After Difference
Dependency count 15 15 0
Self size 19 KB 20 KB 🚨 +910 B 🚨
Dependency size 1.65 MB 1.70 MB 🚨 +41 KB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 188 188 0
Self size 829 KB 929 KB 🚨 +100 KB 🚨
Dependency size 71.51 MB 74.14 MB 🚨 +2.63 MB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 170 170 0
Self size 30 KB 35 KB 🚨 +5 KB 🚨
Dependency size 68.04 MB 70.57 MB 🚨 +2.53 MB 🚨
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 45 45 0
Self size 1.45 MB 1.55 MB 🚨 +96 KB 🚨
Dependency size 39.03 MB 41.55 MB 🚨 +2.53 MB 🚨
Bundle Size Analyzer node node

@storybook/csf-plugin

Before After Difference
Dependency count 9 9 0
Self size 8 KB 9 KB 🚨 +1 KB 🚨
Dependency size 1.27 MB 1.27 MB 0 B
Bundle Size Analyzer Link Link

@storybook/react-dom-shim

Before After Difference
Dependency count 0 0 0
Self size 19 KB 22 KB 🚨 +3 KB 🚨
Dependency size 791 B 791 B 0 B
Bundle Size Analyzer Link Link

@storybook/preset-create-react-app

Before After Difference
Dependency count 68 68 0
Self size 33 KB 36 KB 🚨 +4 KB 🚨
Dependency size 5.98 MB 5.98 MB 0 B
Bundle Size Analyzer Link Link

@storybook/preset-react-webpack

Before After Difference
Dependency count 170 170 0
Self size 18 KB 21 KB 🚨 +2 KB 🚨
Dependency size 31.20 MB 31.20 MB 🚨 +1 KB 🚨
Bundle Size Analyzer Link Link

@storybook/preset-server-webpack

Before After Difference
Dependency count 10 10 0
Self size 7 KB 8 KB 🚨 +2 KB 🚨
Dependency size 1.20 MB 1.20 MB 🚨 +1 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react

Before After Difference
Dependency count 57 57 0
Self size 715 KB 833 KB 🚨 +118 KB 🚨
Dependency size 12.92 MB 12.92 MB 🚨 +3 KB 🚨
Bundle Size Analyzer Link Link

@storybook/vue3

Before After Difference
Dependency count 3 3 0
Self size 55 KB 61 KB 🚨 +6 KB 🚨
Dependency size 211 KB 211 KB 0 B
Bundle Size Analyzer Link Link

@github-actions github-actions Bot added the Stale label Nov 25, 2025
@yannbf yannbf merged commit df9dc9d into next Nov 25, 2025
4 of 5 checks passed
@yannbf yannbf deleted the a11y/addon-panel-font-size branch November 25, 2025 14:29
@github-actions github-actions Bot mentioned this pull request Nov 25, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants