-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Open reports at first unread action #51366
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Flatlist's scrollToIndex()
docs:
Scrolls to the item at the specified index such that it is positioned in the viewable area such that
viewPosition
0 places it at the top, 1 at the bottom, and 0.5 centered in the middle.
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.
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 |
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.
♻️ Reporting on my previous comment:
- ✅ opening a report for the first time on fresh login, with 300-500 unread new messages: works well, tested both with fresh login and Clear cache and reset
- ✅ opening a report for the first time on fresh login where the last read message was deleted in the meantime: works well, looks like the current behaviour is that when the last read message is deleted, the one underneath (right below) will become the last read 👍
🗒️ Notes:
- I only tested on web-based platforms (Web / mWeb / Desktop)
- I did not fully test the manual
Mark as unread
functionality but from the test mentioned above it seems to work as expected 👍
Friendly bump @janicduplessis to resolve conflicts so @ishpaul777 can continue his review 😄 |
Conflicts fixed! |
On my list today! |
tested more on web, in most cases it works well but on very large chat while marking the first message as unread and going back to it does not scroll to unread message room link Screen.Recording.2025-03-05.at.1.59.20.AM.movMobile apps testing in progress Bug? ![]() |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-03-05.at.3.25.20.AM.movAndroid: mWeb ChromeiOS: NativeScreen.Recording.2025-03-05.at.3.28.47.AM.moviOS: mWeb SafariScreen.Recording.2025-03-05.at.3.39.09.AM.movMacOS: Chrome / SafariScreen.Recording.2025-03-05.at.2.15.30.AM.movMacOS: Desktop |
Hey what is the latest on this one? @janicduplessis @ishpaul777 |
2 issues spotted while testing #51366 (comment) |
Hey @janicduplessis were you able to take a look at the 2 issues? |
Hey, sorry I wasn’t available last week, I should be able to have a look soon |
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 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
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