Refactor resizable handle styles and update preview layout#88
Refactor resizable handle styles and update preview layout#88HUmnanANirudh wants to merge 2 commits into
Conversation
…o persistent declarative configuration
…ghts instead of fixed dimensions
|
@HUmnanANirudh is attempting to deploy a commit to the OSS Program SmoothUI Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughRefactors ChangesPreview Panel Declarative Sizing Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 2
🤖 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.
Inline comments:
In `@apps/docs/components/preview/content.tsx`:
- Around line 157-160: The defaultLayout prop is using an object with string
panel IDs as keys (preview-panel and spacer-panel), but react-resizable-panels
requires numeric array format. Replace the object layout structure with a
numeric array that contains the panel sizes in order. Additionally, locate line
178 where minSize is specified as a string and convert it to a numeric value, as
the library only accepts numeric sizes. Ensure both the defaultLayout and any
minSize props use numbers instead of strings or objects.
In `@packages/shadcn-ui/components/ui/resizable.tsx`:
- Line 44: The ResizeHandle component at line 44 in the resizable.tsx file has
hard-coded styling for horizontal separators using w-2, cursor-col-resize, and a
vertical pseudo-hitbox (after:inset-y-0). The className needs to be made
conditional based on the panel group orientation such that horizontal panels use
the existing styling but vertical panels switch to h-2, cursor-row-resize, and a
horizontal pseudo-hitbox (after:inset-x-0). Determine the panel orientation from
the component's context or props and conditionally apply the appropriate class
combinations.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 22082708-5cf1-4519-a582-7883fccb3b0c
📒 Files selected for processing (3)
apps/docs/components/preview/content.tsxapps/docs/components/preview/shell.tsxpackages/shadcn-ui/components/ui/resizable.tsx
|
@educlopez Whenever you get a chance, could you take a look and let me know if there’s anything else I should change? happy to make changes if needed. |
|
I've been working on a redesign for a few weeks now, and that specific issue has already been fixed. I'm leaving this PR open in case any parts of the redesign can leverage your changes. |
Summary
Fixes the preview panel's responsive size toggling (desktop/tablet/mobile) which was broken due to imperative resize calls failing silently, and eliminates the blank space that appeared below component previews due to a rigid fixed-height layout chain.
Demo
Before
2026-06-16.20-20-03.mp4
After
2026-06-16.20-22-50.mp4
Summary by CodeRabbit