Skip to content

fix(landing): prevent docs sidebar from scrolling with page content#141

Merged
maxktz merged 10 commits into
mainfrom
t3code/1b291de7
Apr 20, 2026
Merged

fix(landing): prevent docs sidebar from scrolling with page content#141
maxktz merged 10 commits into
mainfrom
t3code/1b291de7

Conversation

@maxktz

@maxktz maxktz commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removed the wrapping div with h-dvh overflow-y-auto around DocsLayout that created a nested scroll container breaking sticky positioning
  • Applied position: fixed to the sidebar placeholder via CSS, matching the approach used by better-auth's fumadocs setup
  • Sidebar horizontal position is calculated to respect fumadocs' grid centering on wide screens

Test plan

  • Verify docs sidebar stays fixed while scrolling page content
  • Verify sidebar collapse/expand still works
  • Verify sidebar position is correct on different screen widths
  • Verify mobile sidebar drawer still works

Summary by CodeRabbit

  • Refactor

    • Reorganized documentation layout to use the new DocsLayout structure.
  • Style

    • Adjusted navigation tab padding for consistent spacing across breakpoints.
    • Fixed desktop sidebar positioning and background to prevent it from scrolling and align with layout.
    • Improved table-of-contents popover visibility and header placement.
  • Bug Fixes

    • Corrected title container layout class.
    • Copy/download targets now use .md docs; proxy routing updated accordingly.
    • Updated robots rules to disallow crawling of static media paths.

@vercel

vercel Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
paykit Ready Ready Preview, Comment Apr 20, 2026 2:43pm

@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: da10e391-cb97-49a7-9dc5-302b358aca88

📥 Commits

Reviewing files that changed from the base of the PR and between 282c30d and 04b9bc5.

📒 Files selected for processing (1)
  • landing/src/app/robots.ts
✅ Files skipped from review due to trivial changes (1)
  • landing/src/app/robots.ts

📝 Walkthrough

Walkthrough

Replaced an outer wrapper by rendering DocsLayout directly and restructured its nav/sidebar props; adjusted navigation tab padding; switched docs source references from .mdx to .md (CopyMarkdownButton and proxy matcher/rewrites); added desktop CSS to fix sidebar/TOC positioning and visibility.

Changes

Cohort / File(s) Summary
Docs Layout
landing/src/app/docs/layout.tsx
Removed outer wrapper div; render DocsLayout directly, pass children inside its tags; moved sidebar footer into sidebar.footer; introduced explicit top-level nav prop (includes children SidebarCollapseButton, title with Wordmark + conditional Badge, and url); fixed flew-rowflex flex-row.
Navigation Styling
landing/src/components/layout/navigation-bar.tsx
Adjusted tabBase Tailwind classes: replaced xl:px-5.5 with px-5.5, removing breakpoint-specific horizontal padding.
Global CSS / Layout Positioning
landing/src/styles/globals.css
Removed hardcoded root --sidebar; added desktop media-query rules to make [data-sidebar-placeholder] fixed with calculated inset-inline-start, fixed TOC popover header positioning, forced overflow: visible !important for TOC popover elements and trigger progressbar, and set background-color: var(--sidebar) for #nd-sidebar / #nd-sidebar-mobile.
Docs page — Markdown link
landing/src/app/docs/[[...slug]]/page.tsx
Changed CopyMarkdownButton prop to use .md extension (markdownUrl={${page.url}.md}) instead of .mdx.
Proxy routing
landing/src/proxy.ts
Updated matcher from "/docs/:path*.mdx""/docs/:path*.md"; rewrite logic now strips .md (slice(0, -3)) and rewrites destinations to .md.
Robots
landing/src/app/robots.ts
Added disallow for /_next/static/media/ to wildcard User-agent: * rules alongside existing /api/.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I hopped through layout, nudged a div away,
I tucked the nav and footer where they safely stay,
I pinned the sidebar, kept the TOC in sight,
I swapped .mdx to .md — tidy and light,
— a rabbit’s cheer for code that’s bright!

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly summarizes the main change: preventing the docs sidebar from scrolling with page content, which aligns with the primary structural fix to remove the nested scroll container and apply fixed positioning.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/1b291de7

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@landing/src/app/docs/layout.tsx`:
- Line 182: There's a typo in the JSX className on the div that reads "flew-row
flex items-center" which makes the row layout class a no-op; update the
className on that div (the element in layout.tsx that currently has "flew-row
flex items-center") to use the correct Tailwind utility "flex-row" so it becomes
"flex-row flex items-center" (or reorder to "flex flex-row items-center" if you
prefer the explicit flex container first).
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 50dbbec4-3766-47e8-8354-bd98ee8f1a05

📥 Commits

Reviewing files that changed from the base of the PR and between c28ef56 and 1705658.

📒 Files selected for processing (3)
  • landing/src/app/docs/layout.tsx
  • landing/src/components/layout/navigation-bar.tsx
  • landing/src/styles/globals.css

Comment thread landing/src/app/docs/layout.tsx Outdated
maxktz added 3 commits April 20, 2026 13:36
Pin sidebar background-color to var(--sidebar) so CSS layer resolution
differences between dev and prod builds don't cause color mismatches.
Remove dead duplicate --sidebar declaration. Fix "flew-row" typo.
@maxktz maxktz merged commit 18eae11 into main Apr 20, 2026
3 checks passed
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.

1 participant