-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add shouldBlockScroll
stories
#4351
base: canary
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Warning Rate limit exceeded@ryo-manba has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 6 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe changes in this pull request introduce a new boolean property, Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (5)
packages/components/modal/stories/modal.stories.tsx (2)
Line range hint
23-51
: AddshouldBlockScroll
toargTypes
The new
shouldBlockScroll
prop should be documented in the component'sargTypes
for proper Storybook integration.argTypes: { + shouldBlockScroll: { + control: { + type: "boolean", + }, + description: "Whether to block scrolling when the modal is open", + }, size: { control: { type: "select", },
353-367
: Add JSDoc comment for the storyAdd documentation to explain the purpose and behavior of the
WithShouldBlockScroll
story.+/** + * Demonstrates the behavior of the Modal component with and without scroll blocking. + * When `shouldBlockScroll` is true, the background content cannot be scrolled while + * the modal is open. + */ export const WithShouldBlockScroll = { render: (args) => {packages/components/popover/stories/popover.stories.tsx (3)
Line range hint
13-82
: AddshouldBlockScroll
toargTypes
The new
shouldBlockScroll
prop should be documented in the component'sargTypes
for proper Storybook integration. This is a systematic issue also present in the Modal component.argTypes: { + shouldBlockScroll: { + control: { + type: "boolean", + }, + description: "Whether to block scrolling when the popover is open", + }, variant: { control: { type: "select", },
579-593
: Add JSDoc comment for the storyAdd documentation to explain the purpose and behavior of the
WithShouldBlockScroll
story.+/** + * Demonstrates the behavior of the Popover component with and without scroll blocking. + * When `shouldBlockScroll` is true, the background content cannot be scrolled while + * the popover is open. + */ export const WithShouldBlockScroll = { render: (args) => {
579-593
: Consider extracting common story patternThe
WithShouldBlockScroll
story implementation is identical across Modal and Popover components. Consider extracting this into a shared utility function to maintain consistency and reduce duplication.Example implementation:
const createScrollBlockStory = (Template) => ({ render: (args) => ( <div className="flex gap-8"> <Template {...args} shouldBlockScroll={false} /> <Template {...args} shouldBlockScroll={true} /> </div> ), args: { shouldBlockScroll: true, }, }); export const WithShouldBlockScroll = createScrollBlockStory(Template);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/components/dropdown/stories/dropdown.stories.tsx
(2 hunks)packages/components/modal/stories/modal.stories.tsx
(2 hunks)packages/components/popover/stories/popover.stories.tsx
(1 hunks)
🔇 Additional comments (3)
packages/components/dropdown/stories/dropdown.stories.tsx (3)
102-106
: LGTM! Well-structured argTypes definition
The shouldBlockScroll
property is properly defined in argTypes with the correct control type.
824-838
: LGTM! Complete implementation
The story implementation effectively demonstrates both states of the shouldBlockScroll
prop and follows the established pattern. This implementation can serve as a reference for the Modal and Popover components.
102-106
: Verify consistency across components
Let's ensure the implementation is consistent across all three components.
Also applies to: 824-838
Related to #4325
📝 Description
Story was not enough, so it was added.
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit
Summary by CodeRabbit
shouldBlockScroll
for theDropdown
,Modal
, andPopover
components, enhancing their configurability.WithShouldBlockScroll
for each component to demonstrate behavior with theshouldBlockScroll
property set to bothtrue
andfalse
.