Skip to content

fix: sidebar spacing and group margin#812

Merged
rohanchkrabrty merged 2 commits into
mainfrom
fix-sidebar-css
May 18, 2026
Merged

fix: sidebar spacing and group margin#812
rohanchkrabrty merged 2 commits into
mainfrom
fix-sidebar-css

Conversation

@rohanchkrabrty
Copy link
Copy Markdown
Contributor

Summary

  • Add gap: var(--rs-space-6) on sidebar root and remove the gap from .main so layout regions space themselves consistently.
  • Switch .header padding to 0 var(--rs-space-4) to align with the new root gap.
  • Set SidebarMain to gap={3} so items inside main use 8px spacing.
  • Add margin-top: var(--rs-space-4) (12px) to .nav-group inside .main, skipping the first child so a leading group sits flush at the top.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment May 18, 2026 10:16am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

Warning

Rate limit exceeded

@rohanchkrabrty has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 15 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: edc6392b-a332-4658-a3ed-a01695fefc1c

📥 Commits

Reviewing files that changed from the base of the PR and between e1dad5a and 77e19b9.

📒 Files selected for processing (2)
  • apps/www/src/content/docs/components/sidebar/demo.ts
  • packages/raystack/components/sidebar/sidebar-main.tsx
📝 Walkthrough

Walkthrough

This PR refactors the sidebar component's spacing and layout system across three coordinated changes. The CSS module updates define a new spacing strategy: adding gap spacing to the root container, simplifying header padding to a two-value format, removing the previous gap from the main container, and introducing margin-top spacing between consecutive navigation groups. The SidebarMain component is updated to include a gap={3} prop on its Flex element to match this new layout structure. Finally, all Sidebar demo code snippets are updated to include explicit inline padding styling within the header Flex elements, showing the updated pattern consistently across documentation examples.

Suggested reviewers

  • paanSinghCoder
  • rsbh
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: sidebar spacing and group margin' directly and accurately summarizes the main changes made to sidebar spacing and margins across multiple files.
Description check ✅ Passed The description clearly explains the four specific changes made: root gap addition, header padding adjustment, SidebarMain gap prop, and nav-group margin-top styling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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
Contributor

@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.

🧹 Nitpick comments (1)
apps/www/src/content/docs/components/sidebar/demo.ts (1)

26-26: ⚡ Quick win

Consider refactoring to avoid requiring inline styles in demos.

All demo examples now require style={{padding:"4px"}} on the Flex element inside Sidebar.Header. This pattern has several drawbacks:

  • The hardcoded "4px" doesn't reference design system tokens, creating potential inconsistency
  • Developers copying demo code must remember to include the inline style or spacing will be incorrect
  • Changes to this spacing value would require updating all demos

Consider one of these alternatives:

  1. Adjust .header CSS to handle content padding by default
  2. Create a Sidebar.HeaderContent wrapper component with appropriate spacing
  3. Make the padding a configurable prop with a sensible default

Also applies to: 74-74, 99-99, 131-131, 152-152, 173-173, 200-200, 224-224, 248-248, 272-272, 303-303, 329-329, 351-351, 376-376, 415-415, 462-462, 495-495

🤖 Prompt for 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.

In `@apps/www/src/content/docs/components/sidebar/demo.ts` at line 26, The demos
currently add inline style style={{padding:"4px"}} to the Flex inside
Sidebar.Header; replace this fragile pattern by moving the padding into a
reusable component or stylesheet: either update the Sidebar.Header CSS (e.g.,
.header) to include the default content padding, or create a new
Sidebar.HeaderContent component that wraps Flex and applies spacing via design
tokens, or add a padding prop with a default on Sidebar.Header so callers no
longer need inline styles; find occurrences using the Flex inside Sidebar.Header
(and identifiers like Sidebar.Header, Flex) and refactor them to consume the
shared padding behavior instead of inline style.
🤖 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.

Nitpick comments:
In `@apps/www/src/content/docs/components/sidebar/demo.ts`:
- Line 26: The demos currently add inline style style={{padding:"4px"}} to the
Flex inside Sidebar.Header; replace this fragile pattern by moving the padding
into a reusable component or stylesheet: either update the Sidebar.Header CSS
(e.g., .header) to include the default content padding, or create a new
Sidebar.HeaderContent component that wraps Flex and applies spacing via design
tokens, or add a padding prop with a default on Sidebar.Header so callers no
longer need inline styles; find occurrences using the Flex inside Sidebar.Header
(and identifiers like Sidebar.Header, Flex) and refactor them to consume the
shared padding behavior instead of inline style.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be84353e-0909-4ece-81b5-ff0cca964067

📥 Commits

Reviewing files that changed from the base of the PR and between dc6e8c8 and e1dad5a.

📒 Files selected for processing (3)
  • apps/www/src/content/docs/components/sidebar/demo.ts
  • packages/raystack/components/sidebar/sidebar-main.tsx
  • packages/raystack/components/sidebar/sidebar.module.css

Copy link
Copy Markdown
Contributor

@paanSinghCoder paanSinghCoder left a comment

Choose a reason for hiding this comment

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

Not related to this PR - Lets add an example for simple Sidebar without Group.

Comment thread apps/www/src/content/docs/components/sidebar/demo.ts Outdated
@rohanchkrabrty rohanchkrabrty merged commit 4f70159 into main May 18, 2026
4 of 5 checks passed
@rohanchkrabrty rohanchkrabrty deleted the fix-sidebar-css branch May 18, 2026 10:15
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