Skip to content

Fix scroll reveal replay flicker#1

Closed
fabianzimber wants to merge 4 commits intomainfrom
codex/fix-flicker-issue-on-scroll
Closed

Fix scroll reveal replay flicker#1
fabianzimber wants to merge 4 commits intomainfrom
codex/fix-flicker-issue-on-scroll

Conversation

@fabianzimber
Copy link
Member

Motivation

  • Prevent reveal animations from replaying (causing a visible flicker) when IntersectionObserver/viewport updates jitter or when the rich layer is swapped in after scroll.
  • Ensure once-only reveals behave consistently for both individual reveals and reveal groups.

Description

  • Changed useInView calls to once: false and removed the optimistic visible default so visibility is driven by an explicit seen-state.
  • Added hasBeenInViewRef and a hasBeenInView state that is seeded using getViewportIntersectionRatio() in a useLayoutEffect, and locked once set to avoid replay on jitter.
  • Updated React.useEffect logic to only set the seen state once (for once === true) and changed shouldReveal to rely on the locked seen state for once mode.
  • Applied the same fix to both Reveal and RevealGroup components in src/components/scroll/scroll-reveal.tsx.

Testing

  • Ran lint with npm run lint, which completed successfully but produced a single warning no-before-interactive-script-outside-document in src/components/layout/marketing-layout.tsx.
  • Ran the test suite with npm run test:ci, and all automated tests passed (75 tests passed).

Codex Task

@vercel
Copy link

vercel bot commented Jan 14, 2026

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

Project Deployment Review Updated (UTC)
eva-website Ready Ready Preview, Comment Jan 14, 2026 11:07pm

@codecov
Copy link

codecov bot commented Jan 14, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@fabianzimber fabianzimber deleted the codex/fix-flicker-issue-on-scroll branch January 14, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant