Repository navigation
fix(highlights): land the opened highlight below the status bar and header - #6894
Conversation
…eader Opening a highlight from the in-feed Happening Now card scrolled it into view with block 'center'. An expanded highlight is often taller than a phone's visible area, so centering put its top above the status-bar inset, and the phone shell block slides back over it on any scroll up. Scroll to the start instead, with a scroll margin that clears what covers the top: the safe-area inset plus the shell block on phones, and the sticky tab bar or the layout's fixed header, whichever is taller, from tablet up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Before/after evidenceSetup (both runs): headless Chromium 145, Playwright Steps: open Before (production, re-run 2026-10-13)The scroll settles at scrollY=321 with the expanded item's top at 28px, above the 47px inset. The first line of the headline sits under the status bar. Images, in order: the feed card before the tap, the page after the tap, and the same frame annotated (the red band marks the 47px safe area). After (PR preview, head
|






Problem
On iPhone, tapping a headline in the in-feed Happening Now card opens
/highlights?highlight=<id>, which expands that highlight and scrolls to it. The scroll ignored the top safe area, so the headline's first line ended up under the status bar, and the phone shell block slides back over it on any scroll up.Root cause
HighlightItemscrolled withscrollIntoView({ block: 'center' })and the<article>had no scroll margin. Coming from the feed, the item mounts already expanded, and expanded items are often taller than a phone's visible area. Centering such an item puts its top above the safe-area inset (e.g. a 695px item in a 750px viewport lands at 28px, under a 47px status bar).scrollIntoViewknows nothing about the fixed status-bar band or the shell block.Fix
block: 'start'.--safe-area-top+--shell-top, the same patternMainCommentandTagDirectoryuse. From tablet up, the safe area plus the larger of the sticky 4rem tab bar and the layout's--sticky-header-offset.On tablet and laptop the opened highlight now aligns just under the tab bar instead of being centered.
Testing
HighlightItem.spec.tsxnow asserts the scroll aligns to the start (fails before, passes after).pnpm --filter webapp test, shared highlights tests, eslint and the strict typecheck on changed files all pass.Reviewer: @idoshamun (the centered
scrollIntoViewwas introduced in #5857).This PR was written by Smith (AI) as part of a bug hunt.
🤖 Generated with Claude Code
Written by Smith (AI).
Preview domain
https://fix-highlight-scroll-safe-area.preview.app.daily.dev