Skip to content

Fix: show Search bulk export options without opening a report first#93297

Merged
youssef-lr merged 14 commits into
mainfrom
claude-searchBulkExportSnapshot
Jun 16, 2026
Merged

Fix: show Search bulk export options without opening a report first#93297
youssef-lr merged 14 commits into
mainfrom
claude-searchBulkExportSnapshot

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

On the Search > Reports page, the bulk-select export options ("Export to NetSuite" / "Mark as manually exported") did not appear on a fresh load (after clearing cache) until the user opened a report first.

Root cause: the bulk-export visibility gate in useSearchBulkActions reads the report from live Onyx (allReports). SearchBulkActionsButton is rendered outside SearchScopeProvider, so the useOnyx wrapper does not redirect this read to the Search snapshot. On a fresh load the live report_<id> is missing entirely, so canReportBeExported bails early at if (!completeReport) return false and neither export option is offered. Opening a report fires OpenReport, which populates the live report_<id> — that is exactly the "open it first" workaround.

Fix: resolve the report through the shared getReportFromSearchSnapshot helper, which prefers the Search snapshot (currentSearchResults.data) and falls back to live Onyx. The snapshot already carries the full report on a fresh load — the same data the per-row Search export action relies on — so the bulk menu now shows the options without opening a report.

Two related fallbacks were added so the existing "export again" flow keeps working with snapshot-sourced data:

  • The export-action loop falls back to the snapshot report when the live report_<id> is missing.
  • The report name used in the export-again modal falls back to the snapshot when the live record is an incomplete optimistic entry that lacks reportName.

The policy reads remain on live Onyx (no snapshot lookup), matching the rest of the export-options logic.

Additionally, the "export again" confirmation modal now supports a scrollable prompt (new shouldEnablePromptScroll prop on ConfirmModal) so that a large list of already-exported reports scrolls within the modal instead of extending beyond the screen, and the "Are you sure you want to export them again?" question now precedes the report list.

Fixed Issues

$ #92976
PROPOSAL: #92976 (comment)

Tests

Case 1

Preconditions

  • You have a workspace connected to an accounting integration (e.g., NetSuite).
  • The workspace contains a list of reports with a status of Approved or Paid.
  1. Go to Troubleshoot > Clear cache and restart.
  2. Navigate to Spend > Reports.
  3. Filter the reports by:
    • A workspace with an accounting integration.
    • Report status: Approved and Paid.
  4. Select All records.
  5. Verify that both export options (Export to NetSuite and Mark as Exported) are available in the bulk action menu without opening any report first.

Case 2

  1. Select a large number of reports that have already been exported.
  2. Verify that the confirmation modal displays a scrollable list of report names instead of extending beyond the screen.
  • Verify that no errors appear in the JS console

Offline tests

  1. Navigate to Spend > Reports.
  2. Filter the reports by:
    • A workspace with an accounting integration.
    • Report status: Approved and Paid.
  3. Select All records.
  4. Verify that both export options (Export to NetSuite and Mark as Exported) are available in the bulk action menu without opening any report first.

QA Steps

Same as Test Steps.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

The Search bulk-select export options read the policy and report from live
Onyx, which lacks policy.connections on a fresh load until a report is opened.
Read from the Search snapshot first (which carries connections), matching the
per-row export action logic, so the options show without opening a report.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed the failing test (job 4) check.

Root cause: This PR added a call to getReportFromSearchSnapshot(...) inside canReportBeExported in src/hooks/useSearchBulkActions.ts:1286. The duplicate-report test fully mocks @libs/actions/Search, and that mock didn't define getReportFromSearchSnapshot, so the export-options path threw TypeError: getReportFromSearchSnapshot is not a function and failed all 8 tests in tests/unit/hooks/useSearchBulkActionsDuplicateTest.ts.

Fix: Added getReportFromSearchSnapshot to that mock, mirroring the real implementation's fallback (search snapshot → allReports). All 43 tests in the file now pass locally.

The only other failing check, PR Author Checklist / checklist, is the human-completed checklist and isn't something I act on.

