You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
beforeShot hook: run after the scroll pass, right before the shot #71
What
A route hook that runs after renderdiff's own settle (the scroll pass, image decode and network idle), right before masks are read and shots are taken. For example beforeShot, next to before.
Why before runs before the scroll pass, and the scroll pass undid the state a hook had set. Two cases from a 208-route marketing run:
A scroll-spy nav. It kept whichever section the last scroll event saw, so the active tab came out as Soon on one side and Later on the other.
A demo iframe. Its container height was re-measured after the hook, 538 vs 544 px.
Each needed a workaround and cost a full ~20-minute cycle:
a scroll listener that restores the nav's load-time classes at scrollY === 0;
an !important height pin injected from before.
How
Call the hook at the end of prepare/settle in capture.ts, on both sides, with the same signature as before. Document which one to use: before to open a state, beforeShot to undo what the scroll pass changed.
Activity