Skip to content

fix(sidebar): add min-w-0 to SidebarInset#1747

Open
rogelioRuiz wants to merge 2 commits intounovue:devfrom
rogelioRuiz:fix/sidebar-inset-min-width
Open

fix(sidebar): add min-w-0 to SidebarInset#1747
rogelioRuiz wants to merge 2 commits intounovue:devfrom
rogelioRuiz:fix/sidebar-inset-min-width

Conversation

@rogelioRuiz
Copy link
Copy Markdown
Contributor

@rogelioRuiz rogelioRuiz commented Apr 2, 2026

Summary

  • Add min-w-0 to SidebarInset in both bases/reka and new-york-v4 variants
  • SidebarInset is a flex child of the sidebar wrapper but lacks min-w-0, so it never shrinks below its content's intrinsic width
  • This causes wide content (code blocks, tables, long text) inside the inset area to overflow the viewport horizontally

Test plan

  • Render a sidebar layout with SidebarInset containing wide content (e.g. a <pre> block or markdown table wider than the viewport)
  • Verify content is constrained within the inset area and doesn't cause horizontal page overflow
  • Toggle sidebar expanded/collapsed — no overflow in either state

Summary by CodeRabbit

Release Notes

  • New Features

    • Added "Luma," a new visual style with a fluid, luminous, and glassy design theme available across UI components.
    • Added "Luma" preset, combining the Reka base with Lucide icons and Inter font for complete design system configuration.
  • Improvements

    • Fixed sidebar component layout to prevent content overflow in flex containers.

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
CSS & Theme Styling
apps/v4/assets/css/main.css, apps/v4/registry/styles/style-luma.css, apps/v4/registry/styles.ts
Added luma style theme with Tailwind variant, new 1325-line comprehensive stylesheet with .style-luma namespace defining UI component classes (slider, switch, checkbox, buttons, inputs, dialogs, etc.) using data/aria selectors and dark-mode variants, and registered luma entry in STYLES array.
Registry Configuration
apps/v4/registry/config.ts, packages/cli/src/registry/constants.ts
Added reka-luma preset configuration with base "reka", style "luma", and default theme/icon/font settings; registered luma as visual style in CLI constants.
Component Layout
apps/v4/registry/bases/reka/ui/sidebar/SidebarInset.vue, apps/v4/registry/new-york-v4/ui/sidebar/SidebarInset.vue
Added min-w-0 class to <main> element flex layout in both SidebarInset components for improved flex sizing/clipping behavior.
CLI Style Resolution & Transformation
packages/cli/src/registry/config.ts, packages/cli/src/registry/resolver.ts, packages/cli/src/utils/transformers/transform-style.ts
Updated VISUAL_STYLES to include luma; refactored resolver to use centralized resolveRegistryStyle() function; enhanced transformStyle to accept and traverse script ASTs alongside templates, added applyClassMappings() helper and dynamic :class binding transformation with recursive expression handling for string/template-literal rewriting.
Test Coverage
packages/cli/test/utils/...*
Added test cases for luma style retrieval, preset lookup, registry resolution, and border-radius class mapping transformations (rounded-sm→rounded-xl, rounded-md→rounded-2xl, etc.).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A luminous style hops into view,
Luma brings a glassy, fluid hue,
Rounded corners smooth as morning dew,
New presets gleam—there's so much that's new! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'fix(sidebar): add min-w-0 to SidebarInset' accurately describes one of the two commits, but the PR includes substantial additional changes (addition of the entire Luma visual style) that represent the majority of the changeset and are not reflected in the title. Consider updating the PR title to reflect the primary change (e.g., 'feat: add Luma visual style support') or splitting into separate PRs, as the Luma style addition significantly outweighs the SidebarInset fix in scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5187a30 and 05af093.

📒 Files selected for processing (13)
  • apps/v4/assets/css/main.css
  • apps/v4/registry/bases/reka/ui/sidebar/SidebarInset.vue
  • apps/v4/registry/config.ts
  • apps/v4/registry/new-york-v4/ui/sidebar/SidebarInset.vue
  • apps/v4/registry/styles.ts
  • apps/v4/registry/styles/style-luma.css
  • packages/cli/src/registry/config.ts
  • packages/cli/src/registry/constants.ts
  • packages/cli/src/registry/resolver.ts
  • packages/cli/src/utils/transformers/transform-style.ts
  • packages/cli/test/utils/registry-api.test.ts
  • packages/cli/test/utils/registry-config.test.ts
  • packages/cli/test/utils/transform-style.test.ts

Comment on lines 491 to +493
const style = config.resolvedPaths?.cwd
? await getTargetStyleFromConfig(config.resolvedPaths.cwd, config.style)
: config.style
: resolveRegistryStyle(config.style)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

@zernonia
Copy link
Copy Markdown
Member

zernonia commented Apr 2, 2026

@rogelioRuiz Thanks for the PR! I've merged the Luma changes and can you rebase this branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants