Skip to content

fix: eliminate nav reload flicker via client routing with persisted WebGL header - #63

Merged
radiolabme merged 2 commits into
mainfrom
fix/nav-reload-flicker
Jul 16, 2026
Merged

fix: eliminate nav reload flicker via client routing with persisted WebGL header#63
radiolabme merged 2 commits into
mainfrom
fix/nav-reload-flicker

Conversation

@radiolabme

Copy link
Copy Markdown
Collaborator

Summary

Clicking the logo (or any nav link) was a full-document reload, so the content re-laid-out (a few-px shift) and the WebGL header wave re-initialized (jump/flicker) every time. Adopts the static-site best practice — client-side routing that persists the shell — to remove the reload entirely. Verified clean on Safari before merge.

Changes

  • Client routing — re-enable Astro ClientRouter and transition:persist the header, so navigation swaps only the page content. The live WebGL canvas is never destroyed or re-initialized → no reload, no wave restart, no content reflow.
  • No crossfade snapshot — all view-transition animations disabled (::view-transition-* { animation: none }), so there's no snapshot window to render the GL canvas as a monochrome smear on Safari (the reason ClientRouter was removed before). Swaps are instant.
  • Context-loss resilience — the wave init is now re-entrant and rebuilds its GL resources on webglcontextrestored (a canvas re-attach can drop the context on some browsers), with loop control outside the builder so a rebuild never stacks two rAF loops.
  • Removed masking layers that were fighting the old full-reload model: the page-enter transform (the content shift) and the always-on static SVG wave baseline (a different shape than the shader, which snapped on each reload). The SVG is back to a WebGL-fail-only fallback.

Validation

Full pre-push suite passed: lint, type-check, content validation, unit tests (86), build. Client routing + persist + VT-disable rule confirmed in the built output. Manually verified flicker-free on Safari.

🤖 Generated with Claude Code

radiolabme and others added 2 commits July 15, 2026 05:37
Two full-page-load artifacts, both from masking layers added earlier this
session: the page-enter reveal translated <main> 12px on every navigation (the
'content shifts down during loading'), and the always-on static SVG wave — a
different shape than the WebGL shader — snapped to the shader on each reload (the
'shader jumps around'). Remove page-enter, and return the SVG to a fail-only
WebGL fallback so it never competes with the live canvas.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Re-enable Astro ClientRouter and persist the header (transition:persist) so
navigation swaps only the page content — the live WebGL canvas is never
destroyed or re-initialised, eliminating the reload flicker and content reflow
at the root. ALL view-transition animations are disabled (::view-transition-*
animation:none) so there is no crossfade snapshot to render the GL canvas as a
monochrome smear on Safari; swaps are instant. The wave init is now re-entrant
and rebuilds its GL resources on webglcontextrestored (a canvas re-attach can
drop the context on some browsers), with loop control outside the builder so a
rebuild never stacks two rAF loops.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@radiolabme
radiolabme merged commit afee776 into main Jul 16, 2026
1 check passed
@radiolabme
radiolabme deleted the fix/nav-reload-flicker branch July 16, 2026 07:56
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