Reddit Multi Column: rework iOS stacked-flash fix with a navigation veil (v0.3.25)#21
Merged
Merged
Conversation
…eil (v0.3.25) Reverts the 0.3.24 durable-marker approach and replaces it. The marker was never cleared, so when Reddit reused a feed DOM node for a later page the script kept the reused node hidden — blanking content and leaving only the left rail. It also only ever hid the PREVIOUS feed, so it never covered a freshly-rendered one (the back-navigation flash). New approach, with no durable per-node state and no chrome changes (the left rail handling is untouched): 1. Navigation veil: a class on <html> added synchronously the instant a wide-screen SPA navigation begins (in onNavigate). While set, one CSS rule hides every <shreddit-feed> (opacity only, so IntersectionObserver lazy-load still runs; !important so it beats the inline opacity the grid manages). This covers both the previous feed lingering through Reddit's slow iOS/iPadOS swap AND any feed Reddit renders fresh on the new page (the back-nav flash a per-node hide can't catch). Lifted on the first real reveal and unconditionally after MAX_HIDE_MS, so a feed can never get stuck invisible; gated on viewport width so phones / portrait tablets stay fully native. 2. priorFeed memory across a push->replace pair: Reddit opens a post with a pushState immediately followed by a replaceState to the canonical permalink (two path changes in one task). The first nulls `parent`; the old code then overwrote priorFeed with null on the second and forgot the feed. priorFeed is now only refreshed when a feed is actually held, so the post-detail feed stays correctly suppressed past the veil. Verified in a headless-browser harness modelling the slow swap. Against 0.3.23, forward double/triple-nav AND "post then BACK with a fresh feed" all flashed every card at full opacity (the back case 90 frames); after this change every scenario flashes zero frames, back-navigation and feed-to-feed re-grid and reveal correctly, a genuine profile/search mixed feed stays visible (not blanked), and the veil never engages on a narrow/native screen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DLuykcA557aWJq7fCrwToV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The previous fix (v0.3.24, #20) caused two problems reported in testing:
This reverts that approach and replaces it with something that needs no durable per-node state and makes zero changes to the chrome/sidebar logic (the left-rail handling is byte-for-byte identical to 0.3.23).
What
1. Navigation veil. A class (
rmc-veil) is added to<html>synchronously the instant a wide-screen SPA navigation begins (inonNavigate, which runs from the patchedpushState/replaceState/popstate). While it's set, a single CSS rule hides every<shreddit-feed>:!importantso it beats the inline opacity the grid manages.MAX_HIDE_MS, so a feed can never get stuck invisible.2.
priorFeedmemory across apush→replacepair. Reddit opens a post with apushStateimmediately followed by areplaceStateto the canonical permalink (two path changes in one task). The first nullsparent; the old code then overwrotepriorFeedwithnullon the second and forgot the feed. It's now only refreshed when a feed is actually held, so the post-detail feed stays correctly suppressed past the veil.No persistent markers, no extra chrome rewriting.
Verification
Headless-browser harness (Playwright + Chromium) serving a mock Reddit SPA, injecting the real userscript, gridding the feed, then driving SPA navigations with the slow iOS-style swap. A
MutationObserver(the settled state about to paint) + rAF sampler flag any frame where a feed is effectively visible and un-gridded — path-aware so a genuine profile/search native feed isn't counted.The back-navigation case (90 flash frames in 0.3.23) is the one the marker approach never touched and is the most likely source of the "still happens" report. Stable across repeated runs (9/9 green).
🤖 Generated with Claude Code
Generated by Claude Code