Skip to content

fix: exempt scroll mark read after refresh - #4946

Merged
DIYgod merged 1 commit into
devfrom
DIYgod/exempt-fresh-scroll-read
Apr 2, 2026
Merged

fix: exempt scroll mark read after refresh#4946
DIYgod merged 1 commit into
devfrom
DIYgod/exempt-fresh-scroll-read

Conversation

@DIYgod

@DIYgod DIYgod commented Apr 2, 2026

Copy link
Copy Markdown
Member

Description

Prevent freshly refreshed entries from being marked as read by the "When Scrolling Past Article" behavior on desktop and mobile.
Add a shared 1s grace period after list refresh and apply it only to scroll-based marking, while keeping render or in-view marking unchanged.
Cover the desktop list and picture masonry flows plus the mobile article, social, video, and picture lists.

PR Type

  • Feature
  • Bugfix
  • Hotfix
  • Other (please describe):

Screenshots (if UI change)

N/A

Demo Video (if new feature)

N/A

Linked Issues

N/A

Additional context

Validated with pnpm run typecheck, pnpm run lint:fix, and pnpm run test.

Changelog

  • I have updated the changelog/next.md with my changes.

@DIYgod
DIYgod enabled auto-merge (squash) April 2, 2026 07:17
@DIYgod
DIYgod merged commit ce5e919 into dev Apr 2, 2026
10 of 12 checks passed
@DIYgod
DIYgod deleted the DIYgod/exempt-fresh-scroll-read branch April 2, 2026 07:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f41a4ee68f

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
}, [gracePeriodMs, refreshing])

return isScrollMarkReadPaused

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Return paused state immediately when refresh starts

useScrollMarkReadGracePeriod only flips isScrollMarkReadPaused inside a passive useEffect, so the first render where refreshing becomes true can still return false and allow scroll-based marking to run. In desktop flows (e.g. picture masonry observer callbacks), this creates a race at refresh start where freshly refreshed items can still be marked as read before the effect executes, which defeats the guard this change is adding.

Useful? React with 馃憤聽/ 馃憥.

Comment on lines +23 to +25
useEffect(() => {
processedEntryIds.current.clear()
}, [entriesIds])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear processed entry IDs before range callbacks run

Switching processedEntryIds reset to useEffect leaves old IDs in place until after commit, but range updates can fire earlier via virtualization callbacks; the first callback after an entriesIds swap can therefore treat refreshed entries as already processed and skip batchMarkRead. This regression was introduced by moving from render-time reset (useMemo) to post-render reset (useEffect).

Useful? React with 馃憤聽/ 馃憥.

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