Skip to content

Honor Mark as Seen On Scroll in Gallery Mode - #64

Open
fede-oss wants to merge 1 commit into
dmilin1:masterfrom
fede-oss:feature/gallery-mark-seen-on-scroll
Open

Honor Mark as Seen On Scroll in Gallery Mode#64
fede-oss wants to merge 1 commit into
dmilin1:masterfrom
fede-oss:feature/gallery-mark-seen-on-scroll

Conversation

@fede-oss

Copy link
Copy Markdown

Summary

Gallery Mode now honors the existing Mark as Seen On Scroll setting.

  • Tracks Gallery media by stable post/media identity instead of list indices, so masonry item reordering cannot cause incorrect seen state.
  • Marks a single-media post after its tile has been viewed and leaves the viewport while scrolling forward.
  • For albums, waits until every media tile has actually been viewable and no tile from that post remains visible before marking the post seen.
  • Does not mark posts when tiles leave the viewport during backward scrolling.
  • Reuses the existing markPostSeen persistence path; no API, schema, or settings changes are needed.
  • Avoids the added scroll/viewability tracking entirely when Mark as Seen On Scroll is disabled.
  • Uses stable postId-mediaIndex Gallery keys and documents the Gallery behavior.

Tests

Added focused GallerySeenTracker coverage for:

  • single-media posts
  • multi-media albums
  • overlapping album tile visibility changes
  • unviewed album tiles
  • backward scrolling
  • duplicate viewability callbacks/idempotency
  • multiple posts leaving view in one callback

Full validation on the fork's GitHub-hosted Ubuntu runner:

  • npm ci
  • npm test
  • npm run tsc
  • npm run lint

I also exercised the tracker locally with randomized state-machine safety checks and randomized two-column masonry scroll simulations to verify that posts are never emitted before all of their Gallery tiles have been viewed and passed, and that reverse scrolling does not create seen marks.

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