Skip to content

fix(web): stop the guide reader's progress bar drawing through the header - #164

Merged
ralyodio merged 1 commit into
masterfrom
worktree-fix-reader-header
Aug 29, 2026
Merged

ralyodio merged 1 commit into
masterfrom
worktree-fix-reader-header

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The bug

On /read/ctem-guide the reading-progress bar is pinned at top-16 (64px), but SiteHeader is 69px tall on mobile and 81px from sm up. So the bar lives inside the header:

  • its grey track draws a line straight across the logo and nav,
  • the green fill cuts through them as you scroll,
  • the 12% pill hangs out the bottom of the header into the content.

It also sat at z-40, the same as the header and later in the DOM, so an open mobile menu got a green line painted over it.

The fix

Give the header height a token, --tc-header-h (69px / 81px at sm), and have SiteHeader size its own row from it — so the token is the single source of truth rather than a number two files have to agree on.

Everything the reader pins below the header now reads that token instead of guessing:

before after
progress bar top top-16 (64px) var(--tc-header-h)
sticky contents rail lg:top-28 calc(var(--tc-header-h) + 2.5rem)
section scroll offsets scroll-mt-28 calc(var(--tc-header-h) + 2.5rem)
observer rootMargin -96px header height + 40

The bar drops to z-30 so the header wins the overlap in both directions.

Header row

The row keeps its exact height (68px / 80px + 1px border), so no other page shifts. Its contents move from items-end to items-center — the bottom-alignment is the other half of why the header reads as sagging into the content.

Verified

Headless Chromium against a next build production server, 1440×900 and 390×844:

  • header 81px / 69px — unchanged from master
  • progress bar now 81 → 112 (was 64 → 95, i.e. inside the header)
  • sticky rail 121, no heading lands under the header on a TOC jump
  • open mobile menu cleanly covers the bar
  • homepage unchanged apart from the vertical centering
  • document.scrollWidth === innerWidth at both widths

pnpm test in apps/web: 410 passed / 2 failed, 3 failed files — exactly the known pre-existing baseline on master (release-docs, scan/code route, usage/topup). Untouched by this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NtfGqzmntTsmXDLWLMgMYW

…ader

The reader pinned its progress bar at `top-16` (64px), but the site header is
69px tall on mobile and 81px from `sm` up. The bar's track therefore drew a
grey line straight across the logo and nav, the green fill cut through them as
you read, and the percent pill hung below the header into the hero — which is
what "the header is overhanging the content" looks like.

Give the header height a token, `--tc-header-h`, and let SiteHeader size its own
row from it so the token is the single source rather than a number to keep in
sync. Everything the reader pins below the header now reads that token: the
progress bar's `top`, the sticky contents rail, the section scroll offsets, and
the IntersectionObserver rootMargin that decides which entry the rail highlights
(it guessed 96px).

The bar also drops to z-30 so the header wins the overlap in both directions —
previously an open mobile menu had the progress bar painted over it.

The header row keeps its exact height (68px / 80px plus the border), so no other
page shifts; its contents move from `items-end` to `items-center`, which is what
made the logo and nav sit low against the bottom border.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NtfGqzmntTsmXDLWLMgMYW
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

12 finding(s)

HIGH/CRITICAL: 1 | MEDIUM: 6 | LOW: 5

Severity Rule Location
HIGH secret-aws-access-key prd/0003-detect-hardcoded-secrets-before-they-are-committed-or-served.md:126
MEDIUM js-open-redirect apps/web/src/app/auth/login/page.tsx:50
MEDIUM js-unescaped-html-sink apps/web/src/app/hire/page.tsx:96
MEDIUM js-unescaped-html-sink apps/web/src/app/hire/page.tsx:100
MEDIUM js-open-redirect apps/web/src/components/funding/FundingClient.tsx:97
MEDIUM js-unescaped-html-sink apps/web/src/components/GuideReader.tsx:265
MEDIUM js-uninitialized-buffer packages/scan/src/node-rules.ts:456
LOW secret-generic-credential PRD.md:268
LOW tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:121
LOW tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:122
LOW sh-remote-script-execution scripts/smoke-test.sh:47
LOW secret-aws-access-key scripts/smoke-test.sh:112

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit dce7267 into master Aug 29, 2026
10 of 11 checks passed
@ralyodio
ralyodio deleted the worktree-fix-reader-header branch August 29, 2026 07:31
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