-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix new messages indicator after comment linking #55582
Fix new messages indicator after comment linking #55582
Conversation
@hoangzinh 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] |
Bug 1: Click on "New messages" indicator, it doesn't scroll to the latest message Screen.Recording.2025-01-22.at.09.01.30.mov |
@hoangzinh Ok I found the problem, when trying to scroll at the bottom of the list, we also need to adjust the displayed data in BaseInvertedFlatList. This is also a regression from #52149. |
Thank you @janicduplessis |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-01-22.at.23.02.10.android.movAndroid: mWeb ChromeScreen.Recording.2025-01-22.at.23.03.53.android.chrome.moviOS: NativeScreen.Recording.2025-01-22.at.23.08.09.moviOS: mWeb SafariScreen.Recording.2025-01-22.at.23.04.43.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2025-01-22.at.22.59.35.desktop.movMacOS: DesktopScreen.Recording.2025-01-22.at.22.51.52.web.mov |
@janicduplessis could you quickly share which logic was used to detect the comment link didn't work since above PR? |
// Display the new message indicator when comment linking and not close to the newest message. | ||
const reportActionID = route?.params?.reportActionID; | ||
const indexOfLinkedAction = reportActionID ? sortedVisibleReportActions.findIndex((action) => action.reportActionID === reportActionID) : -1; | ||
const isLinkedActionCloseToNewest = indexOfLinkedAction < 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on testing in Prod, it should be 15 or something. Btw, we should move this into a constant
Screen.Recording.2025-01-22.at.18.30.28.mov
Hey gents, any updates? 🙏 |
@Beamanator I just ping @janicduplessis in Slack https://expensify.slack.com/archives/C01GTK53T8Q/p1737557782650459?thread_ts=1737467569.939969&cid=C01GTK53T8Q. I tested this PR and it fixed DB, but just small feedback here #55582 (comment). Not sure if it's a blocker |
Before #52149 we used to paginate the cached messages in ReportActionsView to be able to start the list at a specific message, now that pagination is done in BaseInvertedFlatList. Some code checks |
Thanks both, so @hoangzinh are you proceeding with the checklist? 🙏 |
Yes @Beamanator. I just did for Web, I'm doing for remaining plaforms |
@janicduplessis could you add recordings for other platforms as well? Also, can you prefix "number" to testing steps for readability? |
@janicduplessis please also complete checkboxes under QA sections |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.0.89-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.89-8 🚀
|
Explanation of Change
This fixes the new messages indicator that should appear after comment linking, even if no new messages exist. The logic it used to detect if it was a comment link didn't work anymore since #52149, and I think doing it this way is better and more reliable.
What we do is check the index of the linked message and if it is bigger than 5 (arbitrary number to say we are far from the start of the chat) and leverage the existing
isFloatingMessageCounterVisible
state. We also check in an effect when the route change to make sure it is displayed again when linking to a message in the same chat.Fixed Issues
$ #55530
PROPOSAL:
Tests
Offline tests
QA Steps
Pre-condition:
Send 200 messages from Account A to Account B.
Steps :
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2025-01-22.at.12.41.14.mov
Android: mWeb Chrome
Screen.Recording.2025-01-22.at.12.46.01.mov
iOS: Native
Screen.Recording.2025-01-22.at.12.26.19.mov
iOS: mWeb Safari
Screen.Recording.2025-01-22.at.12.07.05.mov
MacOS: Chrome / Safari
Screen.Recording.2025-01-21.at.18.24.50.mov
MacOS: Desktop