Skip to content

fix(landing): docs layout fixes — sidebar, subnav, TOC, robots#143

Merged
maxktz merged 3 commits into
mainfrom
t3code/1b291de7
Apr 22, 2026
Merged

fix(landing): docs layout fixes — sidebar, subnav, TOC, robots#143
maxktz merged 3 commits into
mainfrom
t3code/1b291de7

Conversation

@maxktz

@maxktz maxktz commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix sidebar fixed positioning to only apply when expanded (not collapsed)
  • Fix mobile subnav to top with proper TOC popover margin compensation
  • Make TOC popover header fixed so it doesn't scroll with content
  • Stabilize sidebar background color and fix typo
  • Use .md instead of .mdx for docs markdown routes
  • Disallow crawling of Next.js static media in robots.txt
  • Prevent docs sidebar from scrolling with page content

Test plan

  • Verify sidebar stays fixed on desktop when expanded, behaves normally when collapsed
  • Verify mobile subnav is fixed to top and TOC popover spacing is correct
  • Verify TOC popover header stays fixed when scrolling
  • Check robots.txt blocks /_next/static/media/

Summary by CodeRabbit

  • Bug Fixes
    • Sidebar placeholder now only locks into a fixed position when the sidebar is expanded, reducing unexpected layout shifts on larger screens.
    • Mobile sub-navigation is fixed to the top of the viewport for consistent access while scrolling.
    • Table-of-contents popovers receive added top spacing to prevent overlap with the fixed mobile sub-navigation.

Only apply fixed positioning to sidebar when expanded (not collapsed).
Fix mobile subnav to top and compensate TOC popover margin.
@vercel

vercel Bot commented Apr 22, 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 22, 2026 11:01am

@coderabbitai

coderabbitai Bot commented Apr 22, 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: 22bce393-c1b1-458d-b433-bbfd95277fc1

📥 Commits

Reviewing files that changed from the base of the PR and between eedc1ec and 4db9530.

📒 Files selected for processing (1)
  • landing/src/styles/globals.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • landing/src/styles/globals.css

📝 Walkthrough

Walkthrough

Adjusts responsive CSS: desktop rule restricts fixed positioning of [data-sidebar-placeholder] to when #nd-sidebar is not collapsed; adds mobile rules to fix #nd-subnav to the viewport and offset [data-toc-popover] with a top margin.

Changes

Cohort / File(s) Summary
Responsive layout CSS
landing/src/styles/globals.css
Desktop media query: apply position: fixed to [data-sidebar-placeholder] only when #nd-sidebar is not collapsed (:not(:has(#nd-sidebar[data-collapsed="true"]))), retain transform optimizations. Mobile media query: define --subnav-height: 3.5rem, set #nd-subnav to position: fixed with top: var(--fd-docs-row-1, 0px) and left/right 0, and add margin-top: var(--subnav-height) to [data-toc-popover] to compensate for the fixed subnav.

Sequence Diagram(s)

