Repository navigation
Studio: remember download answers for a site or every site, programs included - #16658
Conversation
|
@codex review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f576fdca0
ℹ️ 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".
| const covered = (other: DownloadRequest) => !(allow && other.dangerous && !programs); | ||
| const answered = everywhere | ||
| ? queue.filter((other) => other === request || covered(other)) | ||
| : site | ||
| ? queue.filter((other) => other === request || (other.origin === request.origin && covered(other))) |
There was a problem hiding this comment.
Preserve agent approval requirements when settling queued downloads
If a program download is awaiting approval and another program download from the browser agent is queued behind it, choosing Download with “Always for this site” (for the same origin) or “Always download, from every site” also approves the agent's program without presenting its prompt. covered() checks only whether the file is dangerous, and queued requests do not retain agentRule, so this bypasses the explicit agent-program approval requirement enforced in approveDownload(). Retain the request's agent approval requirement and exclude those requests from remembered bulk approvals.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e8a81c8: queued requests now record whether they came from the agent's tab, and a remembered answer never settles those; covered by a test.
| {(["once", "site", "all"] as const) | ||
| // Without a web origin (data:, an opaque blob) there's no site to remember. | ||
| .filter((option) => option !== "site" || request.origin) |
There was a problem hiding this comment.
Honor the global remember choice for context-menu downloads
For a program downloaded through the native browser's context menu, this now offers “Always download, from every site,” but choosing it does not prevent the next context-menu program download from asking again. native-view.ts routes these downloads through approveChosenDownload(), which unconditionally queues dangerous files without checking askBeforeProgramDownloads. The choice therefore disables prompts for ordinary navigation downloads while leaving the very flow where it was selected unchanged. Make that path honor the global program preference, or avoid offering an inapplicable remember choice there.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e8a81c8: approveChosenDownload now skips the prompt for programs once askBeforeProgramDownloads is off; covered by a test.
…cover context-menu programs
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…ompts in every locale (#16677) ## Summary `Frontend build + bundle sanity` runs `npm run i18n:check:strict`, and that step fails on main for every PR. For example #16671, which only touches the glass wallpaper: ``` === nl === Missing keys (will fall back to en): 9 - browser.agent.step.tabs - browser.agent.step.readFile - browser.agent.step.editFile - browser.askBeforeProgramDownloadsSetting - browser.askBeforeProgramDownloadsSettingDescription - browser.downloadSiteAllowAll - browser.downloadPrompt.once - browser.downloadPrompt.site - browser.downloadPrompt.all Missing keys above. Add them to every overlay, or run without --strict to accept the English fallback. ``` The same 9 keys are missing from all 24 overlays. Two PRs added them to `en.ts` only: - #16644 (`71c643e02a`) added the browser agent's `tabs`, `readFile` and `editFile` steps. - #16658 (`eec7711a42`) added the program download setting, "Allow programs too", and the three `downloadPrompt` choices. Both features are fine. They only skipped the overlay step the strict gate asks for, so non-English users currently see these strings in English. ## Change `studio/frontend/src/i18n/locales/*.ts`, every overlay except `en.ts`. Each one gets the 9 keys, placed where `en.ts` has them: - the three agent steps after `drag` in `browser.agent.step`; - the two program download settings after `askBeforeDownloadingSettingDescription`; - `downloadSiteAllowAll` after `downloadSiteAllow`; - `once`, `site` and `all` after `remember` in `browser.downloadPrompt`. The wording follows each locale's existing neighbours. Agent steps use the same form as that locale's other steps, for example "Zieht" / "Liest die Datei" in German, "Arrastrando" / "Leyendo el archivo" in Spanish, and "正在拖动" / "正在读取文件" in Simplified Chinese. The download strings reuse that locale's terms for "download", "always allow" and "site". `{host}` is kept in every `site` string. `es-419` uses the same text as `es`. No English string and no other key changes. ## Testing - `npm run i18n:check:strict`: main fails with 9 missing keys in each of the 24 overlays. This branch passes, `Missing keys (will fall back to en): 0` for every locale, "All locale overlays pass parity." - Removing `browser.downloadPrompt.site` from `nl.ts` again makes the strict check fail and name that key, so the gate still catches a missing key. - `tests/lazy-locale-loading.test.ts` and `tests/locale-detection.test.ts`: 35 passed. - `tsc --noEmit -p tsconfig.app.json` reports nothing in `src/i18n`.
What changes
The browser panel's "Download this file?" prompt had a single "Remember for next time" checkbox. It covered only the current site. It was hidden for files that can run programs (
.dmg,.exe,.msi, ...), so downloading the Unsloth Desktop.dmgasked every time, with no way to stop it.The checkbox is now a three-way choice:
Program files
Settings > Browser
Verified
npm run typecheck,biome linton the changed files (no errors) andnpm run buildpass.npm testgives 14875 passed. Three timing-sensitive tests failed in the full run (streaming-latex-retro-edit,codex-picker-catalog-fallback,llama-cpp-auto-reload); none touch these files, and all three pass when rerun alone.tests/browser-settings.test.ts. It replaces the source-text check that the program prompt had no checkbox, and covers:Unsloth-Desktop-MacOS.dmgrelease link in the browser panel shows the new choices:Not covered