fix: Preserve all matching selection after deselecting an expense#95902
fix: Preserve all matching selection after deselecting an expense#95902emkhalid wants to merge 3 commits into
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@mkhutornyi 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc68c95a59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const hasSelectedTransactions = | ||
| selectionState.areAllMatchingItemsSelected || selectionState.selectedTransactionIDs.length > 0 || Object.values(selectionState.selectedTransactions).some((t) => t.isSelected); |
There was a problem hiding this comment.
Keep bulk actions visible for all-matching selections
When an all-matching selection is preserved, this state can now have areAllMatchingItemsSelected === true while selectedTransactions is empty, e.g. select all matching and then exclude every currently loaded row. The wide actions bar still renders SearchBulkActionsButton only when useSelectionCounts() sees selectedTransactions entries, so in that scenario it switches back to the normal search controls even though off-screen matching items remain selected and can no longer be exported/cleared from the header. Please gate the wide bulk actions on hasSelectedTransactions/all-matching state instead of only the loaded selection count.
Useful? React with 👍 / 👎.
Explanation of Change
This PR preserves the “all matching items” selection when individual expenses are unchecked.
It:
Fixed Issues
$ #94143
PROPOSAL: #94143 (comment)
Tests
Precondition: Use an account with more than 50 expenses.
Select all matching expenses and Exclude one expense
Preserve selection during pagination
Avoid recalculating totals during pagination
shouldCalculateTotals: false.Recheck an excluded expense
Exclude multiple expenses
Verify grouped and expense-report selection
Verify the selection footer
Offline tests
N/A
QA Steps
Same as Tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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-Select.all.matching.expenses.and.Exclude.one.expense.mov
android-native-Preserve.selection.during.pagination.mp4
Not applicable.
android-native-Recheck.an.excluded.expense.mov
android-native-Exclude.multiple.expenses.mov
android-native-Verify.grouped.and.expense-report.selection.mp4
andoir-native-Verify.the.selection.footer.mov
Android: mWeb Chrome
android-web-Select.all.matching.expenses.and.Exclude.one.expense.mov
android-web-Preserve.selection.during.pagination.mp4
Not applicable.
android-web-Recheck.an.excluded.expense.mov
android-web-Exclude.multiple.expenses.mov
android-web-Verify.grouped.and.expense-report.selection.mp4
andoir-web-Verify.the.selection.footer.mov
iOS: Native
ios-native-Select.all.matching.expenses.and.Exclude.one.expense.mov
ios-native-Preserve.selection.during.pagination.mp4
Not applicable.
ios-native-Recheck.an.excluded.expense.mov
ios-native-Exclude.multiple.expenses.mov
ios-native-Verify.grouped.and.expense-report.selection.mov
ios-native-Verify.the.selection.footer.mov
iOS: mWeb Safari
ios-web-Select.all.matching.expenses.and.Exclude.one.expense.mov
ios-web-Preserve.selection.during.pagination.mp4
Not applicable.
ios-web-Recheck.an.excluded.expense.mov
ios-web-Exclude.multiple.expenses.mov
ios-web-Verify.grouped.and.expense-report.selection.mov
ios-web-Verify.the.selection.footer.mov
MacOS: Chrome / Safari
Select.all.matching.expenses.and.Exclude.one.expense.mov
Preserve.selection.during.pagination.mov
Avoid.recalculating.totals.during.pagination.mp4
Recheck.an.excluded.expense.mov
Exclude.multiple.expenses.mov
Verify.grouped.and.expense-report.selection.webm
Verify.the.selection.footer.mov