Comment thread src/hooks/useSearchBulkActions.ts Outdated
const reportPolicy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];
const completeReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`];
const reportPolicy = currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`] ?? policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];
const completeReport = getReportFromSearchSnapshot(report.reportID, currentSearchResults?.data, allReports);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const completeReport = getReportFromSearchSnapshot(report.reportID, currentSearchResults?.data, allReports);

@MelvinBot This change alone has display the export to integration item, let's remove the the other changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Reverted the policy and reportPolicy lookups back to live Onyx and kept only the completeReport snapshot lookup. The diff is now a single behavioral change:

-                const completeReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`];
+                const completeReport = getReportFromSearchSnapshot(report.reportID, currentSearchResults?.data, allReports);

Verified locally:

  • npm test -- tests/unit/hooks/useSearchBulkActionsDuplicateTest.ts → 43 passed
  • typecheck-tsgo → clean
  • React Compiler check → only the pre-existing 322:0 errors remain (identical on the base, unrelated to this change)

Pushed as 8c10f07d3.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot rename it to snapshotReport

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — renamed completeReport to snapshotReport (all 3 references in canReportBeExported). Typecheck clean and the unit test still passes (43/43). Pushed as 8092398816c.

…rt snapshot lookup

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/components/ConfirmContent.tsx 89.65% <100.00%> (+0.36%) ⬆️
src/components/ConfirmModal.tsx 100.00% <100.00%> (ø)
src/styles/index.ts 60.41% <ø> (ø)
src/hooks/useSearchBulkActions.ts 52.36% <33.33%> (+1.71%) ⬆️
... and 15 files with indirect coverage changes

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
Comment thread src/hooks/useSearchBulkActions.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot fallback to the snapshot report here to be

const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`] ?? currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];

This will help when checking !report?.isExportedToIntegration below, since the snapshot report already has isExportedToIntegration.

Comment thread src/hooks/useSearchBulkActions.ts Outdated
Comment on lines 1326 to 1327

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onyx report can be an incomplete optimistic record here (e.g. exported offline before it was ever loaded will create incomplete optimistic report to insert pendingFields?.export), so it won't have reportName.

@MelvinBot Falling back to the Search snapshot report ensures the "export again" modal still shows the report name.

const reportName = report?.reportName ?? currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.reportName;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Since the live Onyx record can win the ?? at line 1318 yet be an incomplete optimistic record without reportName, I fall the name back to the snapshot:

-                        if (report.reportName) {
-                            exportedReportNames.push(report.reportName);
+                        const reportName = report.reportName ?? currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.reportName;
+                        if (reportName) {
+                            exportedReportNames.push(reportName);
                         }

Verified locally: typecheck clean, useSearchBulkActionsDuplicateTest → 43 passed. Pushed as 24f30c6.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ MelvinBot CI Fix Loop Detected

MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR.

Next steps: A human should review the recent commits and resolve the conflicting CI errors manually.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot

  • Please recreate the OP’s “Explanation of Change” to align with the new changes.
  • Mark all author checklists as checked.

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot update Test steps and QA steps to be

Preconditions

  • You have a workspace connected to an accounting integration (e.g., NetSuite).
  • The workspace contains a list of reports with a status of Approved or Paid.
  1. Go to Troubleshoot > Clear cache and restart.

  2. Navigate to Spend > Reports.

  3. Filter the reports by:

    • A workspace with an accounting integration.
    • Report status: Approved and Paid.
  4. Select All records.

  5. Verify that both export options (Export to NetSuite and Mark as Exported) are available in the bulk action menu without opening any report first.


@MelvinBot update offline steps to be

  1. Navigate to Spend > Reports.

  2. Filter the reports by:

    • A workspace with an accounting integration.
    • Report status: Approved and Paid.
  3. Select All records.

  4. Verify that both export options (Export to NetSuite and Mark as Exported) are available in the bulk action menu without opening any report first.

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR as ready for review.

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot You have the permission, please mark this PR as ready for review.

@MelvinBot MelvinBot marked this pull request as ready for review June 12, 2026 18:17
@MelvinBot MelvinBot requested a review from a team as a code owner June 12, 2026 18:17
@melvin-bot melvin-bot Bot requested review from JmillsExpensify and ahmedGaber93 and removed request for a team and JmillsExpensify June 12, 2026 18:17
@melvin-bot

melvin-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

@ahmedGaber93 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]


for (const reportID of selectedReportIDs) {
const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`] ?? currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ CONSISTENCY-3 (docs)

The helper function getReportFromSearchSnapshot already exists in src/libs/actions/Search.ts (and is imported and used at line 1281 in this same file) to look up a report from the search snapshot with a fallback to allReports. Here on line 1318, the same lookup is done inline but with reversed priority (allReports first, then snapshot), which is inconsistent with the helper's behavior (snapshot first, then allReports).

If the intent is to prefer the live Onyx report over the snapshot here, use getReportFromSearchSnapshot and swap the fallback order inside it, or create a clearly named variant. If the intent is the same as the helper, replace this line with:

const report = getReportFromSearchSnapshot(reportID, currentSearchResults?.data, allReports);

Reviewed at: 24f30c6 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need live Onyx report first to check report.pendingFields.export more details here #83527 (comment)

@ahmedGaber93

ahmedGaber93 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@trjExpensify @Expensify/design We have an UI edge case when bulk export to integration and we have a big list of reports alreay exported again.

Screenshot 2026-06-12 at 9 25 49 PM

I think we have two options to fix this:

  1. Cap the displayed list to a few report names and summarize the rest, e.g., +20 other reports (not clickable text only)
Screen.Recording.2026-06-12.at.9.46.40.PM.mov
  1. Make the ConfirmModal prompt scrollable. In that case, the entire prompt text would scroll, not just the list of report names, since we pass it as a single string:
'The following reports have already been exported to QuickBooks Online:\n' +
    exportedReportNames.join('\n') +
    '\n' +
    'Are you sure you want to export them again?'
Screen.Recording.2026-06-12.at.9.23.32.PM.mov

@trjExpensify

Copy link
Copy Markdown
Contributor

I'll defer to Design, but personally, I would go with the second option so the names of the reports can be discovered.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — pushed 2c68479.

ScrollView in src/components/ConfirmContent.tsx is now imported from @components/ScrollView instead of react-native, which resolves the lint error.

Comment thread src/styles/index.ts
},

confirmModalPromptScrollable: {
maxHeight: 300,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot Add paddingRight: 8 to the scrollview style to prevent the scrollbar from hiding the text below it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — added paddingRight: 8 to confirmModalPromptScrollable so the scrollbar no longer overlaps the prompt text. Pushed as 1985ca1.

…verlap

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@ahmedGaber93

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
a.mov
Android: mWeb Chrome
Screen.Recording.2026-06-13.at.2.57.31.AM.mov
iOS: HybridApp
Screen.Recording.2026-06-13.at.2.51.25.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-06-13.at.2.42.33.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-06-13.at.2.41.13.AM.mov

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Fix the ESLint issue.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed the failing ESLint check.

The @dword-design/import-alias/prefer-alias rule flagged src/components/ConfirmContent.tsx:5ScrollView was imported via the @components/ScrollView alias, but ConfirmContent.tsx lives in src/components/, so the alias resolves to a sibling and must be a relative import. Changed it to ./ScrollView and moved it into the relative-import group (alphabetically between ./Pressable and ./Text) to satisfy import ordering.

@ahmedGaber93 ahmedGaber93 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@youssef-lr

Copy link
Copy Markdown
Contributor

Can we add a regression unit test for the actual fix?

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot please implement #93297 (comment) and fix the conflict.

MelvinBot and others added 2 commits June 15, 2026 22:39
…rtSnapshot

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>

# Conflicts:
#	src/components/ConfirmContent.tsx
#	src/components/ConfirmModal.tsx
…pshot

Covers the fix where bulk export integration options appear without first
opening a report, by resolving the report from the Search snapshot.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Done — added a regression unit test for the fix and resolved the merge conflict with main.

Regression test: tests/unit/hooks/useSearchBulkActionsExportTest.ts

It exercises the actual fix in useSearchBulkActions — resolving the report from the Search snapshot via getReportFromSearchSnapshot — with two cases:

  • Positive: the selected report exists only in the Search snapshot (not yet in live Onyx, i.e. the fresh-load bug condition) → the integration export options (NetSuite) and "Mark as exported" appear, and the export gate is called with the snapshot report.
  • Negative: the report is absent from both the snapshot and live Onyx → those options do not appear.

Both tests pass locally.

Conflict: resolved the conflicts in ConfirmContent.tsx and ConfirmModal.tsx by keeping both new props (shouldEnablePromptScroll and shouldUseSuccessStyleForConfirm).

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Please fix the ts issue

Use typed fixtures (createRandomReport, a SearchResults factory) and a
Parameters-based mock signature to drop unsafe assertions, the forbidden
import() type annotation, and the invalid spread argument.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Fixed the failing typecheck and ESLint checks. Both were in the new regression test, tests/unit/hooks/useSearchBulkActionsExportTest.ts:

  • TS2556 (spread argument): typed the getSecondaryExportReportActions mock with Parameters<typeof …> so the forwarded args are a proper tuple.
  • @typescript-eslint/consistent-type-imports: replaced the inline import() type with a top-level import type * as ReportSecondaryActionUtilsModule.
  • @typescript-eslint/no-unsafe-type-assertion (×3): dropped the as unknown as Report / as unknown as SearchResults casts by building fixtures with the typed createRandomReport helper and a small makeSearchResults factory.

Verified locally: typecheck-tsgo and lint are clean for the file, and both tests still pass.

@youssef-lr youssef-lr merged commit 9633afd into main Jun 16, 2026
34 checks passed
@youssef-lr youssef-lr deleted the claude-searchBulkExportSnapshot branch June 16, 2026 22:14
@github-actions

Copy link
Copy Markdown
Contributor

🚧 @youssef-lr has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.4.10-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Help site review — no changes required

I reviewed the changes in this PR against the help site articles under App/docs/articles, and no documentation updates are required.

Why:

  • This is a bug fix, not a behavior or feature change. It makes the existing bulk export options (Export to [accounting system] / Mark as exported) appear on a fresh load of Search > Reports without first opening a report. The intended behavior is unchanged — the bug just prevented those already-documented options from showing.
  • The relevant help article, Expense-and-Report-Actions.md, already documents Export to [accounting system] and Mark as exported as available on Approved/Paid reports. It does not describe the "open a report first" workaround, so there is nothing inaccurate to correct.
  • The remaining changes are non-documentable UI/copy refinements: the "export again" confirmation modal is now scrollable for long report lists, and the "Are you sure you want to export them again?" question was reordered to precede the report list. These don't introduce or alter any documented concept, label, or workflow.

Since no help site changes are needed, I did not create a draft docs PR. If you believe a specific article should be updated to mention this flow, let me know and I'll draft it.

@ahmedGaber93, please confirm whether the help site adequately reflects the current behavior, or point me to an article you'd like updated.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.4.12-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor Author

📝 Help site review — no docs changes required

I reviewed the changes in this PR against the help articles under App/docs/articles and no help-site updates are required.

Why:

  • It's a bug fix, not a behavior change. The fix makes the bulk-export options (Export to NetSuite / Mark as exported) appear on Spend > Reports without first opening a report. That is the expected behavior — the help site already documents bulk report actions and never described the "open a report first" workaround that this PR removes. So nothing in the docs was made stale.
  • The relevant articles already describe the correct flow. How to export reports documents selecting reports and exporting in bulk, and Expense and Report Actions / Understanding Report Statuses and Actions already list Mark as exported. None describe the buggy gated behavior, so none need editing.
  • The remaining changes are internal/in-app only. The Onyx snapshot resolution is non-user-facing, and the ConfirmModal scroll fix plus the "export again" copy reorder are in-app modal strings (in src/languages/*), which the help site does not mirror.

No draft docs PR was created since there is nothing to document. If you believe a specific behavior here should be captured in a help article, let me know which workflow and I'll draft it.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.4.14-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.14-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants