-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Cleanup: Simplify navigateToMostRecentReport function #42365
Cleanup: Simplify navigateToMostRecentReport function #42365
Conversation
const reportID = currentReport?.reportID; | ||
const sortedReportsByLastRead = ReportUtils.sortReportsByLastRead(Object.values(allReports ?? {}) as Report[], reportMetadata); | ||
|
||
// We want to filter out the current report, hidden reports and empty chats |
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.
Filtering out the current report:
This is now part of findLastAccessedReport
.
Filtering out hidden reports:
This is not needed. We should navigate to the recent report no matter its notification preference. I believe this was done initially as a workaround because after you leave a workspace room we just change its notification status and we wanted to avoid landing on the same report. This problem is solved by excluding the current report.
Filtering out empty reports:
This is also not needed. I believe this was done as workaround because it was possible that you land on a chat that you never visited before. This is no longer a problem since sortReportsByLastRead
will filter such reports (reports that do not have lastReadTime
field).
Reviewer Checklist
Screenshots/VideosAndroid: NativeCleanShot.2024-05-19.at.12.35.14.mp4Android: mWeb ChromeCleanShot.2024-05-19.at.12.38.17.mp4iOS: NativeCleanShot.2024-05-19.at.13.03.07.mp4iOS: mWeb SafariCleanShot.2024-05-19.at.12.50.57.mp4MacOS: Chrome / SafariCleanShot.2024-05-19.at.11.49.11.mp4MacOS: DesktopCleanShot.2024-05-19.at.13.12.55.mp4 |
@fedirjh Can you please give this a fresh test |
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.
Screenshots/Videos
Android: Native
CleanShot.2024-07-01.at.02.13.01.mp4
Android: mWeb Chrome
CleanShot.2024-07-01.at.02.15.28.mp4
iOS: Native
CleanShot.2024-07-01.at.02.09.41.mp4
iOS: mWeb Safari
CleanShot.2024-07-01.at.02.07.58.mp4
MacOS: Chrome / Safari
CleanShot.2024-07-01.at.02.00.57.mp4
MacOS: Desktop
CleanShot.2024-07-01.at.02.17.59.mp4
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.
Looks good and tests well
✋ 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/marcaaron in version: 9.0.4-0 🚀
|
🚀 Cherry-picked to staging by https://github.com/tgolen in version: 9.0.4-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
cc @marcaaron
Details
Part of #40187.
Fixed Issues
$ #40187
PROPOSAL:
Tests
Test 1 (Leaving a group chat):
Test 2 (Leaving a room):
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
android.mov
Android: mWeb Chrome
Networking issue
iOS: Native
ios.mov
iOS: mWeb Safari
mweb-safari.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov