Repository navigation
Show Latest messages pill in read chats by using ACTION_VISIBLE_THRES… - #100793
tylerkaraszewski merged 4 commits into
Conversation
|
@ZhenjaHorbach Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1821c07825
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-09-17.11.57.20.movAndroid: mWeb Chrome2026-09-17.11.57.20.moviOS: HybridApp2026-09-17.11.52.58.moviOS: mWeb Safari2026-09-17.11.45.21.movMacOS: Chrome / Safari2026-09-17.11.42.55.mov |
|
Resolved the merge conflicts and merged latest |
|
@ZhenjaHorbach - the reviewer checklist is not complete. Are you still working on it? |
Yes |
|
Conflicts |
…ages-pill-read-chat
|
Minor conflicts |
|
🚧 tylerkaraszewski has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/tylerkaraszewski in version: 9.4.90-0 🚀
|
|
🤖 No help site changes are required for this PR. I did not create a docs PR. Why: this PR only changes a scroll threshold constant so the existing Latest messages pill appears in short, already-read chats. It adds no feature, no setting, and no user-facing copy. The help site never documented the pill or the 2000px behavior, so there is nothing to correct. What I checkedThe change — The docs — I searched all of
Per HELP_AUTHORING_GUIDELINES.md, help articles cover what a user needs to do a task. A pill that appears automatically when you scroll up needs no instruction, and documenting a restored default would add noise rather than help. If you would rather have the pill documented anyway — for example a short "Return to the newest message" step in a chat article — reply and I will draft it. @yusufdeveloper2903, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.4.90-2 🚀
Bundle Size Analysis (Sentry): |
| @@ -89,7 +89,7 @@ export default function useReportUnreadMessageScrollTracking({ | |||
|
|
|||
| // display floating button if we're scrolled more than the offset | |||
| if ( | |||
There was a problem hiding this comment.
Lowering this from 2000 to ACTION_VISIBLE_THRESHOLD (250) made the pill depend on a stale scrollOffsetRef. When a chat is opened from a link to an old message and the user sends a message, the list remounts at the live tail at offset 0 and emits no scroll event. The next onContentSizeChange calls trackVerticalScrolling(undefined), sees the old offset is above 250 and shows "Latest messages" again, even though the list is already at the bottom. With the 2000 threshold most stale offsets stayed below the limit, so this was rarely visible.
The tests added here only covered real scroll events, so they could not catch it.
Explanation of Change
In a chat with no unread messages, the "Latest messages" pill only appeared after scrolling more than
LATEST_MESSAGES_PILL_SCROLL_OFFSET_THRESHOLD(2000px). Chats with a shorter scroll range never reach that, so the pill never showed. The rest of the app already treats 250px (ACTION_VISIBLE_THRESHOLD) as "away from the newest message".This PR removes the 2000px constant and uses
ACTION_VISIBLE_THRESHOLDfor both the show and hide checks inupdatePillVisibility. Both checks have to change, otherwise the pill flickers between visible and hidden on every scroll event. All other guards are unchanged (unread marker, aligned-to-top, newer actions, initial positioning). Unit tests now cover a short read chat, consecutive scroll events, the lower bound, and unread chats.Fixed Issues
$ #98708
PROPOSAL: #98708 (comment)
Tests
Offline tests
Same as tests, while offline. The change only affects scroll-based UI and has no network dependency.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
BEFORE FIX:
REC-20260910123238.mp4
AFTER FIX:
REC-20260910123402.mp4
Android: mWeb Chrome
AFTER FIX:REC-20260910124023.mp4
iOS: Native
AFTER FIX:REC-20260910124935.mp4
iOS: mWeb Safari
AFTER FIX:REC-20260910125059.mp4
MacOS: Chrome / Safari
AFTER FIX:REC-20260910125158.mp4