You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-10-16] Web - Spend - Floating bar disappear after cancel the Download action #101597
Version Number: v9.4.84-2 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#100291 Email or phone of affected tester (no customers):leungbratt6+18095@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Windows 10/Chrome App Component: Left Hand Navigation (LHN)
Action Performed:
Preconditions: User has a couple of report in the Workspace chat
Open the New Dot app
Navigate to Spend - Report
Select any report
Click Download report on the floating bar
When Download modal processing, cancel it
Expected Result:
The floating bar still displays after cancel the download modal
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
🤖 Deploy blocker verdict: not a regression from Use a floating action bar for bulk actions — recommend demoting and rolling forward. The selection-clearing code that makes the bar vanish is byte-identical on production and has shipped since May. Reverting #100291 would only make the same defect less visible, not fix it.
Proposal
What is the root cause of that problem?
Cancelling the PDF modal runs the same "download finished" cleanup as a successful download, and that cleanup clears the row selection.
Following the repro path "Spend > Reports → select a report → Download report":
ReportPDFDownloadModal already knows how to tell cancel apart from completion — it fires onCancel() when dismissed while the filename is still unset (ReportPDFDownloadModal.tsx:59-66). The Search caller simply never passes it, though the MoneyReportHeaderModals.tsx:137 caller does.
This predates the current release. The offending logic came from feat: Add "Download as PDF" option to Reports page bulk actions dropdown, merged 2026-05-18. #100291 moved the selection UI out of the page header into a floating bar; the mount condition is the same predicate as before, so it changed how conspicuous the symptom is, not the behaviour. On production the same steps clear the checkboxes and collapse the header bulk-action button — same defect, quieter presentation. That means the auto-assignment of Krishna2323, JS00001 and shubham1206agra is misattributed.
What changes do you think we should make in order to solve the problem?
Track whether the flow was cancelled with a ref, set by a new handlePdfModalCancel callback and reset where the modal is opened (next to setIsPdfModalVisible(true)).
In handlePdfModalHide, return early without calling clearSelectedTransactions() when that flag is set, then reset it. Nothing was downloaded, so the selection should survive.
Return the new callback from the hook and pass it to ReportPDFDownloadModal as onCancel in SearchBulkActionsButton.tsx — the same prop the MoneyReportHeaderModals caller already uses.
Keep the clearing on hide rather than moving it to trigger time: the modal renders inside the selection-gated bar and would unmount mid-flight otherwise, which is already noted in a comment at useSearchBulkActions.ts:3107-3110.
Worth fixing in the same PR: handleExpensifyCardStatementPDFModalHide (useSearchBulkActions.ts:3105-3111) clears the selection on cancel in exactly the same way.
What alternative solutions did you explore? (Optional)
Alternatives considered and ruled out
Revert #100291. Ruled out. Verified against the production blobs that handlePdfModalHide (useSearchBulkActions.ts:3056-3059 on production) and the DOWNLOAD_PDF option are identical there, and that production's SearchBulkActionsButton also wires onModalHide with no onCancel. gh api compare/production...staging shows the only download-related change this release is an added empty-reports guard — nothing touching selection clearing. Reverting restores the old presentation, not correct behaviour.
Another PR in Deploy Checklist: New Expensify 2026-09-17. Ruled out. Scanned every file changed between production and staging: no other PR in the release touches PDFDownloadModal, ReportPDFDownloadModal, SearchSelectionProvider, or any selection-clearing path. SearchContextDefinitions.ts changed only in an import path.
The Esc-key shortcut clearing the selection. Considered, because BulkActionBar binds Esc to onClearSelection. Ruled out as a separate cause: that shortcut is gated on !modal?.isVisible (BulkActionBar/index.tsx:88), so it is inactive while the PDF modal is open. Dismissing with Esc still closes the modal and routes through handlePdfModalHide, so it converges on the same root cause and the same fix covers it.
Confidence: high on the mechanism (call chain read end-to-end) and on #100291 not having introduced it (production blobs fetched and compared directly; blame and the release diff agree). Not verified: a live repro on production — code identity was confirmed, but the app was not run against production, and QA marked production as "N/A".
💡 Suggested AI code review rule
This looks like a recurring, mechanically detectable pattern — the identical flaw already exists twice in this one file — so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for Expensify/App:
Rule:CLEAN-REACT-PATTERNS-10 — Distinguish cancel from completion in modal dismissal handlers
Condition: Flag when a handler passed as onModalHide / onClose / onDismiss performs a completion-only side effect (clearing selection, resetting a form, marking something done, firing analytics) while the modal component declares an onCancel / onSuccess prop the call site does not pass. Wire the specific hook instead, or branch on completion state inside the handler.
Why: Dismissal fires on both success and cancel, so success-only cleanup silently runs when the user backs out, discarding work they still expect to have. In this issue that made the bulk action bar vanish after cancelling a download.
Search pattern:grep -rn "onModalHide={\|onDismiss={" --include=*.tsx src, then for each hit check whether the target component's props type declares onCancel/onSuccess and whether the call site passes it. In App today that is 46 onModalHide={ call sites, only 7 of them in files that mention onCancel at all.
I checked for overlap and found none: CONSISTENCY-4 covers props declared but unused inside a component, not an available prop a caller ignores, and CLEAN-REACT-PATTERNS-4 covers aggregating unrelated responsibilities. If this is worth adding, a maintainer can open it as a draft PR in Expensify/App.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101597) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: NA - Result of the original design, single-report PDF download has cleared the selection only after the modal closes since the feature was added, and the design team later asked for it to match the multi-report flow.
Link to the comment on the Issue: NA - Result of the original design, single-report PDF download has cleared the selection only after the modal closes since the feature was added, and the design team later asked for it to match the multi-report flow.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
User has at least two expense reports in a workspace.
Test:
Go to Spend > Reports.
Select one report using its checkbox.
Click Download report.
Verify that the floating bar disappears and no reports are selected while the "Generate PDF" modal is shown.
Click Cancel before the PDF is ready.
Verify that the floating bar stays hidden and no reports are selected after the modal closes.
Activity
applause-bot commentedon Sep 18, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/c9bce6467cc623222598b746e89d6b63822a1550051c3cd6787c8a995978927a
melvin-bot commentedon Sep 18, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #100291
github-actions commentedon Sep 18, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Sep 18, 2026
@JS00001 @shubham1206agra you have been assigned to this deploy blocker because you reviewed the offending PR: #100291
melvin-bot commentedon Sep 18, 2026
@Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #100291
melvin-bot commentedon Sep 18, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Sep 18, 2026
🤖 Deploy blocker verdict: not a regression from Use a floating action bar for bulk actions — recommend demoting and rolling forward. The selection-clearing code that makes the bar vanish is byte-identical on
productionand has shipped since May. Reverting #100291 would only make the same defect less visible, not fix it.Proposal
What is the root cause of that problem?
Cancelling the PDF modal runs the same "download finished" cleanup as a successful download, and that cleanup clears the row selection.
Following the repro path "Spend > Reports → select a report → Download report":
DOWNLOAD_PDFbulk action does not clear the selection when triggered — it opens the PDF modal (src/hooks/useSearchBulkActions.ts:2648-2668).onClose()(src/components/PDFDownloadModal.tsx:128-141).onModalHideonly, and noonCancel(src/components/Search/SearchBulkActionsButton.tsx:297-302).src/hooks/useSearchBulkActions.ts:3100-3103).selecteddrops to 0 (SearchSelectionProvider.tsx:302-306) →useShouldShowBulkActionBar.ts:18-28returns false →SearchBulkActionsBarWide.tsx:20-22rendersnull.ReportPDFDownloadModalalready knows how to tell cancel apart from completion — it firesonCancel()when dismissed while the filename is still unset (ReportPDFDownloadModal.tsx:59-66). The Search caller simply never passes it, though theMoneyReportHeaderModals.tsx:137caller does.This predates the current release. The offending logic came from feat: Add "Download as PDF" option to Reports page bulk actions dropdown, merged 2026-05-18. #100291 moved the selection UI out of the page header into a floating bar; the mount condition is the same predicate as before, so it changed how conspicuous the symptom is, not the behaviour. On production the same steps clear the checkboxes and collapse the header bulk-action button — same defect, quieter presentation. That means the auto-assignment of
Krishna2323,JS00001andshubham1206agrais misattributed.What changes do you think we should make in order to solve the problem?
In
src/hooks/useSearchBulkActions.ts:handlePdfModalCancelcallback and reset where the modal is opened (next tosetIsPdfModalVisible(true)).handlePdfModalHide, return early without callingclearSelectedTransactions()when that flag is set, then reset it. Nothing was downloaded, so the selection should survive.ReportPDFDownloadModalasonCancelinSearchBulkActionsButton.tsx— the same prop theMoneyReportHeaderModalscaller already uses.Keep the clearing on hide rather than moving it to trigger time: the modal renders inside the selection-gated bar and would unmount mid-flight otherwise, which is already noted in a comment at
useSearchBulkActions.ts:3107-3110.Worth fixing in the same PR:
handleExpensifyCardStatementPDFModalHide(useSearchBulkActions.ts:3105-3111) clears the selection on cancel in exactly the same way.What alternative solutions did you explore? (Optional)
Alternatives considered and ruled out
Revert #100291. Ruled out. Verified against the
productionblobs thathandlePdfModalHide(useSearchBulkActions.ts:3056-3059on production) and theDOWNLOAD_PDFoption are identical there, and that production'sSearchBulkActionsButtonalso wiresonModalHidewith noonCancel.gh api compare/production...stagingshows the only download-related change this release is an added empty-reports guard — nothing touching selection clearing. Reverting restores the old presentation, not correct behaviour.Another PR in Deploy Checklist: New Expensify 2026-09-17. Ruled out. Scanned every file changed between
productionandstaging: no other PR in the release touchesPDFDownloadModal,ReportPDFDownloadModal,SearchSelectionProvider, or any selection-clearing path.SearchContextDefinitions.tschanged only in an import path.The Esc-key shortcut clearing the selection. Considered, because
BulkActionBarbinds Esc toonClearSelection. Ruled out as a separate cause: that shortcut is gated on!modal?.isVisible(BulkActionBar/index.tsx:88), so it is inactive while the PDF modal is open. Dismissing with Esc still closes the modal and routes throughhandlePdfModalHide, so it converges on the same root cause and the same fix covers it.Confidence: high on the mechanism (call chain read end-to-end) and on #100291 not having introduced it (production blobs fetched and compared directly; blame and the release diff agree). Not verified: a live repro on production — code identity was confirmed, but the app was not run against production, and QA marked production as "N/A".
💡 Suggested AI code review rule
This looks like a recurring, mechanically detectable pattern — the identical flaw already exists twice in this one file — so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for
Expensify/App:CLEAN-REACT-PATTERNS-10— Distinguish cancel from completion in modal dismissal handlersonModalHide/onClose/onDismissperforms a completion-only side effect (clearing selection, resetting a form, marking something done, firing analytics) while the modal component declares anonCancel/onSuccessprop the call site does not pass. Wire the specific hook instead, or branch on completion state inside the handler.grep -rn "onModalHide={\|onDismiss={" --include=*.tsx src, then for each hit check whether the target component's props type declaresonCancel/onSuccessand whether the call site passes it. In App today that is 46onModalHide={call sites, only 7 of them in files that mentiononCancelat all.useSearchBulkActions.ts:3100-3103onCancelcontract atReportPDFDownloadModal.tsx:59-66, wired correctly atMoneyReportHeaderModals.tsx:137I checked for overlap and found none:
CONSISTENCY-4covers props declared but unused inside a component, not an available prop a caller ignores, andCLEAN-REACT-PATTERNS-4covers aggregating unrelated responsibilities. If this is worth adding, a maintainer can open it as a draft PR inExpensify/App.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101597)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
46 remaining items
melvin-bot commentedon Oct 15, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 15, 2026
Payment Summary
Resolving PRs:
Clear Search selection immediately when downloading a single report PDF #102987
Reviewer: @shubham1206agra owed $175 via NewDot
Reviewer: @Krishna2323 owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Oct 18, 2026
@shubham1206agra plz complete the Contributor+ checklist and tag me in a post once you have. Thx
melvin-bot commentedon Oct 28, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
mallenexpensify commentedon Oct 28, 2026
@shubham1206agra plz complete the Contributor+ checklist and tag me in a post once you have. Thx
shubham1206agra commentedon Oct 29, 2026
Contributor+ Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: NA - Result of the original design, single-report PDF download has cleared the selection only after the modal closes since the feature was added, and the design team later asked for it to match the multi-report flow.
Link to the comment on the Issue: NA - Result of the original design, single-report PDF download has cleared the selection only after the modal closes since the feature was added, and the design team later asked for it to match the multi-report flow.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
mallenexpensify commentedon Oct 29, 2026
Payment Summary
Contributor: @Krishna2323 due $250 via NewDot
Contributor+: @shubham1206agra due $250 via NewDot
Thx!
laurenreidexpensify commentedon Nov 26, 2026
Approved @Krishna2323 $250 New Expensify