Skip to content

[Due for payment 2026-10-23] [$175] Unable to see "export To" when selecting group of expenses #100074

Open

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.65-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from BrowserStack:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @abbagail
Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. On the spend page, filter by Accounting and choose card accrual, cash accrual, bank reconciliation, card statements, or any other option that has display: by group > user/card/bank
  2. Click the grouping to see the expenses
  3. Select the group > X Selected  to see options for those expenses/line items

Expected Result:

Export To > select export option

Actual Result:

Export To doesn't show up as an option. In order to get "Export To" to show up, you have to manually select all line items/expenses in that group.

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Recording.3453.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @eVoloshchak
Upwork Automation - Do Not Edit

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 1, 2026
  2. MelvinBot commented on Sep 1, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    Selecting a group row on a grouped search suppresses the whole export-template list, which leaves the export menu with exactly one entry. That single entry then replaces the "Export ›" parent row, so the menu shows a row labelled "Current view" instead of "Export".

    The flag that does it is includesGroupExport in src/hooks/useSearchBulkActions.ts:1793:

    const includesGroupExport = isGroupedSearch && Object.entries(selectedTransactions).some(([key, selectedTransaction]) => isGroupSelection(key, selectedTransaction));

    It flows through three lines:

    1. useSearchBulkActions.ts:2044 — if (!allSelectedAreDeleted && !includesGroupExport) skips every custom and default export template.
    2. useSearchBulkActions.ts:2073 — the else if (!isGroupedSearch) basic-export fallback is also skipped, because this is a grouped search.
    3. Only the unconditional "Current view" item from useSearchBulkActions.ts:2032 survives, so at useSearchBulkActions.ts:2092 the one-item submenu collapses into the parent button and takes over its label.

    Selecting the line items one by one works because toggling any individual row clears the group tag at SearchWriteActionsProvider.tsx:436-437, which makes includesGroupExport false and brings the full template submenu back.

    All four Accounting views named in the report (card accruals, cash accruals, card statements, bank reconciliation) are type: expense with a groupBy — see SearchUIUtils.ts:901-985 — so they always take this path.

    What changes do you think we should make in order to solve the problem?

    Stop using includesGroupExport to hide the export templates in useSearchBulkActions.ts:2044. Group selections already export correctly — handleCSVExport and beginExportWithTemplate both convert a group selection into a query filter via addSelectedGroupsFilter (useSearchBulkActions.ts:186, used at :846-863 and :979-995) — so the templates work; they are just not offered.

    The existing !isGroupedSearch guards at :1779 and :2073 keep the basic CSV export hidden on grouped searches, which is the documented intent (it carries fewer columns than "Current view"). That part should stay.

    Worth confirming with the product owner first: is "no templates for a group selection" intentional, or collateral from moving group export onto the query-filter path? If it is intentional, the fix moves to :2092 — don't let a single sub-item silently rename the "Export" parent row.

    What alternative solutions did you explore? (Optional)

    Alternatives considered and ruled out
    • Empty export templates. Ruled out. getExportTemplates at src/libs/actions/Search.ts:2001-2003 always seeds at least the expense-level export, independent of policy. So a missing policy (the group pseudo-entry resolves to policyID: _FAKE_) cannot empty the list.
    • exportButtonOption being dropped. Ruled out. It is pushed unconditionally at useSearchBulkActions.ts:2394 and there is no if anywhere that removes it. The row is present — only its label is wrong.
    • Report-level "Export to <integration>". Not the cause here. That block is gated on isReportsTab (:1824), which is false on all four type: expense Accounting views regardless of how you select.
    • Only the fix at :2092. Renaming the row back to "Export" would restore the label but still offer just one export destination, which doesn't match "Export To > select export option" in the expected result.

    Two selection shapes exist, and both trip the same flag. A collapsed group with no children loaded stores one group_<id> stub (SearchWriteActionsProvider.tsx:463-476); an expanded group stores one entry per child tagged isSelectedViaGroup: true (:519). isGroupSelection at :182-184 matches both, so a fix must cover both.

    Separate quirk found while tracing (not part of this bug). Select a group while it is collapsed, then expand it: the reconcile at SearchWriteActionsProvider.tsx:214-215 keeps groupKey but loses isSelectedViaGroup, so the same user action ends in two different states depending on expand order.

    Verification status. This is traced from code, not a live repro — the browser test session never rendered, so I could not confirm the exact rendered label. The claim to check first is that the row reads "Current view" rather than "Export ›".

    Related issues


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/100074) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 1, 2026
  4. melvin-bot commented on Sep 1, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

  5. melvin-bot commented on Sep 1, 2026

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  6. Anthgg commented on Sep 4, 2026

    @Anthgg

    Proposal

    What is the root cause of that problem?

    In src/hooks/useSearchBulkActions.ts:2044, includesGroupExport is computed:

    const includesGroupExport = isGroupedSearch && Object.entries(selectedTransactions).some(([key, selectedTransaction]) => isGroupSelection(key, selectedTransaction));

    And on line 2062:

    if (!allSelectedAreDeleted && !includesGroupExport) {
        // Builds template export options and pushes into exportOptions
        ...
    }

    When a group of expenses is selected in a grouped search view (such as the Accounting views: card accruals, cash accruals, card statements, or bank reconciliation), includesGroupExport evaluates to true.

    As a result:

    1. All default and custom export templates are omitted from exportOptions.
    2. exportOptions only contains a single item: Current view (pushed at line 2049).
    3. At lines 2092-2095, when exportOptions.length === 1, the bulk actions menu collapses the single submenu option into the parent button, replacing the "Export To" / "Export" menu button with the direct label "Current view".

    Group selections already support template exports via beginExportWithTemplate and handleCSVExport, which properly convert group selections into query filters via addSelectedGroupsFilter (useSearchBulkActions.ts:186, :846-863, :979-995). However, !includesGroupExport at line 2062 still prevents these templates from being populated.

    What changes do you think we should make in order to solve the problem?

    In src/hooks/useSearchBulkActions.ts:

    1. Remove the !includesGroupExport check from line 2062:
    if (!allSelectedAreDeleted) {

    This allows the available default and custom export templates to be pushed into exportOptions for group selections, preserving the full "Export To" menu and its sub-options.

    1. Keep the existing !isGroupedSearch guard in availableDefaultTemplates / handleBasicExport (useSearchBulkActions.ts:1779, :2073) so that basic CSV export continues to be hidden on grouped searches where "Current view" is preferred.

    2. Add a unit test in SearchBulkActionsTest confirming that selecting a grouped transaction row populates exportOptions with both Current view and the available export templates.

    What alternative solutions did you explore? (Optional)

    1. Forcing the parent button label to stay "Export" when exportOptions.length === 1: Rejected because while it fixes the parent label, it still only offers a single option ("Current view") without making the export templates available for group selections.
  7. melvin-bot commented on Sep 4, 2026

    @melvin-bot

    @eVoloshchak Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  8. melvin-bot commented on Sep 5, 2026

    @melvin-bot

    @eVoloshchak Whoops! This issue is 2 days overdue. Let's get this updated quick!

  9. eVoloshchak commented on Sep 7, 2026

    @eVoloshchak
    Contributor

    @MelvinBot, implement this

  10. MelvinBot commented on Sep 7, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #100520

    Please mark it as "Ready for review" when it is ready for review.

    What changed: removed the includesGroupExport gate in src/hooks/useSearchBulkActions.ts, so selecting a group row on a grouped search now offers the export templates instead of leaving "Current view" as the only option.

    Why this is safe

    That flag came from #88577, when a collapsed group stub carried no transaction IDs to export. Group selections are now exported through a query filter instead — addSelectedGroupsFilter, which both handleCSVExport and beginExportWithTemplate already apply — so the templates work for a group selection; they were just never offered.

    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 it.

    Both selection shapes are covered by new unit tests: a collapsed group stored as a single group_<id> stub, and an expanded group stored as one entry per child tagged isSelectedViaGroup.

    Tests run
    • npm test -- tests/unit/hooks/useSearchBulkActionsExportTest.ts — 34 passed
    • npm test -- --silent tests/unit/hooks/useSearchBulkActions tests/unit/Search — 55 suites, 1622 tests passed
    • npm run lint-changed, npm run typecheck, spell check — all passed
    • React Compiler: this file is already non-compliant on main (9 babel / 8 oxc errors) and the counts are identical after the change, so no regression

    Not run: browser verification. The test session rendered a blank page after sign-in, so the flow could not be driven end to end. Manual test steps are in the PR for a human pass.

    One thing worth confirming during review: the proposal flagged a possible product question — whether hiding templates for a group selection was ever intentional. Nothing in the code or the originating PR suggests it was, so I implemented the proposal as written.

    Three issues look like they may share this root cause and could be worth deduping: #99089, #97217, and #98911.

  11. 16 remaining items

  12. changed the title [-]Unable to see "export To" when selecting group of expenses[/-] [+][$175] Unable to see "export To" when selecting group of expenses[/+] on Sep 30, 2026
  13. melvin-bot commented on Sep 30, 2026

    @melvin-bot
  14. JS00001 commented on Oct 12, 2026

    @JS00001
    Contributor

    still in review

  15. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @eVoloshchak, @JS00001 eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  16. JS00001 commented on Oct 16, 2026

    @JS00001
    Contributor

    Merged

  17. changed the title [-][$175] Unable to see "export To" when selecting group of expenses[/-] [+][Due for payment 2026-10-23] [$175] Unable to see "export To" when selecting group of expenses[/+] on Oct 16, 2026
  18. melvin-bot commented on Oct 16, 2026

    @melvin-bot

    @eVoloshchak

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.12-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-10-23. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  19. melvin-bot commented on Oct 19, 2026

    @melvin-bot

    @eVoloshchak Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  20. melvin-bot commented on Oct 21, 2026

    @melvin-bot

    @eVoloshchak Huh... This is 4 days overdue. Who can take care of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorOverdue

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions