fix(flex, FlexBox): correct rowGap and colGap behavior (DS-5394) - #443
Conversation
📝 WalkthroughWalkthroughThe flex layout now uses separate row and column gap properties. The FlexBox base styles set zero defaults. Storybook exposes controls for both gap values. ChangesFlex gap configuration
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Visit the preview URL for this PR (updated for commit c21eeee): https://react-koobiq-next--prs-443-wmjxeyzx.web.app (expires Sat, 08 Aug 2026 10:17:52 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/components/src/components/layout/flex/flex.module.css (1)
2-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover independent gap defaults in both implementations.
The fix is correct, but both paths need regression coverage for single-axis gaps.
packages/components/src/components/layout/flex/flex.module.css#L2-L3: testflex()with onlyrowGapand onlycolGap.packages/components/src/components/FlexBox/FlexBox.module.css#L2-L3: test<FlexBox>with onlyrowGapand onlycolGap.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/components/src/components/layout/flex/flex.module.css` around lines 2 - 3, Maintain the independent zero defaults for row and column gaps, and add regression tests for both implementations: in packages/components/src/components/layout/flex/flex.module.css at lines 2-3, test flex() with only rowGap and only colGap; in packages/components/src/components/FlexBox/FlexBox.module.css at lines 2-3, test FlexBox with only rowGap and only colGap.Source: Learnings
packages/components/src/components/layout/flex/flex.stories.tsx (1)
66-81: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid manual
argTypesfor inferred props.
colGapandrowGapare component props. The repository rules prohibit addingargTypesfor props inferred from component types. Remove these entries if Storybook infersFlexPropGap; otherwise, confirm the approved local pattern for this exception.As per coding guidelines,
packages/components/src/components/**/*.stories.tsxmust not addargTypesfor props inferred from component types.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/components/src/components/layout/flex/flex.stories.tsx` around lines 66 - 81, Remove the manually defined colGap and rowGap entries from the story’s argTypes configuration, allowing Storybook to infer these component props from the Flex component type and preserving the repository guideline against manual inferred-prop definitions.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/components/src/components/layout/flex/flex.module.css`:
- Around line 2-3: Maintain the independent zero defaults for row and column
gaps, and add regression tests for both implementations: in
packages/components/src/components/layout/flex/flex.module.css at lines 2-3,
test flex() with only rowGap and only colGap; in
packages/components/src/components/FlexBox/FlexBox.module.css at lines 2-3, test
FlexBox with only rowGap and only colGap.
In `@packages/components/src/components/layout/flex/flex.stories.tsx`:
- Around line 66-81: Remove the manually defined colGap and rowGap entries from
the story’s argTypes configuration, allowing Storybook to infer these component
props from the Flex component type and preserving the repository guideline
against manual inferred-prop definitions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 866aeed5-bbb7-4662-9a12-ec3876846f0e
📒 Files selected for processing (3)
packages/components/src/components/FlexBox/FlexBox.module.csspackages/components/src/components/layout/flex/flex.module.csspackages/components/src/components/layout/flex/flex.stories.tsx
Summary by CodeRabbit
New Features
Bug Fixes