Offer export templates when a group row is selected on a grouped search - #100520
Offer export templates when a group row is selected on a grouped search#100520MelvinBot wants to merge 1 commit into
Conversation
Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
No code fix is needed — nothing is actually broken. The only failing check is Every other check on the head commit ( Why it looked worse earlierWhen the request came in, |
|
🤖 Web test steps verification results: The core fix works on Web: with only the group row ticked on a grouped Accounting search, the Export submenu now lists a template ("All Data - expense level") alongside "Current view" instead of only "Current view", "Basic export" stays hidden, and picking the template started an export scoped to the selected group's 2 expenses ($65.00). Steps 8 and 9 could not be completed — dismissing the "Preparing download…" modal via its "Send me the file when it's ready" button navigated the browser off-app to an unreachable The collapsed-group case (step 8) still needs a human pass — that is the view run · no recording available |















Explanation of Change
On a grouped search (the Spend > Accounting views such as card accruals, cash accruals, card statements and bank reconciliation), selecting a group row left "Current view" as the only export option. The export templates were only reachable by ticking every line item in the group one by one.
includesGroupExportinsrc/hooks/useSearchBulkActions.tssuppressed the whole export-template list whenever the selection contained a group. That flag was added in #88577 back when a collapsed group stub carried no transaction IDs to export, but group selections are now exported through a query filter instead (addSelectedGroupsFilter), which bothhandleCSVExportandbeginExportWithTemplatealready apply. The templates therefore work for a group selection — they were just never offered.This removes the flag so the templates are built for a group selection like they are for an individual one. The basic export stays hidden on grouped searches: that is gated separately on
!isGroupedSearch(it carries fewer columns than "Current view"), and this PR does not touch that guard.Both selection shapes are covered, since
isGroupSelectionmatched both: a collapsed group stored as a singlegroup_<id>stub, and an expanded group stored as one entry per child taggedisSelectedViaGroup.AI Tests
Run locally against this branch:
npm test -- tests/unit/hooks/useSearchBulkActionsExportTest.ts— 34 passednpm test -- --silent tests/unit/hooks/useSearchBulkActions tests/unit/Search— 55 suites, 1622 tests passednpm run lint-changed— passednpm run typecheck— passednpm run spell-changed -- <changed files>— 0 issuesnpm run react-compiler-compliance-check check src/hooks/useSearchBulkActions.ts— this file is already non-compliant onmain(9 babel / 8 oxc errors). The counts are identical before and after this change, so there is no regression.check-changedandspell-changedcould not resolve a merge base in this environment (shallow clone), which is why the per-file forms were used.Could not run: browser verification. The prestarted web test session rendered a blank page with no accessibility nodes after sign-in, so the flow could not be driven end to end. The unit tests cover both group-selection shapes; the manual steps below still need a human pass.
Fixed Issues
$ #100074
PROPOSAL: #100074 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
// Please describe what tests you performed that validate your changes worked.
Suggested starting point:
Offline tests
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review". These must be filled out, or the issue title must include "[No QA]."
// Please describe what QA needs to do to validate your changes and what areas they need to test for regressions.
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari