Open reports at first unread action#51366
Open reports at first unread action#51366janicduplessis wants to merge 273 commits intoExpensify:mainfrom
Conversation
20bb3d2 to
c811ef7
Compare
fb6a2fb to
3b03cef
Compare
b88cba8 to
13de5ad
Compare
|
Oh I guess I am not sure how to assign someone from the @Expensify/design team to the PR, but I think they can help with your question #51366 (comment) |
I personally like this, but I think I would prefer to let an older message slightly peak out from above so there is a little more context that you are starting from a certain point. So basically what you have but maybe push down the starting point by like 56px or 64px or something like that. |
|
Yeah I like that too Shawn! |
|
+1 to that. Always like it when we peek content to show that there's more there |
|
@janicduplessis First of all, props for picking up this veteran difficulty level issue, doing such great work on it so far and getting it so close to completion 🚀 👋 Please tag me before merging this in case I don't get notified because I'd like to run some tests myself to make sure this works as expected, I have 2 scenarios in mind:
Note: I'm one of the contributors which attempted to fix this from FE only but ultimately figured out it won't work and suggested a BE + FE implementation discussion months ago before Rory went on parental leave. How did I get here ? Another C+ reviewer asked just yesterday about an issue on Slack, which will basically be fixed by this PR - that's how I remembered this 1 year old issue and decided to join the testing effort as well since I have some context on this. Note: No compensation needed, just want to help 👍 |
cb8fd25 to
4a9ef9f
Compare
|
@ishpaul777 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] |
|
This is ready for review and further testing. Sadly adjusting the scroll position so the newest message is near the top ended up very difficult with the way we handle opening the list in the middle of a chat. I think we should punt that for later since this is already taking longer than I would have liked. |
| // This scrolls the unread action at the top of the screen. | ||
| viewPosition: 1, | ||
| // This makes sure that the unread indicator doesn't get cut off. | ||
| viewOffset: -64, |
There was a problem hiding this comment.
Sadly adjusting the scroll position so the newest message is near the top ended up very difficult with the way we handle opening the list in the middle of a chat.
how is this relevant if the last unread message is show at the bottom not the top?
There was a problem hiding this comment.
From Flatlist's scrollToIndex() docs:
Scrolls to the item at the specified index such that it is positioned in the viewable area such that
viewPosition0 places it at the top, 1 at the bottom, and 0.5 centered in the middle.
There was a problem hiding this comment.
This is actually not needed anymore.
|
Did the first pass of testing on the web desktop, and it work really well no issues spotted so far, Great Work @janicduplessis 🥇 Screen.Recording.2025-02-26.at.12.54.52.AM-1.movI'll test more and update back soon... @janicduplessis we have some conflicts can you please resolve them |
|
@rlinoz i'm currently investigating whether we can achieve this feature with the new FlashList implementation. Basically, lots of the logic we needed for |
|
🚧 @rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚧 @rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
…onID based on treatAsNoPaginationAnchor
Valid comment. This is redundant and also in-place mutations are bad. Fixed this!
Also valid. Weird this didn't cause any issues with the rendering logic so far 🤔 Fixed!
Addressed!
Outdated, i removed this hook because it's no longer needed with FlashList
I don't think this edge-case has ever happened so far. Agree that this might be a race condition, but fixing it would mean that we have to await the promise from @rlinoz do you think we should handle this or simply ignore? The potential result would not be critical anyway. We can fix if this ever occurs.
Outdated, we don't need the changes in
Addressed!
Also going to ignore this until this really becomes a problem. Implementing an escape hatch would mean to add an alternative timeout, after which the
Addressed!
This needs to run during render, because it affects the initial render. Moving this to an effect wouldn't work.
Addressed!
Added tests for these functions
Removed.
Addressed.
Outdated, this code has been removed. |
…`, `selectNewestPageWithIndex` and `prunePagesToNewestWindow`
|
@rlinoz i've detected one minor issue with recent changes that i still need to fix. Other than that, we're good to go |


Details
Implements opening reports at the last unread message. This builds on top of #52149 to be able to start our list at any item. This removes a few assumptions that open report will always open at the newest action.
Fixed Issues
$ #35011
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Screen.Recording.2025-01-27.at.23.42.32.mov
Android: mWeb Chrome
Screen.Recording.2025-01-27.at.23.37.31.mov
iOS: Native
Screen.Recording.2025-01-27.at.22.56.37.mov
iOS: mWeb Safari
Screen.Recording.2025-01-27.at.23.02.45.mov
MacOS: Chrome / Safari
Screen.Recording.2025-01-27.at.22.33.19.mov
MacOS: Desktop
Screen.Recording.2025-01-27.at.23.32.32.mov