-
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
Blinking on chat switching #39040
Blinking on chat switching #39040
Conversation
@hungvu193 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] |
hey @perunt , can you please add the QA and Tests steps? Thank you 😄 |
Does this also resolve this one: #38838? |
Based on the contributors' RCA, this PR should fix it as well. Please link it in the fixed issues. |
Do you wanna take this one? Since you followed this one from start? |
I'd love to, thanks 🙇 |
@paultsimura Let's raise on slack so some internal engineers can assign you 😄 |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid15.32.mp4Android: mWeb Chromechrome15.40.mp4iOS: NativeSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-03-27.at.15.21.4115.22.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-03-27.at.15.35.2515.40.mp4MacOS: Chrome / SafariScreen.Recording.2024-03-27.at.15.16.1515.16.mp4MacOS: DesktopScreen.Recording.2024-03-27.at.15.46.5115.47.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.
LGTM ✔️
We did not find an internal engineer to review this PR, trying to assign a random engineer to #38909 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
@@ -133,6 +133,10 @@ function ReportActionsView({ | |||
}, [route]); | |||
|
|||
const listID = useMemo(() => { |
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.
@perunt Would you kindly add a comment above the listID
declaration describing its role and why it is passed down to the FlatList component as (React) key
instead of passing it to the existing extraData
array here ?
I also asked in #38838 (comment) as part of #38838 (issue).
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.
Hey! Definitely, I'll put my comment up top so it's easier to spot. Thanks!
So, here's the deal: I need to make the whole list refresh itself from scratch. It's all about the virtualization thing the list does. Basically, this refresh trick is mostly needed when you're linking comments, especially when jumping from looking at a bunch of messages to just a few. The virtualization in FlatList gets a bit wonky when the amount of stuff shown shrinks as you move to a specific message. So, to keep everything looking right, we gotta refresh the whole list, not just poke the FlatList to update what it's already showing. So if we put it to extraData
, the comment linking would lead to the wrong place in some specific cases
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.
let me check your links, will also leave this info there
const listID = useMemo(() => { | ||
if (!reportActionID) { | ||
// We only trigger a change of the list ID for comment linking to ensure proper positioning | ||
// here we avoid of using it if we're not in the Comment Linking flow |
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.
Now this comment is a bit unclear. Let's change to this:
// here we avoid of using it if we're not in the Comment Linking flow | |
// Keep the old list ID since we're not in the Comment Linking flow |
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.
👍🏻
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 ✔️
@NikkiWines all yours |
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.
@NikkiWines looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
✋ 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/NikkiWines in version: 1.4.58-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.58-8 🚀
|
if (!reportActionID) { | ||
// Keep the old list ID since we're not in the Comment Linking flow | ||
return listOldID; | ||
} |
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.
We missed the case where we switch from a report with comment linking to a report without comment linking, in this case we shouldn't use the same list id
- reportActionID: 123 -> reportActionID: 555 => Use different id
- reportActionID: 123 -> reportActionID: null => Use different id
- reportActionID: null -> reportActionID: 123 => Use different id
- reportActionID: null -> reportActionID: null => Use same id
(Coming from #45004)
Details
Fixed Issues
$ #38909 #38838
PROPOSAL:
Tests
Offline tests
QA Steps
Test 1
Test 2
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
2024-03-27.13.11.24.mp4
Android: mWeb Chrome
2024-03-27.13.27.37.mp4
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-27.at.13.18.42.mov
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-27.at.13.24.11.mov
MacOS: Chrome / Safari
Untitled.3.mov
MacOS: Desktop
Untitled.4.mov