Skip to content

feat(browser): tell the desktop where a Server (streamed) page's download was saved - #47177

Merged
AmoabaKelvin merged 1 commit into
mainfrom
fix/streamed-page-download-notice
Nov 23, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
fix/streamed-page-download-notice

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

When a page in a Server (streamed) browser tab downloaded a file, nothing told you. The file went into the server's Downloads folder without a word. Now a notice says where it's going and which server it's on, and then where it was saved.

Files Added Deleted Net
Test 0 0 0 0
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​163 $\color{#cf222e}{\Huge{\mathbf{−}}}$​50 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​113

What Changed

Before: download events go only to a renderer window, and a Server (streamed) page has none, so the server saved the file silently.

After:

  • The browser manager also reports each page's downloads to "download viewers", keyed by browser page id (watchDownloads). The start event goes out once, when the download is tied to its tab. The finish event goes out on every finish path, with the same payloads a local window gets.
  • A screencast viewer that opts in with downloads: 1 receives downloadRequested and downloadFinished events. This reuses the after-ready hook from fix(browser): Server (streamed) pages ask for permissions, sign-in and opening apps on the desktop #47150, now named startViewerEvents, which covers prompts and downloads.
  • The desktop shows a notice when the download starts: "Downloading to <path> on <server>". When the finish arrives, the same toast becomes the toast This-device pages already show: "Saved to <path> on <server>", "Download canceled." or the failure. The server name comes from the host's display label.

Why

The start notice is a plain toast, not a loading one. It already says where the file goes, so a pane that stops streaming can't leave a spinner behind, and can't hide where the file went. Hiding a tab or switching workspace closes the stream before the finish arrives. Codex and the Claude reviewer both caught this with the first version's loading toast.

The finish toast reuses the This-device copy and code. Moving the file to this computer is still parked as a product call (H2/M24).

Linked Issue

No issue. This is gap M21 from the remote browser parity audit. M6 shipped in #47150, and the phone (M44) follows.

Visual Proof

Paired setup: a hidden dev desktop paired to a worktree-built orca serve named "Streamed prompts probe".

Before: the page downloads a file. Nothing appears, and the file lands in the server's Downloads.
before-download.png

After, while downloading:
after-download-started.png

After, once saved:
after-download-saved.png

Testing

  • Real paired run on macOS (Playwright, hidden Electron client paired to a headless orca serve built from this branch, ORCA_BACKGROUND_LAUNCH=1). The page downloaded a 64 KB file that finished 4 s later. The start notice appeared within 300 ms and was replaced by "Saved to …" when the download finished. On main, no toast appeared.

  • remote-browser-stream-lifecycle.test.ts passes. pnpm check:changed passes.

  • No new unit test. The change is event wiring and UI copy, which the repo's test rules say not to unit-test.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Performance

None, because the stream carries two events per download, start and finish (progress isn't forwarded), and only to viewers that opted in.

Risk

Mixed versions: an older desktop never sends downloads: 1, so a new server sends nothing new. An older server strips the param, so a new desktop sees what it saw before.

Local and This-device downloads are unchanged. They take the same renderer sends, startedSent, payload and agent claims; the requested payload is now built by one helper used by both paths.

The notice shows the server's full save path to the person streaming the page, who already has workspace access to it.

Backing out is a plain revert.

Level: Low

AI Disclosure

Review

One review-loop round (Codex + Claude). Both raised the same P1: a loading toast could stay stuck when the stream closed mid-download. Fixed by making the start notice a normal toast that names the destination, and by dropping progress. No other findings.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

New copy: browser.serverPage.download.started, "Downloading to {{path}} on {{host}}". Held for UI review. Cross-platform: Windows save paths have their file name split on \ too. SSH: not involved. Mobile: the phone doesn't opt in yet.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The screencast parameter and result contracts now include download events. The download lifecycle publishes request and completion events to page-keyed listeners, and viewer subscriptions can register and clean up download watchers. The remote screencast renderer requests these events and displays notices with the save path and host.

Merge Risk: Minimal · up to ee2af

Server (streamed) page downloads now show a start notice and then a saved, cancelled or failed notice on the desktop. The change is small and opt-in through the downloads flag. No merge-blocking risk is evident. A possible gap, if popup pages key downloads differently, would only cost them the notice.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(browser): tell the desktop where a Server (streamed) page's download was saved" matches the main change. The changeset adds download start and finish events for screencast viewers that…
Description check Passed The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Note…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(browser): tell the desktop where a Server (streamed) page's download was saved" matches the main change. The changeset adds download start and finish events for screencast viewers that opt in with downloads: 1, and the desktop shows a notice with the save path and server. The title states the primary change in one concise line, uses a conventional prefix, and avoids file lists or vague terms. It is a little long at 83 characters, but it is clear and specific.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. The before and after are explained, the mechanism is described (watchDownloads, downloadRequested/downloadFinished events, opt-in downloads: 1), and the risk and rollback are stated. The Linked Issue section has no issue number and says 'No issue', which conflicts with the template's requirement for outside contributors. The Risk section does not set a level beyond 'Low', which is acceptable. The AI Disclosure section is empty. The Testing section relies on one manual run and states that no unit test was added, and the Visual Proof section includes before and after images. The author is a maintainer per the objectives, so the missing issue is a minor gap rather than a failure. The description is mostly complete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b286af3-8a0f-46bd-ab25-e8685e8f4687
Commits

Reviewing files that changed from the base of the PR and between 990671e and ee2af99.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 7

  • src/main/runtime/browser/screencast/browser-screencast-contracts.ts
  • src/main/runtime/browser/screencast/browser-screencast-viewer-events.ts
  • src/main/runtime/rpc/methods/browser/browser-screencast.ts
  • src/renderer/src/components/browser-pane/stream-remote/remote-browser-screencast-subscription.ts
  • src/shared/browser/runtime/runtime-browser-contracts.ts
  • src/shared/rpc-contract/browser/browser-params.ts
  • src/shared/rpc-contract/browser/browser-screencast-params.ts
Files with no reviewable changes: 1

  • src/shared/rpc-contract/browser/browser-params.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the fix/streamed-page-download-notice branch from 990671e to ee2af99 Compare November 23, 2026 06:20
@AmoabaKelvin
AmoabaKelvin merged commit 0e5eacc into main Nov 23, 2026
57 checks passed
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.

1 participant