Updated selected transaction If getting new updates#49829
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-10-03_10.55.25.mp4Android: mWeb Chromeandroid-chrome-2024-10-03_10.57.49.mp4iOS: Nativeios-app-2024-10-03_11.26.32.mp4iOS: mWeb Safariios-safari-2024-10-03_11.28.15.mp4MacOS: Chrome / Safaridesktop-chrome-2024-10-03_10.45.15.mp4MacOS: Desktopdesktop-app-2024-10-03_10.49.43.mp4 |
|
@cretadn22 You have conflicts! |
|
This looks good and is testing well. I agree with the approach for the bulk action as it makes sense that once you make an action, your selection is reset. I'm only unsure about the flow when opening a transaction detail view; here having the selection reset feels a bit unnatural/unusual. @luacmartins Do you have any thoughts, or should we just go with this for now? desktop-chrome-transaction-detail-2024-09-27_14.38.48.mp4 |
|
I agree that it feels a bit weird to deselect everything when a user takes an action on the report/transaction RHP view. @JmillsExpensify what do you think? |
|
Yes, agreed that we shouldn't de-select based on a specific user action in the report/transaction, because those are technically actions that are happening elsewhere anyway (specifically the individual report or transaction itself). |
|
@cretadn22 Can you look into a solution that addresses this issue? |
|
@jjcoffee I am working on another solution. My idea is reset selected transaction when we hold/unhold options |
4d1ee9c to
f8769d8
Compare
|
@cretadn22 Thanks for the changes, they seem to work well! Can you give a brief explanation of the new approach? Also, just to flag that now when bulk selecting and choosing an action, the selection will no longer reset as with the previous approach. Are we happy with that? @luacmartins @JmillsExpensify |
|
@cretadn22 This is maybe not a blocker, but I feel like the bulk action menu should be optimistically updated. Currently on slower connections the menu item won't switch (e.g. Hold --> Unhold) until the API request completes. |
@jjcoffee I forgot to give an update. Here's my summary: Currently, the SearchPage uses data from ONYXKEYS.COLLECTION.SNAPSHOT, and the selected transaction is stored in the search context. When ONYXKEYS.COLLECTION.SNAPSHOT is updated, we need to updated the selected transaction in the context to ensure the value remains is up-to-date. This PR addresses that.
We don't update anything here, keep the old behavior on staging |
I don't quite understand the issue. It worked smoothly on my end. Could you provide a video to help clarify? |
|
I will update new videos soon |
Test with network conditions set to Slow 3G, for example. It might be that the snapshot is not updated optimistically though, in which case fixing would be out of scope for this issue, I think! |
Yes, I think Jason confirmed that here |
That was confirming that we shouldn't deselect after holding from the transaction detail view (in the RHP), which has now been implemented. But with the new approach there's also no deselection after the bulk action is made, which is the same behaviour as on staging so not a big issue but just wanted to raise it in case! |
|
Ah I see what you're saying. Yea, let's keep the behavior we already have |
This comment was marked as outdated.
This comment was marked as outdated.
Yeah, got it! |
|
@jjcoffee I already updated the test steps and all videos. |
|
✋ 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/luacmartins in version: 9.0.45-1 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.45-4 🚀
|
| }); | ||
| setSelectedTransactions(newTransactionList, data); | ||
| // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps | ||
| }, [data, setSelectedTransactions]); |
There was a problem hiding this comment.
Is the link above correct? It's a reference to this PR
Details
Fixed Issues
$ #49795
PROPOSAL: #49795 (comment)
Tests
Same QA steps
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Screen175.mov
Android: mWeb Chrome
Screen174.mov
iOS: Native
Screen173.mov
iOS: mWeb Safari
Screen172.mov
MacOS: Chrome / Safari
Screen171.mov
MacOS: Desktop
Screen170.mov