Repository navigation
feat(extension): show a download dialog before sending each download - #532
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
There was a problem hiding this comment.
💡 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".
| // 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, { |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
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
reviewDownloadskey, since every install saved the old opt-inconfirmDownloadsas false); turning it off sends straight to Ketch as before.The dialog:
DownloadCategory.matches. Clicking the field fills in that path to edit; left unchanged, it stays Auto.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
main. Safari always shows the dialog. The page resource picker still sends a batch directly.Testing
npm testinapp/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.mjsbuilds all packages.