fix(sidebar): add min-w-0 to SidebarInset#1747
fix(sidebar): add min-w-0 to SidebarInset#1747rogelioRuiz wants to merge 2 commits intounovue:devfrom
Conversation
Ports the Luma style ("Fluid, luminous, and glassy") from upstream
shadcn/ui v4.1.2 to shadcn-vue. Adds style-luma.css with Vue-specific
adaptations, CLI class transform mappings, style/preset registrations,
and corresponding test coverage.
SidebarInset is a flex child of the sidebar wrapper but lacks min-w-0, so it never shrinks below its content intrinsic width. This causes wide content (code blocks, tables, markdown) to overflow the viewport horizontally.
📝 WalkthroughWalkthroughThis PR introduces a new "luma" visual style to the design system. The addition includes comprehensive CSS theming rules, Tailwind variant configuration, registry and CLI configuration entries, style class transformation logic with AST traversal, and corresponding test coverage. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 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
🤖 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/cli/src/registry/resolver.ts`:
- Around line 491-493: Compute the resolved visual style first using
resolveRegistryStyle(config.style) and then pass that resolved value into
getTargetStyleFromConfig when config.resolvedPaths?.cwd is present; i.e., call
resolveRegistryStyle(config.style) to produce a resolvedStyle, and then use
await getTargetStyleFromConfig(config.resolvedPaths.cwd, resolvedStyle) for the
cwd branch (otherwise return resolvedStyle). This ensures
getTargetStyleFromConfig receives the fallback-mapped style instead of the raw
config.style.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 51564a4b-0dcb-4dd4-bc7a-14cf3afc60ab
📒 Files selected for processing (13)
apps/v4/assets/css/main.cssapps/v4/registry/bases/reka/ui/sidebar/SidebarInset.vueapps/v4/registry/config.tsapps/v4/registry/new-york-v4/ui/sidebar/SidebarInset.vueapps/v4/registry/styles.tsapps/v4/registry/styles/style-luma.csspackages/cli/src/registry/config.tspackages/cli/src/registry/constants.tspackages/cli/src/registry/resolver.tspackages/cli/src/utils/transformers/transform-style.tspackages/cli/test/utils/registry-api.test.tspackages/cli/test/utils/registry-config.test.tspackages/cli/test/utils/transform-style.test.ts
| const style = config.resolvedPaths?.cwd | ||
| ? await getTargetStyleFromConfig(config.resolvedPaths.cwd, config.style) | ||
| : config.style | ||
| : resolveRegistryStyle(config.style) |
There was a problem hiding this comment.
Use resolved visual style before getTargetStyleFromConfig.
Line 492 currently passes raw config.style; in Tailwind v3 this can keep luma and generate styles/luma/*.json paths, which diverges from the fallback mapping used elsewhere.
💡 Suggested fix
- const style = config.resolvedPaths?.cwd
- ? await getTargetStyleFromConfig(config.resolvedPaths.cwd, config.style)
- : resolveRegistryStyle(config.style)
+ const resolvedStyle = resolveRegistryStyle(config.style)
+ const style = config.resolvedPaths?.cwd
+ ? await getTargetStyleFromConfig(config.resolvedPaths.cwd, resolvedStyle)
+ : resolvedStyle🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/cli/src/registry/resolver.ts` around lines 491 - 493, Compute the
resolved visual style first using resolveRegistryStyle(config.style) and then
pass that resolved value into getTargetStyleFromConfig when
config.resolvedPaths?.cwd is present; i.e., call
resolveRegistryStyle(config.style) to produce a resolvedStyle, and then use
await getTargetStyleFromConfig(config.resolvedPaths.cwd, resolvedStyle) for the
cwd branch (otherwise return resolvedStyle). This ensures
getTargetStyleFromConfig receives the fallback-mapped style instead of the raw
config.style.
|
@rogelioRuiz Thanks for the PR! I've merged the Luma changes and can you rebase this branch? |
Summary
min-w-0toSidebarInsetin bothbases/rekaandnew-york-v4variantsSidebarInsetis a flex child of the sidebar wrapper but lacksmin-w-0, so it never shrinks below its content's intrinsic widthTest plan
SidebarInsetcontaining wide content (e.g. a<pre>block or markdown table wider than the viewport)Summary by CodeRabbit
Release Notes
New Features
Improvements