Open reports at first unread action#51366
Open reports at first unread action#51366janicduplessis wants to merge 244 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 👍 |
007ef6c to
cb8fd25
Compare
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.
@rlinoz i think i found a solution for this, but i'm not sure whether we want to add some sort of loading spinner here? You can see the loading bar on the sidebar, once the message is sent, but not sure whether we'll want to also indicate the loading state somewhere else, since a Screen.Recording.2026-04-04.at.12.24.19.movBasically what i'm doing is that we're fetching the very last messages in the chat, appending them to the list of current messages, then scroll to the bottom and then remove the mid-chat report actions page and update the list. This way, we can scroll to the last message without the need to manually reload the whole list |
|
@rlinoz just resolved merge conflicts and re-tested the changes. The base functionality of linking to unread report actions works smoothly and i think we don't have any other edge-cases to cover in this PR. Last tasks for me to do are:
After that, we can hopefully finally merge this beast of a PR 👀 |
|
Discussing here #35011 (comment) before discussing this #51366 (comment) |
|
I think if we are going to add the loading indicator we do as a follow up to this PR, so we only need to do what you mentioned here #51366 (comment) |
|
@rlinoz both of the above points are handled. @aimane-chnaif's changes for LHN action badges should not conflict with this PR and also opening an unread report action with the multi-expense report view works smoothly. ( I think this PR should be ready for a final review and merge! 🙌🏼 |
|
I'll coordinate with @Expensify/design on the implementation of loading states when the report is loading newer/older messages in a follow-up PR. For context, we've previously discussed this in this Slack thread. |
|
@ishpaul777 or @ikevin127 could you please review this PR? Also, @rlinoz could you please remove the |
|
Running an adhoc build, after we finish reviewing I will ask applause to test this as well. |
|
🚧 @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! 🧪🧪
|
|
@ishpaul777 if you could help review this one. |
|
@rlinoz sorry my bad, i forgot to push the last commit for this fix: #51366 (comment) Could you please re-trigger the ad-hoc builds? |
|
@chrispader can you fix the tests, typecheck and lint please? |
|
@rlinoz fixed, there was an invalid import remaining from the merge conflicts... |
|
🚧 @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! 🧪🧪
|
|
It is working pretty well, only issue I found is this one:
We are scrolling to the bottom of the chat, did we discuss this before? Screen.Recording.2026-04-14.at.12.33.36.mov |


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