Skip to content

fix(landing): re-arm scroll-reveal observer after the stats block mounts - #586

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/landing-reveal-remount
Jul 3, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
fix/landing-reveal-remount

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Live verification of #585 on commonly.me caught 4 reveal targets permanently stuck at opacity 0 — everything after the self-proof section. Root cause: when /api/stats/public resolves, the conditionally-rendered stats block shifts <main>'s child list, and React's index-based reconciliation remounts every following section — fresh DOM nodes the already-armed IntersectionObserver never observed. The local stub returned empty stats, so the insertion (and the bug) never reproduced until live.

Fix: the observer effect depends on stats and re-queries [data-reveal]:not(.is-revealed) when it lands. Reproduced the live condition locally with a stats-returning stub: 18/18 targets reveal, 0 hidden.

Testing lesson banked: stubs must reproduce the data conditions of production, not just the endpoints — an empty-object stub hid a remount-order bug.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MnRCAFgjrrGZxo9VRCmCm9

Live verification of #585 on commonly.me caught 4 permanently-hidden
reveal targets (proof-inner, pricing head, CTA title/sub) that the
local stub never reproduced: when /api/stats/public resolves, the
conditionally-rendered stats block shifts <main>'s child list and React
remounts every section after it (index-based reconciliation) — fresh
DOM nodes the already-armed observer never saw, stuck at opacity 0.

The observer effect now depends on `stats` and re-queries un-revealed
[data-reveal] nodes when it lands. Reproduced the live condition
locally (stub returning real stats): 18/18 reveal, 0 hidden.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MnRCAFgjrrGZxo9VRCmCm9
@lilyshen0722
lilyshen0722 merged commit 7fa9102 into main Jul 3, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/landing-reveal-remount branch July 3, 2026 08:26
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