Skip to content

UI: Add padding for ArgsTable shadow in TabbedArgsTable#33034

Merged
yannbf merged 1 commit into
nextfrom
a11y/tabbed-argstable-cropped-shadow
Nov 25, 2025
Merged

UI: Add padding for ArgsTable shadow in TabbedArgsTable#33034
yannbf merged 1 commit into
nextfrom
a11y/tabbed-argstable-cropped-shadow

Conversation

@Sidnioulz
Copy link
Copy Markdown
Contributor

@Sidnioulz Sidnioulz commented Nov 12, 2025

What I did

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

This one is opinionated. I cannot realistically remove the overflow: hidden that causes the shadow cropping, as TabPanel now has support for a ScrollArea, implying a vertical overflow-y: scroll, and so that overflow-x: visible is impossible to achieve.

Considering the impact here, and the benefits of natively supporting scrolling in TabPanels, I propose to just add enough padding for the shadow to render well. Alternatively, we could also just drop the shadow.

@MichaelArestad let me know what you think please!

Checklist for Contributors

Testing

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

  • stories

Manual testing

http://localhost:6006/?path=/story/addons-docs-blocks-blocks-controls--subcomponents-of-story

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
    • Improved horizontal padding for the Arguments Table when shown inside tab panels: horizontal spacing is increased in that context to improve visual alignment and readability while keeping the compact layout elsewhere.

✏️ Tip: You can customize this high-level summary in your review settings.

@Sidnioulz Sidnioulz added ui maintenance User-facing maintenance tasks block: argstable ci:normal Run our default set of CI jobs (choose this for most PRs). labels Nov 12, 2025
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Nov 12, 2025

View your CI Pipeline Execution ↗ for commit 9ff887c

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

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 12, 2025

📝 Walkthrough

Walkthrough

TableWrapper in ArgsTable now computes a CSS paddingInline value: it is set to 3 when inTabPanel is true, otherwise 0. No other behavioral or public API changes were introduced.

Changes

Cohort / File(s) Summary
TableWrapper paddingInline computation
code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx
Added conditional CSS computation for paddingInline on TableWrapper: 3 when inTabPanel === true, otherwise 0. No other codepaths or exported declarations were changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the inTabPanel condition is the intended trigger.
  • Confirm paddingInline: 3 matches design tokens/spacing expectations.
  • Check cross-browser support for padding-inline where relevant.
✨ Finishing touches
  • 📝 Generate docstrings

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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx (1)

109-109: Effective fix for the cropped shadow issue.

The 3px horizontal padding correctly accommodates the drop-shadow filter's 3px blur radius (lines 121-122), allowing the shadow to render properly despite the TabPanel's overflow: hidden constraint. Consider adding a brief inline comment explaining that the value matches the shadow blur radius, which would help future maintainers understand the relationship.

-    paddingInline: inTabPanel ? 3 : 0,
+    paddingInline: inTabPanel ? 3 : 0, // Matches drop-shadow blur radius to prevent cropping
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0e575e and 94fcff5.

📒 Files selected for processing (1)
  • code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx
⏰ 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). (2)
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (1)
code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx (1)

20-25: Inconsistent AI summary.

The AI-generated summary claims the TableWrapper props type now includes paddingInline?: number, but the props type remains unchanged. The paddingInline added on line 109 is a computed CSS property, not a component prop.

@storybook-app-bot
Copy link
Copy Markdown

storybook-app-bot Bot commented Nov 12, 2025

Package Benchmarks

Commit: 9ff887c, ran on 25 November 2025 at 14:01:15 UTC

No significant changes detected, all good. 👏

@github-actions github-actions Bot added the Stale label Nov 25, 2025
@Sidnioulz Sidnioulz force-pushed the a11y/tabbed-argstable-cropped-shadow branch from 94fcff5 to 9ff887c Compare November 25, 2025 13:52
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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx (1)

109-109: Consider documenting the magic number.

The value 3 (theme units) is used without explanation. Consider adding a brief comment explaining why this specific value was chosen for the shadow padding.

-    paddingInline: inTabPanel ? 3 : 0,
+    // Padding to prevent shadow cropping in tab panels (3 theme units ≈ 24px)
+    paddingInline: inTabPanel ? 3 : 0,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94fcff5 and 9ff887c.

📒 Files selected for processing (1)
  • code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx,mjs}

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

Use camelCase for variable and function names

Files:

  • code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx
**/*.{ts,tsx}

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

**/*.{ts,tsx}: Enable TypeScript strict mode
Export functions from modules for testing purposes

Files:

  • code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx
**/*.{ts,tsx,js,jsx,json,html,mjs}

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

**/*.{ts,tsx,js,jsx,json,html,mjs}: Use ESLint and Prettier for code style enforcement
Run 'yarn prettier --write ' to format code after making changes
Run 'yarn lint:js:cmd ' to check for ESLint issues after making changes

Files:

  • code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx
code/**/!(*.test).{ts,tsx,js,mjs}

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

code/**/!(*.test).{ts,tsx,js,mjs}: Use 'logger' from 'storybook/internal/node-logger' for server-side (Node.js) logging, not console.log/console.warn/console.error
Use 'logger' from 'storybook/internal/client-logger' for client-side (browser) logging, not console.log/console.warn/console.error
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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.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/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx
⏰ 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). (2)
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (1)
code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx (1)

109-109: No changes required; the code fix is sound and follows established patterns.

The paddingInline: 3 addition correctly provides horizontal breathing room for the drop-shadow filter on tbody (0px horizontal offset, 3px blur radius). This parallels the existing conditional marginInline logic on line 108 and applies only when inTabPanel is true. The theme unit value (3 ≈ 24px) provides ample clearance for the shadow to render fully without clipping.

The TabPanel's overflowY: hidden only constrains vertical overflow and does not affect the horizontal shadow rendering, making the horizontal padding the appropriate fix for this context.

@yannbf yannbf merged commit 53486ac into next Nov 25, 2025
67 checks passed
@yannbf yannbf deleted the a11y/tabbed-argstable-cropped-shadow branch November 25, 2025 16:35
@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

Labels

block: argstable ci:normal Run our default set of CI jobs (choose this for most PRs). maintenance User-facing maintenance tasks Stale ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants