Skip to content

fix: auto-repair mis-rendered sidebar on introduction page - #757

Merged
CahidArda merged 1 commit into
mainfrom
fix/introduction-sidebar-misrender
Jul 16, 2026
Merged

fix: auto-repair mis-rendered sidebar on introduction page#757
CahidArda merged 1 commit into
mainfrom
fix/introduction-sidebar-misrender

Conversation

@CahidArda

Copy link
Copy Markdown
Contributor

Mintlify sometimes mis-measures its fixed sidebar while hydrating /introduction (mode: frame) and sets a negative inline top, leaving the sidebar stuck under the header until the user scrolls. Detect that state (negative top while the footer is nowhere near the viewport - negative top is legitimate when clearing the footer) and reproduce the healing scroll: 1px down, restore next frame.

Mintlify sometimes mis-measures its fixed sidebar while hydrating
/introduction (mode: frame) and sets a negative inline top, leaving the
sidebar stuck under the header until the user scrolls. Detect that state
(negative top while the footer is nowhere near the viewport - negative
top is legitimate when clearing the footer) and reproduce the healing
scroll: 1px down, restore next frame.
@mintlify

mintlify Bot commented Jul 16, 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 16, 2026, 11:07 AM

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

@CahidArda
CahidArda marked this pull request as ready for review July 16, 2026 11:08
@CahidArda
CahidArda merged commit ba7a78b into main Jul 16, 2026
3 checks passed
@CahidArda
CahidArda deleted the fix/introduction-sidebar-misrender branch July 16, 2026 11:08
@mintlify

mintlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
upstash 🟡 Building Jul 16, 2026, 11:05 AM

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

CahidArda added a commit that referenced this pull request Jul 24, 2026
… race) (#764)

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