-
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
Move logic to start report actions list at index to BaseInvertedFlatList #52149
Move logic to start report actions list at index to BaseInvertedFlatList #52149
Conversation
db777e7
to
da55621
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] |
As you can see in the videos there seems to be a lot of jumping going on after comment linking on native platforms (ios / android). It also happens on main so it is not related to this change. I will try to take some time soon to investigate those, especially important since we're going to use that case more now if opening at last unread. |
@rlinoz Are you able to consistently reproduce? I am trying the same thing as the video, but the messages do load. This is with messages already in cache. |
Its on my radar, i'll review try to review this sometime tmrw 🙇 |
@ishpaul777 friendly bump
I will check again and try to get better steps |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-12-15.at.1.53.29.AM-1-1.movAndroid: mWeb ChromeScreen.Recording.2024-12-15.at.2.07.31.AM.moviOS: NativeScreen.Recording.2024-12-15.at.1.14.40.AM-1.moviOS: mWeb SafariScreen.Recording.2024-12-15.at.1.23.40.AM.movMacOS: Chrome / SafariScreen.Recording.2024-12-15.at.1.40.07.AM-1.movMacOS: DesktopScreen.Recording.2024-12-15.at.2.24.52.AM-1.mov |
Bug?: New message fetching and redering is quite jerky as compare to staging it often skips many messages load to end staging Screen.Recording.2024-11-18.at.1.38.18.AM.movThis branch Screen.Recording.2024-11-18.at.1.36.27.AM.mov |
@ishpaul777 I can reproduce the problem, looking at it now, thanks! |
That was harder that I thought to fix, I missed part of what the code did. It also handle pagination cases when new items are added, it adds it progressively to make sure no jumping happens. |
Bug: Now i can't scroll down after linking to Screen.Recording.2024-11-21.at.12.17.07.AM.mov |
@@ -582,7 +578,7 @@ function ReportActionsList({ | |||
({item: reportAction, index}: ListRenderItemInfo<OnyxTypes.ReportAction>) => ( | |||
<ReportActionsListItemRenderer | |||
reportAction={reportAction} | |||
reportActions={reportActions} | |||
reportActions={sortedReportActions} |
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.
i dont understand the intention of doing this, Can you please clarify?
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.
ah i got it sortedReportActions and reportActions are same reportActions passed from ReportActionsView.tsx
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.
Yea, kind of unrelated cleanup
Oh strange, I was testing this exact case. Will check tomorrow. |
Seems to only happen if the screen is high enough, that's why I didn't catch it during testing. I can now repro. |
Hey @janicduplessis any news on this one? |
Hey, I haven't had much availability in the past few weeks, will try to pickup work on it soon! |
@janicduplessis Did you get chance to look into this? |
Sorry about the delay, will be able to look at this tomorrow. |
@ishpaul777 Are you still able to reproduce the issue? Weirdly I am not able to anymore even with increasing my screen resolution like I did last time. |
i'll test again shortly 🙇 |
I can still reproduce, but on a different message not the first Screen.Recording.2024-12-07.at.2.39.13.AM.mov |
Yes I'll review today |
Conflicts fixed |
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!
I think we may have broken the jump to new message button, but I can't repro every time
Screen.Recording.2024-12-16.at.11.01.51.mov |
@janicduplessis friendly bump on the above |
Any updates @janicduplessis ? |
waiting for update from @janicduplessis |
Sorry about the delay I was OOO for the last weeks, going to pickup work on this. |
Hey @janicduplessis do you have an idea of when you will be able to pick this up again? |
Worked on this today a little bit, I am able to repro the issue so debugging that now. I also found another bug while trying to reproduce this, but not related as it happens on main. Will report that in slack. |
@rlinoz Good catch, fixed now! |
Nice! I think we have a few failling tests though @janicduplessis |
bump on this one @janicduplessis |
Working on fixing tests today! |
@rlinoz Tests are now fixed. I ended up extracting the batching logic to make it easier to mock it in the tests so we can keep the rendering sync and simpler. There are a few lints errors that are popping now, but I didn't change that code, do you know if I need to do something about it? |
Thanks @janicduplessis , I will review again For the lint errors, I think since this PR touches the files and they all look like simple changes ideally we should fix here |
Sounds good, will fix it today |
@rlinoz All checks are passing now, the last commit includes the fix for the lint error. |
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.
It is testing well, thanks for all the effort!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Explanation of Change
This PR is the first step towards being able to open chats at the last unread message. We currently have some logic to open a chat at a specific message for comment linking, but this code is heavily coupled with the comment linking code and ReportActionsView. This moves the logic that allows the list to open at a specific index to
BaseInvertedFlatList
which will make it easy to reuse for opening chat at last unread also.FlatList
has ainitialScrollIndex
prop, but it doesn't work very well, it also doesn't work at all if the index is too big and is not rendered initially. To avoid this problem we implemented a workaround in the comment linking code. What we do is render the list initially from the initial index we want and progressively add items before it inonStartReached
.This code can actually be completely decoupled from the comment linking logic and just make the
initialScrollIndex
prop ofBaseInvertedFlatList
use that same logic. This is what this PR does.Fixed Issues
$ #35011
PROPOSAL:
Tests
Offline tests
QA Steps
Test 1: Basic Navigation
Note: Links can be copied to any message and used in any order.
Test 2: Popup Navigation
Test 3: Cache and Logout
Test 4:
Notes:
Ensure the chat contains at least 150 messages. Initially, up to 50 messages are rendered. Navigating to the 70th message should allow further navigation up to the 150th message, even with gaps.
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.2024-11-06.at.20.25.35.mov
Android: mWeb Chrome
Screen.Recording.2024-11-06.at.20.41.28.mov
iOS: Native
Screen.Recording.2024-11-06.at.20.24.18.mov
iOS: mWeb Safari
Screen.Recording.2024-11-06.at.20.49.38.mov
MacOS: Chrome / Safari
Screen.Recording.2024-11-06.at.19.13.27.mov
MacOS: Desktop
Screen.Recording.2024-11-06.at.19.45.38.mov