Skip to content

feat(extension): show a download dialog before sending each download - #532

Merged
linroid merged 4 commits into
mainfrom
feat/extension-download-dialog
Oct 13, 2026
Merged

linroid merged 4 commits into
mainfrom
feat/extension-download-dialog

Conversation

@linroid

@linroid linroid commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

What

The browser extension now opens a small download dialog for every captured download, context-menu link, pasted link and clicked magnet link before sending it to Ketch. It replaces the plain review tab. "Review downloads before sending" is now on by default (stored under a new reviewDownloads key, since every install saved the old opt-in confirmDownloads as false); turning it off sends straight to Ketch as before.

Before (optional review tab) After (dialog window)

The dialog:

  • File: a type badge, the name as an editable field (focus selects the name without its extension), and the size and site. A name the device would refuse is flagged before sending. Torrents show their name read-only.
  • Send to: one card per Ketch instance, in two columns when there are several, with whether it can be reached and its free space. Checking never opens the Ketch app; sending does. A warning shows when the file is larger than the device's free space.
  • Save in: the device's download folder as the placeholder, and quick options:
    • Auto (default) leaves the folder to the device and previews the category folder it would sort the file into, e.g. "Auto · Videos". The match mirrors DownloadCategory.matches. Clicking the field fills in that path to edit; left unchanged, it stays Auto.
    • The device's category folders.
    • The last five folders sent to on that device.
    • Each device's download and category folders are remembered from its last status (in the dialog or popup), so the path shows while the Ketch app is closed.
  • Download in browser gives a captured download back to the browser, or starts an HTTP(S) link as a browser download (not from a Chromium private window).
  • Enter sends, Esc cancels; with notifications on, a notification confirms where it was sent.

It opens as a popup window centered over the browser and sizes itself to its content; Safari, without popup windows, gets a centered card in a tab.

Why

Picking the device, the name and the folder per download is now one quick, readable step, shown by default, rather than an opt-in plain form in a full tab.

Notes for reviewers

  • With the setting off, capture, magnets, the context menu and the popup send directly, unchanged from main. Safari always shows the dialog. The page resource picker still sends a batch directly.
  • The Ketch app's closed state reads "Closed · starts when you send": sending launches it.
  • A captured download is paused before the dialog opens; canceling, closing it or Download in browser resumes it, and sending removes the browser original, as the review did.
  • New strings are translated into all 10 languages; unused ones are removed.
  • Screenshots use a mocked extension API (devices, statuses and folders are fake). I have not exercised it in a real Chrome or Firefox install yet: worth checking the popup window sizing and Firefox's popup window.

Testing

  • npm test in app/browser-extension: 170 pass, with new tests for the window, direct downloads, remembered and category folders, links and magnets opening the dialog, and the setting defaulting to on.
  • node build.mjs builds all packages.

Every captured download, context-menu link, pasted link and clicked magnet link now
opens a small dialog window instead of being sent straight to Ketch, replacing the
optional review tab. It shows the file's type, editable name, size and site; the
Ketch devices in two columns with their reachability and free space; the folder with
Auto (the device's category folder, previewed), the device's category folders and
recently used folders as quick options; and "Download in browser" to hand the
download back. Devices' folders are remembered so the path shows while the Ketch
app is closed. The "Review downloads before sending" setting is removed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T10:30:31.602641Z 1c9ce6c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Bring back "Review downloads before sending" as `reviewDownloads`, on by default, so
the dialog can still be turned off to send straight to Ketch. It uses a new key since
every install saved the old opt-in `confirmDownloads` as false. The closed-app status
now reads "Closed · starts when you send".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c9ce6c1b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/browser-extension/src/background.js Outdated
// The browser may have finished a tiny file already; Ketch has its own copy either way.
console.warn('Ketch: could not remove the browser download', error);
await ext.downloads.pause(item.id);
await openReview(instance.id, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore browser fallback after rejected captures

When a captured download is reviewed and Ketch returns a definitive error such as an unreachable server or rejected request, forcing capture through openReview means sendReview merely returns the entry to pending; the browser original remains paused until the user manually cancels or chooses the browser action. The previous capture path released the browser download on known failures, and the repository explicitly requires captured downloads to fall back when Ketch fails, so resume the original automatically for non-uncertain send errors while retaining the pause for uncertain submissions.

AGENTS.md reference: AGENTS.md:L1433-L1435

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Kept as is, deliberately: when a send from the dialog fails, the dialog stays open with the error so the user can pick another device or folder and retry, and the original stays paused only while that dialog is open. Cancel, closing the window and Download in browser all resume it in the browser. Captures with the review turned off keep the automatic fallback from main. Resuming automatically on the first failure would end the dialog and take away the retry.

🤖 Addressed by Claude Code

…utomatic

A link pasted in a private window's popup carries the window's private state into the
review, so Chromium hides Download in browser for it as for context-menu links. A
device whose download folder is a content:// tree gets no category chips or filled-in
path, as only the device can resolve its category folders.
The dialog now opens over the page the download came from, as a frame of the extension's
own page in a closed shadow root, instead of a separate window; pages extensions can't
script, and frames that don't load, still get the window. Clicking outside, closing the
page or navigating away cancels it.

A captured download is canceled in the browser as soon as it is captured, before the
browser shows its download bubble or Save As dialog; Download in browser starts it again.
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 1 860 files  ±0   1 887 suites  ±0   21m 32s ⏱️ +2s
12 532 tests ±0  12 288 ✅ ±0  244 💤 ±0  0 ❌ ±0 
14 971 runs  ±0  14 727 ✅ ±0  244 💤 ±0  0 ❌ ±0 

Results for commit 95a3e91. ± Comparison against base commit 4ab6d72.

@linroid
linroid merged commit b132f4d into main Oct 13, 2026
14 checks passed
@linroid
linroid deleted the feat/extension-download-dialog branch October 13, 2026 10:49
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