Repository navigation
fix(browser): settle client-hosted download toasts after their page closes - #28913
Conversation
…loses The download progress toast for a page this desktop hosts for a remote workspace was driven by a listener inside that page's pane. Switching pages or closing the tab unmounted the listener mid-download, so the finish never reached the toast and its spinner (no close button, no timeout) stayed for the session. An interrupted download had the same result because Chromium sends no finish for it. Own the toasts from one app-level listener that claims a download when it starts, and end the spinner on an interrupt.
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7956dabb-5d38-442e-8286-bfdddd6a6721
📒 Files selected for processing: 8
src/renderer/src/app-shell/use-app-shell-services.tssrc/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-workspace-pane.tsxsrc/renderer/src/components/browser-pane/browser-client-hosted-download-notices.test.tsxsrc/renderer/src/components/browser-pane/browser-client-hosted-download-notices.tssrc/renderer/src/components/browser-pane/client-hosted-browser-pane-test-rig.tssrc/renderer/src/store/slices/browser.tssrc/renderer/src/store/slices/browser/browser-host-state.ts
💤 Files with no reviewable changes: 2
- src/renderer/src/components/browser-pane/client-hosted-browser-pane-test-rig.ts
- src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Settle the toast when progress reports… · browser-client-hosted-download-notices.ts:52-54
src/renderer/src/components/browser-pane/browser-client-hosted-download-notices.ts:52-54
🎯 Functional Correctness | 🟠 Major | ⚡ Quick winSettle the toast when progress reports
interrupted.If a claimed download reports
state: 'interrupted', this handler callstoast.loadingagain. If no finished event follows, the spinner remains indefinitely. Handleinterruptedbefore the loading call and show the existing failure error for the same toast ID. The earlier review comment concerns cleanup after an error toast; this path never shows one.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4d073ac0-a3f1-4efd-a5f6-e7e13ec88cc6
📒 Files selected for processing: 2
src/renderer/src/components/browser-pane/browser-client-hosted-download-notices.test.tsxsrc/renderer/src/components/browser-pane/browser-client-hosted-download-notices.ts
💤 Files with no reviewable changes: 1
- src/renderer/src/components/browser-pane/browser-client-hosted-download-notices.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
|
Switching to another workspace during a client-hosted browser download could leave “Downloading…” spinning after the file finished: the browser pane unmounted and took its download listener with it. The app now owns that listener and follows downloads it already claimed through the producer’s finish event, even after the pane or page handle disappears. The review removed the renderer’s premature error on interrupted progress; only a finish event now chooses the final notice. An interrupted download that never emits finish can still leave a spinner and a small tracking entry. That producer-side policy is deferred to draft #28936. Verified at
Client-hosted evidence is controlled IPC, not a paired remote transfer. Paired transfer and setup-script execution remain unverified. Ordinary tab switch/close kept the hidden pane mounted and settled normally in this fixture. No merge was performed. |


ELI5
When a client-hosted browser page downloads a file for a remote workspace, Orca shows a "Downloading report.pdf…" spinner toast. Switching to another workspace while it downloads unmounts the browser pane. The spinner could remain after the download finished because nothing heard its finish event. Now the app keeps listening after the workspace switch, so that event updates the toast to its final result.
What Changed
Mechanism:
useAppShellServices, which already holds subscriptions that must outlive any single view. It claims a download when it starts, if the page is client-hosted according to the store's page handle. It then follows that download by id until it finishes, even if the browser pane has unmounted.isClientHostedBrowserPageHandle. The browser view uses it to choose its view type, and the toast listener uses it to claim downloads, so the two can't disagree.Why
The bug came from the toast's owner living shorter than the download. Adding an X to a progress spinner, or dismissing the toast when the view unmounts, would hide the symptom and lose the result. Download completion would go unreported in both cases. The app-level listener lives as long as the download events it handles, so it can report the final result across workspace views.
Follow-up: #28936 will settle interrupted downloads needing manual resume; until then, their spinners can remain.
Linked Issue
N/A (maintainer; found while auditing toasts that can't be closed, after #28900)
Visual Proof
Before/after screenshots: QA screenshots. The same toast updates after a workspace switch when a finish event arrives. QA exercised controlled client-hosted main-process IPC; paired host transfer and the setup script remain unverified.
Testing
Moved the existing download-notice tests from the per-page view to the app-level listener. New cases:
Controlled client-hosted QA reproduced the stranded toast on a workspace switch. Ordinary browser tab switch and close left the hidden pane mounted and settled normally in that fixture. Paired host transfer was not verified.
CI covers lint, typecheck and the full unit suite.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
Renderer-only. The event wire format is unchanged, so mixed client and host versions are unaffected. Local browser pages keep their own download shelf, and the listener ignores their downloads. The web client's preload stubs these subscriptions, so nothing changes there.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)