(No sequence diagrams generated — changes are CSS-only layout adjustments without multi-component control flow.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hop through rules of margin and top,

Tuck sidebars in when they need to stop,
Fix the subnav snug to the view,
Nudge popovers down — neat and true,
A little rabbit's CSS hop, hoo!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions multiple changes (sidebar, subnav, TOC, robots), but the raw_summary only describes CSS layout changes to the sidebar, subnav, and TOC popover—no robots.txt updates are detailed. Either update the title to focus on the specific CSS layout changes, or clarify which changes are actually included in this PR commit.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✨ Finishing Touches
🧪 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.

🧹 Nitpick comments (2)
landing/src/styles/globals.css (2)

398-400: Avoid hard-coded TOC offset; derive it from a shared variable.

Line 399 uses a fixed 3.5rem compensation. This can break when subnav height changes (density, font scaling, localization). Prefer a shared CSS variable used by both #nd-subnav height and [data-toc-popover] offset.

♻️ Suggested refactor
 `@media` (max-width: 767px) {
   `#nd-subnav` {
+    --nd-subnav-height: 3.5rem;
     position: fixed !important;
     top: var(--fd-docs-row-1, 0px) !important;
     inset-inline-start: 0 !important;
     inset-inline-end: 0 !important;
+    min-height: var(--nd-subnav-height);
   }

   /* Compensate for fixed `#nd-subnav` leaving grid flow */
   [data-toc-popover] {
-    margin-top: 3.5rem;
+    margin-top: var(--nd-subnav-height);
   }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@landing/src/styles/globals.css` around lines 398 - 400, Replace the
hard-coded margin on the TOC popover with a shared CSS variable used by the
subnav: introduce a custom property (e.g. --subnav-height) that's set where
`#nd-subnav` defines its height and then use that variable inside the
[data-toc-popover] rule instead of 3.5rem; update `#nd-subnav` to export the
computed height to --subnav-height so both selectors reference the same value
and the TOC offset adapts when subnav size changes.

378-380: Scope will-change more narrowly to avoid unnecessary layer promotion.

Applying will-change: transform unconditionally on desktop can add steady memory/compositing overhead even when no transform animation is active.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@landing/src/styles/globals.css` around lines 378 - 380, Remove the
unconditional will-change from the `#nd-sidebar` rule and instead apply it only
when a transform is actually needed (e.g., move the will-change: transform
declaration into a transient class such as .is-transforming or
.animate-transform applied to `#nd-sidebar` during animations/transitions);
additionally scope that class rule behind prefers-reduced-motion: no-preference
(or a pointer: fine media query) so layer promotion only happens when animations
are permitted and active.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@landing/src/styles/globals.css`:
- Around line 398-400: Replace the hard-coded margin on the TOC popover with a
shared CSS variable used by the subnav: introduce a custom property (e.g.
--subnav-height) that's set where `#nd-subnav` defines its height and then use
that variable inside the [data-toc-popover] rule instead of 3.5rem; update
`#nd-subnav` to export the computed height to --subnav-height so both selectors
reference the same value and the TOC offset adapts when subnav size changes.
- Around line 378-380: Remove the unconditional will-change from the `#nd-sidebar`
rule and instead apply it only when a transform is actually needed (e.g., move
the will-change: transform declaration into a transient class such as
.is-transforming or .animate-transform applied to `#nd-sidebar` during
animations/transitions); additionally scope that class rule behind
prefers-reduced-motion: no-preference (or a pointer: fine media query) so layer
promotion only happens when animations are permitted and active.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6dcccd6a-2b9a-4282-887c-49f0e74576b5

📥 Commits

Reviewing files that changed from the base of the PR and between 18eae11 and 8983df4.

📒 Files selected for processing (1)
  • landing/src/styles/globals.css

@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

🧹 Nitpick comments (1)
landing/src/styles/globals.css (1)

385-397: Scope --subnav-height where both selectors can read it.

Line 387 defines --subnav-height on #nd-subnav, but Line 396 reads it from [data-toc-popover]. If they are not in a parent/child chain, the popover always falls back to 3.5rem, which defeats dynamic compensation.

♻️ Suggested adjustment
 `@media` (max-width: 767px) {
+  :root {
+    --subnav-height: 3.5rem;
+  }
+
   `#nd-subnav` {
-    --subnav-height: 3.5rem;
     position: fixed !important;
     top: var(--fd-docs-row-1, 0px) !important;
     inset-inline-start: 0 !important;
     inset-inline-end: 0 !important;
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@landing/src/styles/globals.css` around lines 385 - 397, The CSS custom
property --subnav-height is defined on `#nd-subnav` but read from
[data-toc-popover], so when they aren’t in the same ancestor chain the popover
falls back to 3.5rem; fix by defining the property on a common ancestor that
contains both selectors (e.g., :root, html, or a shared container) inside the
same `@media` (max-width: 767px) block so both `#nd-subnav` and [data-toc-popover]
inherit the dynamic value (alternatively set the variable on both selectors) —
update the media query to place --subnav-height on that shared scope rather than
only on `#nd-subnav`.
🤖 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/styles/globals.css`:
- Around line 386-389: The CSS block for selector `#nd-subnav` violates the
stylelint rule declaration-empty-line-before; fix by adding a single empty line
before the declaration that begins with "position" inside the `#nd-subnav` rule
(or run your formatter/stylelint --fix), ensuring there is a blank line between
the custom property (--subnav-height: 3.5rem;) and the subsequent position:
fixed !important; declaration so the rule passes CI.

---

Nitpick comments:
In `@landing/src/styles/globals.css`:
- Around line 385-397: The CSS custom property --subnav-height is defined on
`#nd-subnav` but read from [data-toc-popover], so when they aren’t in the same
ancestor chain the popover falls back to 3.5rem; fix by defining the property on
a common ancestor that contains both selectors (e.g., :root, html, or a shared
container) inside the same `@media` (max-width: 767px) block so both `#nd-subnav`
and [data-toc-popover] inherit the dynamic value (alternatively set the variable
on both selectors) — update the media query to place --subnav-height on that
shared scope rather than only on `#nd-subnav`.
🪄 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: ec20e071-d374-4549-a59f-c9b191dd7ac8

📥 Commits

Reviewing files that changed from the base of the PR and between 8983df4 and eedc1ec.

📒 Files selected for processing (1)
  • landing/src/styles/globals.css

Comment thread landing/src/styles/globals.css Outdated
Comment on lines +386 to +389
#nd-subnav {
--subnav-height: 3.5rem;
position: fixed !important;
top: var(--fd-docs-row-1, 0px) !important;

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 | 🟡 Minor

Fix Stylelint spacing violation in #nd-subnav.

Line 388 currently violates declaration-empty-line-before. Please add the required empty line (or apply your formatter/linter autofix) so CI stays clean.

🧰 Tools
🪛 Stylelint (17.7.0)

[error] 388-388: Expected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@landing/src/styles/globals.css` around lines 386 - 389, The CSS block for
selector `#nd-subnav` violates the stylelint rule declaration-empty-line-before;
fix by adding a single empty line before the declaration that begins with
"position" inside the `#nd-subnav` rule (or run your formatter/stylelint --fix),
ensuring there is a blank line between the custom property (--subnav-height:
3.5rem;) and the subsequent position: fixed !important; declaration so the rule
passes CI.

@maxktz maxktz merged commit 6c80884 into main Apr 22, 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