chore(fuselage): skip breakpoints without minimum width in Storybook viewports by MYMISERABLEMIND17 · Pull Request #42996 · RocketChat/Rocket.Chat · GitHub
Skip to content

chore(fuselage): skip breakpoints without minimum width in Storybook viewports - #42996

Open
MYMISERABLEMIND17 wants to merge 1 commit into
RocketChat:developfrom
MYMISERABLEMIND17:chore/fuselage-storybook-xs-viewport-42791
Open

MYMISERABLEMIND17 wants to merge 1 commit into
RocketChat:developfrom
MYMISERABLEMIND17:chore/fuselage-storybook-xs-viewport-42791

Conversation

@MYMISERABLEMIND17

@MYMISERABLEMIND17 MYMISERABLEMIND17 commented Oct 21, 2026 •

Copy link
Copy Markdown

Closes #42791

Proposed changes

The xs breakpoint token in @rocket.chat/fuselage defines minViewportWidth as null, causing Storybook's viewport addon in .storybook/preview.tsx to construct an invalid nullpx width.

Filtering out breakpoint entries where minViewportWidth == null ensures only valid, functional viewport presets (sm and above) are exposed in the Storybook toolbar, preventing the preview iframe from collapsing or rendering invalid styles.

Verification

  • Verified viewport mappings locally in packages/fuselage/.storybook/preview.tsx.
  • Confirmed breakpointTokens without minViewportWidth are excluded while sm, md, lg, xl retain their respective pixel bounds.

View guided diff

Summary by CodeRabbit

  • Bug Fixes
    • Fixed Storybook viewport generation to ignore breakpoints without a defined minimum width.
    • Preserved valid desktop viewport dimensions and settings for supported breakpoints.

…viewports

The xs breakpoint token defines minViewportWidth as null, causing Storybook to construct an invalid width: 'nullpx' viewport. Skipping breakpoints without a minimum width prevents invalid viewport styles and keeps Storybook viewport presets clean.

Closes RocketChat#42791
@dionisio-bot

dionisio-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b8ba920-271b-4b46-92c7-784a45292499
📥 Commits

Reviewing files that changed from the base of the PR and between 5d5840c and b76c545.

📒 Files selected for processing: 1
  • packages/fuselage/.storybook/preview.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
🔇 Additional comments: 1
packages/fuselage/.storybook/preview.tsx: 1

34-46: LGTM!

Walkthrough

The Storybook viewport configuration now excludes breakpoints with a null minViewportWidth before creating desktop viewport definitions. Other breakpoints retain their generated settings.

Changes

Storybook viewport configuration

Layer / File(s) Summary
Filter breakpoints before viewport creation
packages/fuselage/.storybook/preview.tsx
The configuration filters out breakpoints with a null minViewportWidth before mapping the remaining breakpoints to desktop viewports.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested labels: type: bug

Suggested reviewers: tassoevan

Merge Risk: ⚪ Minimal · up to b76c5

The invalid nullpx viewport is addressed without affecting valid breakpoint presets.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: skipping breakpoints without a minimum width in Storybook viewport generation.
Linked Issues check Passed Issue #42791 requires preventing an invalid nullpx Storybook viewport for the xs breakpoint. In packages/fuselage/.storybook/preview.tsx, the viewport generation now filters entries with `minVie…
Out of Scope Changes check Passed The reviewed change is limited to the Storybook viewport generation in packages/fuselage/.storybook/preview.tsx. The filter and the related mapping reformat directly support issue #42791. No unrelat…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Linked Issues check

Explanation

Issue #42791 requires preventing an invalid nullpx Storybook viewport for the xs breakpoint. In packages/fuselage/.storybook/preview.tsx, the viewport generation now filters entries with minViewportWidth != null before mapping them to viewport definitions. This preserves valid breakpoint widths and excludes xs. The issue does not require a specific automated test.

Full details: Out of Scope Changes check

Explanation

The reviewed change is limited to the Storybook viewport generation in packages/fuselage/.storybook/preview.tsx. The filter and the related mapping reformat directly support issue #42791. No unrelated change is shown.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Errors were encountered while retrieving linked issues.

Errors: 1
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

View guided diff | Re-trigger cubic

@CLAassistant

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(fuselage): Storybook xs viewport gets an invalid nullpx width

2 participants