Skip to content

fix(markdown): let the document scroll on narrow screens - #1172

Merged
mikebarkmin merged 2 commits into
mainfrom
claude/mobile-pull-to-refresh-ysx7vb
Aug 14, 2026
Merged

fix(markdown): let the document scroll on narrow screens#1172
mikebarkmin merged 2 commits into
mainfrom
claude/mobile-pull-to-refresh-ysx7vb

Conversation

@mikebarkmin

Copy link
Copy Markdown
Member

The reading shell pinned itself to the viewport — .main-grid { position: fixed } over html, body { overflow: hidden } — and scrolled main inside
it, so the sidebar could stay put while the article moved. The document
scroller then never moves, and a mobile browser drives both pull-to-refresh
and the collapsing address bar off exactly that scroller, so neither gesture
ever fires.

Below the 1280px breakpoint none of that is being paid for: the sidebar is
already a drawer and the grid is a single column. Unwind the shell back into
normal flow there and hold the header in place with position: sticky
instead. Sticky needs a block-level shell — a grid item sticks only within its
own grid area, which for the header is the one row it already fills — and the
rules have to come last in the file, since they override the base layout on
equal specificity. Wider screens keep the fixed grid.

Two consequences of the document becoming the scroller: anchor jumps get
scroll-padding-top so a heading clears the sticky header, and the scroll
listener in the store, which until now never fired on mobile, coalesces its
writes to one per frame rather than one per scroll event.

The cloud shell carries the same layout and gets the same treatment.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_014nCXuDptSw9FUW4WagZjak

The reading shell pinned itself to the viewport — `.main-grid { position:
fixed }` over `html, body { overflow: hidden }` — and scrolled `main` inside
it, so the sidebar could stay put while the article moved. The document
scroller then never moves, and a mobile browser drives both pull-to-refresh
and the collapsing address bar off exactly that scroller, so neither gesture
ever fires.

Below the 1280px breakpoint none of that is being paid for: the sidebar is
already a drawer and the grid is a single column. Unwind the shell back into
normal flow there and hold the header in place with `position: sticky`
instead. Sticky needs a block-level shell — a grid item sticks only within its
own grid area, which for the header is the one row it already fills — and the
rules have to come last in the file, since they override the base layout on
equal specificity. Wider screens keep the fixed grid.

Two consequences of the document becoming the scroller: anchor jumps get
`scroll-padding-top` so a heading clears the sticky header, and the scroll
listener in the store, which until now never fired on mobile, coalesces its
writes to one per frame rather than one per scroll event.

The cloud shell carries the same layout and gets the same treatment.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014nCXuDptSw9FUW4WagZjak
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hyperbook-4fwa Ready Ready Preview Aug 14, 2026 7:19am

@mikebarkmin
mikebarkmin merged commit b389c0b into main Aug 14, 2026
3 checks passed
@mikebarkmin
mikebarkmin deleted the claude/mobile-pull-to-refresh-ysx7vb branch August 14, 2026 07:21
@github-actions github-actions Bot mentioned this pull request Aug 14, 2026
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