Skip to content

feat(extension): browse for a folder in the Ketch app and reopen in the last one - #559

Merged
linroid merged 2 commits into
mainfrom
feat/extension-folder-picker
Oct 16, 2026
Merged

linroid merged 2 commits into
mainfrom
feat/extension-folder-picker

Conversation

@linroid

@linroid linroid commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #557

What

The browser extension's download dialog already let you type a folder; this makes choosing one work like a browser's Save As:

  • Browse… beside the folder field, shown for the Ketch app on this computer. The extension sends the native messaging host a new pick-folder request; the host gets the app running (as connect does), and the app brings itself to the front and shows its system folder dialog (AwtFilePicker, now public), starting in the folder the field points to. The reply is {"folder":…} or {"canceled":true}. Older apps answer bad_request, which the dialog turns into "Update the Ketch app to choose folders from here".
  • Remembers the folder: the dialog starts in the folder the last download sent to that device used (lastFolder, kept in the extension's local storage), including Auto when that's what was sent, so nothing changes for people who never pick a folder. Choosing a folder in the dialog stops it switching folders when you change device.

Screenshots

The download dialog for the Ketch app on this computer, after a download was last sent to ~/Downloads/Linux:

Before After

Details

  • SingleInstance.request takes a replyTimeout; picking waits up to 10 minutes (PICK_FOLDER_TIMEOUT).
  • With no focused window (Ketch in the tray), Swing's chooser on Windows and Linux stays above other apps' windows; macOS calls requestForeground first.
  • Servers elsewhere don't get Browse…: they can't show a dialog on this screen. Safari has no native messaging and doesn't get it either.
  • New strings in all 10 locales; README and AGENTS.md updated.

Testing

  • ./gradlew :app:desktop:test: new NativeMessagingHostTest cases for pick-folder (asks the running app, starts it first, launch failure, no reply) and pickFolderReply.
  • npm test in app/browser-extension (179 pass): pickAppFolder replies, cancel, old app, missing host; last folder per device including Auto.
  • Checked the new folder row layout in a static render of the dialog. Not yet tried end to end (browser → host → app dialog) on macOS or Windows.

…he last one

The download dialog gains Browse…, which asks the Ketch app on this computer, through a new
`pick-folder` native messaging request, to show its system folder dialog (starting the app if
needed). The dialog now starts in the folder the last download sent to each device used, as a
browser's Save As does; Auto stays the default until another folder is sent to.

Closes #557
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T07:57:16.487837Z a997e12 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.

@claude

claude Bot commented Oct 16, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@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: a997e12f85

ℹ️ 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".

@linroid
linroid merged commit 3ebe7ef into main Oct 16, 2026
@linroid
linroid deleted the feat/extension-folder-picker branch October 16, 2026 07:59
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