Skip to content

DX-2806: fix landing sidebar mis-render at the root (footer-avoidance race) - #764

Merged
CahidArda merged 1 commit into
mainfrom
DX-2806-landing-sidebar-root-fix
Jul 24, 2026
Merged

DX-2806: fix landing sidebar mis-render at the root (footer-avoidance race)#764
CahidArda merged 1 commit into
mainfrom
DX-2806-landing-sidebar-root-fix

Conversation

@CahidArda

Copy link
Copy Markdown
Contributor

The custom docs landing (mode: frame, introduced in e7e3bec / #748) renders its body client-side, so on a hard load the page is short and the footer sits inside the viewport. Mintlify's footer-avoidance scroll handler then pins the fixed sidebar above the viewport (negative inline top) and only recomputes on a scroll event - once the body hydrates and the footer moves away, nothing re-runs it and the sidebar stays stuck showing the tail of the nav.

Replaces the scroll-nudge auto-repair (ba7a78b / #757), which repaired after the wrong paint (visible snap) and silently failed exactly when the bug is born: the pre-hydration page can be too short to scroll, so its 1px scroll fired no scroll event (and the resize event it also dispatched does not trigger Mintlify's handler at all).

  • style.css: reserve min-height:100vh on #content for /introduction from the first paint, so the footer can never be in view while the body is empty and the bad measurement becomes impossible. Keyed on data-page-href, which is SSR'd with the real path (data-current-path SSRs as "/" and is stamped only after hydration - too late). Second selector covers local mint dev, which stamps the attribute as /src/_props/introduction.
  • script.js: replace the nudge machinery with a small backstop that, if a stuck state ever appears (negative top with the footer far from view), re-runs Mintlify's own listener via a synthetic window scroll event - nothing visibly moves, and it works on an unscrollable page.

… race)

The custom docs landing (mode: frame, introduced in e7e3bec / #748) renders
its body client-side, so on a hard load the page is short and the footer sits
inside the viewport. Mintlify's footer-avoidance scroll handler then pins the
fixed sidebar above the viewport (negative inline top) and only recomputes on
a scroll event - once the body hydrates and the footer moves away, nothing
re-runs it and the sidebar stays stuck showing the tail of the nav.

Replaces the scroll-nudge auto-repair (ba7a78b / #757), which repaired after
the wrong paint (visible snap) and silently failed exactly when the bug is
born: the pre-hydration page can be too short to scroll, so its 1px scroll
fired no scroll event (and the resize event it also dispatched does not
trigger Mintlify's handler at all).

- style.css: reserve min-height:100vh on #content for /introduction from the
  first paint, so the footer can never be in view while the body is empty and
  the bad measurement becomes impossible. Keyed on data-page-href, which is
  SSR'd with the real path (data-current-path SSRs as "/" and is stamped only
  after hydration - too late). Second selector covers local mint dev, which
  stamps the attribute as /src/_props/introduction.
- script.js: replace the nudge machinery with a small backstop that, if a
  stuck state ever appears (negative top with the footer far from view),
  re-runs Mintlify's own listener via a synthetic window scroll event -
  nothing visibly moves, and it works on an unscrollable page.
@linear-code

linear-code Bot commented Jul 24, 2026

Copy link
Copy Markdown

DX-2806

@mintlify

mintlify Bot commented Jul 24, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
upstash 🟢 Ready View Preview Jul 24, 2026, 4:11 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@CahidArda
CahidArda merged commit 0be1ffb into main Jul 24, 2026
3 checks passed
@CahidArda
CahidArda deleted the DX-2806-landing-sidebar-root-fix branch July 24, 2026 04:12
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