Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR introduces a complete Collapsible UI component to the design system, including the core React component built on Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/raystack/components/collapsible/collapsible.module.css (1)
11-15: Respect reduced-motion preferences for panel animation.Consider disabling the height transition for users who prefer reduced motion.
Suggested refinement
.panel { height: var(--collapsible-panel-height); overflow: hidden; transition: height 150ms ease-out; } + +@media (prefers-reduced-motion: reduce) { + .panel { + transition: none; + } +}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/raystack/components/collapsible/collapsible.module.css` around lines 11 - 15, The .panel CSS rule currently animates height; add a prefers-reduced-motion media query that disables the height transition for users who prefer reduced motion by overriding .panel (the same selector) to set transition: none (or remove height animation) so the panel opens/closes instantly while keeping the existing --collapsible-panel-height and overflow behavior intact.apps/www/src/content/docs/components/collapsible/props.ts (1)
1-16: Clarify controlled vs uncontrolled prop usage in docs.Please add a short note that
open(controlled) anddefaultOpen(uncontrolled) are alternative modes and should not be used together to avoid ambiguous state ownership.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/www/src/content/docs/components/collapsible/props.ts` around lines 1 - 16, Update the CollapsibleProps interface comments to clarify that open and defaultOpen are alternative modes and should not be used together: in the JSDoc for the open property (and/or at the top of the interface) add a short note stating that open is the controlled mode, defaultOpen is the uncontrolled mode, and using both at once leads to ambiguous state ownership and should be avoided; reference the CollapsibleProps interface and the open and defaultOpen property names so readers can find the guidance easily.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/raystack/components/collapsible/collapsible.module.css`:
- Around line 1-4: The .trigger rule currently removes the default keyboard
focus indicator (outline: none) which breaks accessibility; restore a visible
focus style by removing the blanket outline:none or override it with a dedicated
:focus-visible (or :focus) rule for .trigger that applies a clear high-contrast
outline or box-shadow (e.g., 2px outline or visible ring) so keyboard users can
see focus, keeping cursor: pointer intact and ensuring the focus style meets
contrast/visibility requirements for .trigger.
---
Nitpick comments:
In `@apps/www/src/content/docs/components/collapsible/props.ts`:
- Around line 1-16: Update the CollapsibleProps interface comments to clarify
that open and defaultOpen are alternative modes and should not be used together:
in the JSDoc for the open property (and/or at the top of the interface) add a
short note stating that open is the controlled mode, defaultOpen is the
uncontrolled mode, and using both at once leads to ambiguous state ownership and
should be avoided; reference the CollapsibleProps interface and the open and
defaultOpen property names so readers can find the guidance easily.
In `@packages/raystack/components/collapsible/collapsible.module.css`:
- Around line 11-15: The .panel CSS rule currently animates height; add a
prefers-reduced-motion media query that disables the height transition for users
who prefer reduced motion by overriding .panel (the same selector) to set
transition: none (or remove height animation) so the panel opens/closes
instantly while keeping the existing --collapsible-panel-height and overflow
behavior intact.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
apps/www/src/components/playground/collapsible-examples.tsxapps/www/src/components/playground/index.tsapps/www/src/content/docs/components/collapsible/demo.tsapps/www/src/content/docs/components/collapsible/index.mdxapps/www/src/content/docs/components/collapsible/props.tspackages/raystack/components/collapsible/__tests__/collapsible.test.tsxpackages/raystack/components/collapsible/collapsible.module.csspackages/raystack/components/collapsible/collapsible.tsxpackages/raystack/components/collapsible/index.tspackages/raystack/index.tsx
| .trigger { | ||
| cursor: pointer; | ||
| outline: none; | ||
| } |
There was a problem hiding this comment.
Restore visible keyboard focus styling on the trigger.
Line 3 removes the default focus indicator (outline: none) but no replacement focus style is defined, which is an accessibility blocker for keyboard users.
Suggested fix
.trigger {
cursor: pointer;
- outline: none;
}
+
+.trigger:focus-visible {
+ outline: 2px solid var(--rs-color-border-primary, currentColor);
+ outline-offset: 2px;
+}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .trigger { | |
| cursor: pointer; | |
| outline: none; | |
| } | |
| .trigger { | |
| cursor: pointer; | |
| } | |
| .trigger:focus-visible { | |
| outline: 2px solid var(--rs-color-border-primary, currentColor); | |
| outline-offset: 2px; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/raystack/components/collapsible/collapsible.module.css` around lines
1 - 4, The .trigger rule currently removes the default keyboard focus indicator
(outline: none) which breaks accessibility; restore a visible focus style by
removing the blanket outline:none or override it with a dedicated :focus-visible
(or :focus) rule for .trigger that applies a clear high-contrast outline or
box-shadow (e.g., 2px outline or visible ring) so keyboard users can see focus,
keeping cursor: pointer intact and ensuring the focus style meets
contrast/visibility requirements for .trigger.
Summary
--collapsible-panel-heightCSS variableSummary by CodeRabbit
Release Notes
New Features
Documentation