-
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
Updated selected transaction If getting new updates #49829
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. |
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!
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
✋ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{BZ CHECKLIST} This Caused this regression #49829, Here we only handle the cases where report data was returned but SearchUtils.getSections returns three types of data depending on the condition:
Lines 320 to 328 in d03066f
function getSections(type: SearchDataTypes, status: SearchStatus, data: OnyxTypes.SearchResults['data'], metadata: OnyxTypes.SearchResults['search']) { | |
if (type === CONST.SEARCH.DATA_TYPES.CHAT) { | |
return getReportActionsSections(data); | |
} | |
if (status === CONST.SEARCH.STATUS.EXPENSE.ALL) { | |
return getTransactionsSections(data, metadata); | |
} | |
return getReportSections(data, metadata); | |
} |
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.
Is the link above correct? It's a reference to this PR
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.
oops! Sorry this one #50286
Details
Fixed Issues
$ #49795
PROPOSAL: #49795 (comment)
Tests
Same QA steps
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
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