Repository navigation
Conversation
|
@ahmedGaber93 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] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
Merge main to fix claude code review (doesn't yet work for forks) |
|
Thanks. The PR is ready for review at this time. |
|
Apologies, I accidentally deleted my branch. It has now been restored and the pull request has been reopened |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp20251013131622766.mp4Android: mWeb Chromeaw.mp4iOS: HybridAppi.mp4iOS: mWeb Safariiw.mp4MacOS: Chrome / Safariw.mp4MacOS: Desktopd.mp4 |
|
Bug: All expenses are highlighted when navigate back from report with 1 expense to report with 2 expense
Result: All expenses are highlighted 20250927082824163.mp4 |
Thanks for pointing it out. The issue happened because |
|
@dmkt9 It seems we still have the issue on another place.
20250930081607914.mp4 |
Thanks for the reminder. I just resolved that conflict. |
roryabraham
left a comment
There was a problem hiding this comment.
Hmmmm I'm sorry to leave this review without suggesting a clear alternative, but I think we need to discuss this one further. It just feels like a culmination of some anti-patterns that might need to be unwinded. There's a lot of usePrevious / diff checking.
It seems to me that the root of the problem is that SearchMoneyRequestReportPage isn't re-mounting when the route changes, which results in us having to use a flag such as shouldResetSkipFirstTransactionsChange to reset a hook that itself is used to highlight changes in state between renders.
I'd love to spend some time with you to take a more holistic look at these components and see if we can improve our composition to make them more pure (just rendering based on the props they receive)
|
Maybe by adding a |
Interesting. I think it’s totally doable. We can move |
|
@roryabraham Besides After that, I can go ahead and make a full round of updates. |
|
@roryabraham After testing the approach of moving App/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx Lines 219 to 240 in 98eeb6c To fix this bug, I think we still need to use |
|
I was doing some testing, but I'm not able to reproduce the base issue on main or staging anymore |
|
I’ve just run some tests. It seems that the original issue on iOS is resolved. On Android, the icon still flickers slightly. Additionally, the loading indicator appears very often on Android. 2025-10-23.09-46-45.mp4 |
|
@dmkt9 I've chatted with Cursor about this a bit, and it suggests a simpler solution: diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx
index c20ef96f56a..1b0920ad5c4 100644
--- a/src/pages/Search/SearchMoneyRequestReportPage.tsx
+++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx
@@ -49,7 +49,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
const {isOffline} = useNetwork();
const reportIDFromRoute = getNonEmptyStringOnyxID(route.params?.reportID);
- const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`, {allowStaleData: true, canBeMissing: true});
+ const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`, {canBeMissing: true});
const [reportMetadata = defaultReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, {canBeMissing: true, allowStaleData: true});
const [policies = getEmptyObject<NonNullable<OnyxCollection<Policy>>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {allowStaleData: true, canBeMissing: false});
@@ -133,7 +133,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
reportMetadata={reportMetadata}
policy={policy}
shouldDisplayReportFooter={isCurrentReportLoadedFromOnyx}
- key={report?.reportID}
+ key={reportIDFromRoute}
backToRoute={route.params.backTo}
/>
</DragAndDropProvider>
@@ -169,7 +169,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
reportMetadata={reportMetadata}
policy={policy}
shouldDisplayReportFooter={isCurrentReportLoadedFromOnyx}
- key={report?.reportID}
+ key={reportIDFromRoute}
backToRoute={route.params.backTo}
/>
</View>Do you want to try that out? |
Hi @roryabraham, I’ve tested the proposed solution, but unfortunately I didn’t observe any improvement. That said, I believe the behavior is still understandable since we’re continuing to use the key for This solution2025-10-25.11-34-42.mp4Our PR2025-10-25.11-45-59.mp4 |
heyjennahay
left a comment
There was a problem hiding this comment.
No concern with product change
|
@roryabraham What do you think here #71311 (comment)? |
|
@dmkt9 I don't think I want to merge this PR given that the original issue is no longer reproducible. given that, I'm not sure what problem we're trying to solve. |
|
Hi @roryabraham, I understand that the issue may no longer be as clear as in the OP. If you feel that our PR does not clearly resolve a specific problem, I completely agree with not merging it. However, I would like to add a bit more context to the issue that our PR is aiming to address. There are a few other issues that have also been submitted to fix the avatar flicker problem, for example #75195. You can see the avatar flicker when toggling the enable button. Our case appears to be similar, as shown in the video below: 2025-12-05.14-05-31.mp4I believe this issue is equivalent to issue #75195. If you think it makes sense, we can proceed with this PR, and if the patterns in the PR are not ideal, I can adjust them for clarity. For example, we could slightly change the use of the |
Explanation of Change
Fixed Issues
$ #71117
PROPOSAL: #71117 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Test 1:
Test 2:
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
android.native.mp4
Android: mWeb Chrome
android.mwb.mp4
iOS: Native
ios.native.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
mac.safari.mp4
MacOS: Desktop
mac.desktop.mp4