Repository navigation
feat: hide viewed stories by dwell time - #136
Merged
Merged
Conversation
Track viewed items with an absolute expiresAt model and dwell-based TTL tiers (12h for <3s, 24h for 3-60s, 48h for >60s; 5 days on title click). Add a useViewDwell hook that measures visible dwell and extends (never shortens) the hide window; re-views skip the write when they wouldn't extend it. Also wrap touch event dispatches in act() to clear useSwipeScroll test warnings. Consolidate the parallel title/detail time stores behind a single createTimeMap factory, and make its load() tolerant of a corrupt/foreign value at the key: only a plain object with finite-number values is a valid id->expiresAt map (a non-number would poison the Math.max merge with NaN and wedge the entry). Strengthen the mobile swipe filter e2e to assert the hidden story is actually gone rather than merely that a panel renders. Guard the e2e swipe helper against a transient 0-width container read that made the offline end-of-feed test crash with "Invalid array length" on Firefox, and pass waitForSwipeReady's timeout in the options arg so its intended 5s limit is actually applied. Backfill the highest-value test gaps: the useViewDwell re-key path (swipe A->B finalizes A's tier and floors B) and its pagehide finalize; SwipeStoryViewerCore mount-snapshot filtering (session-exempt keep + all-filtered fallback); and the load() guard's array-discard and non-number-value branches.
therealsama
enabled auto-merge
June 7, 2026 21:56
kplachkov
approved these changes
Jun 7, 2026
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.
Track viewed items with an absolute expiresAt model and dwell-based TTL tiers (12h for <3s, 24h for 3-60s, 48h for >60s; 5 days on title click). Add a useViewDwell hook that measures visible dwell and extends (never shortens) the hide window; re-views skip the write when they wouldn't extend it. Also wrap touch event dispatches in act() to clear useSwipeScroll test warnings.
Consolidate the parallel title/detail time stores behind a single createTimeMap factory, and make its load() tolerant of a corrupt/foreign value at the key: only a plain object with finite-number values is a valid id->expiresAt map (a non-number would poison the Math.max merge with NaN and wedge the entry). Strengthen the mobile swipe filter e2e to assert the hidden story is actually gone rather than merely that a panel renders.
Guard the e2e swipe helper against a transient 0-width container read that made the offline end-of-feed test crash with "Invalid array length" on Firefox, and pass waitForSwipeReady's timeout in the options arg so its intended 5s limit is actually applied.
Backfill the highest-value test gaps: the useViewDwell re-key path (swipe A->B finalizes A's tier and floors B) and its pagehide finalize; SwipeStoryViewerCore mount-snapshot filtering (session-exempt keep + all-filtered fallback); and the load() guard's array-discard and non-number-value branches.