Repository navigation
feat(browser): the import dialog in two groups: what to import and which sites (opencode#66339) - #1202
Merged
Conversation
…ich sites (opencode#66339)
…listing is in, and says none only then
…minate checkbox move up, 1.10 being taken dev's contract 1.10 is the cursor prop on every ui node. This change's four additions (the dialog size tall, ui.badge, a row's badge, a checkbox's indeterminate) take 1.11, and the browser plugin asks for 1.11. The generated files are written again from contract.json.
…ut too Set straight into its column the choice was laid out as wide as its ring (24), its words drawn outside its box, so by its box a press on the words was beside it. It stands in a row of its own now, as the first choice does.
…launch Reading another browser's cookies copies its database into the app's own state folder for the length of the read. The copy is removed when the read ends, but not when the app ends during the read; a later read swept it, only once it was ten minutes old when another process had made it. So a copy could stay until the next import was opened. Official sweeps every copy no read uses at each read and once at its start (packages/gui-plugins/src/browser/profile/index.ts:102, profile/database.ts:62-86). Each process now holds an OS lock on a claim file beside its copies for as long as it lives; a sweep that can take another process's lock knows it is gone and removes its copies at once, and the claim with them. The ten minutes stay only for a copy with no claim, from an earlier build. The app runs the sweep once when the launch is over, on a thread of its own (launch::engine_fetch), on the mock browser too.
Hona
marked this pull request as ready for review
November 25, 2026 23:24
Hona
added a commit
that referenced
this pull request
Nov 25, 2026
Hona
added a commit
that referenced
this pull request
Nov 26, 2026
… UP-226 (#1262) partly; UP-212 light-theme note (#1282) Nine new official commits since c85b83eb08, none changing the desktop app, all skipped (6 server/core/ai/util, 1 cli-rs, 2 test-only). UP-232 -> partly (#1202 merged, three named gaps open). UP-226 -> partly (#1262 merged closing #1144's four differences; Recent header words under menu button and instant chevron turn remain open). UP-212 updated with the pin walk's light-theme reading.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports opencode#66339 (
eec153e79a): the browser's import dialog in two groups, what to import and which sites.What changes
packages/gui-plugins/src/browser/site-chooser.tsx:405-470).site-chooser.tsx:85,:96-103,:471-659). The disclosure is gone.site-chooser.tsx:347-348,:523-533). The count stands beside it, inside the list's frame.settings.tsx:72,site-chooser.tsx:358-373,:380-402).packages/ui/src/overlays/dialog/dialog.css:163-180,dialog.tsx:28,site-chooser.tsx:356). Before, the dialog jumped between a small one and a 680 x 600 one.i18n/en.ts:439,settings.tsx:887-895).site-chooser.tsx:682-694).site-chooser.tsx:408-412). Ours did not do this before.How
cursorprop of fix(cursor): the five cursors that waited for Rune, as official has them #1187): the dialog sizetall;indeterminateonui.checkbox;badgeonui.dialogHeader; aui.badgenode. The contract's text forlargeandx-largenamed sizes the app does not use (880 x 600, 1040 x 680); it now says 680 x 600 and 880 x 680, ascrates/opencode-ui/src/dialog.rshas them.DialogSize::Tallincrates/opencode-ui/src/dialog.rs; the plugin dialog's frame for it inapps/desktop/src/plugin_host/ui/surfaces.rs(fits its content, bg-base, 12 pt corners, top edge kept, no outer scroller: what may shrink inside gives way); the dash, the badge and the header's badge incrates/opencode-plugin-runtime/src/ui_nodes.rs.plugins/browser/settings.luau(renderImportDialog,siteList) and its state inplugins/browser/init.luau(siteChoice.scopein place ofrevealedandcustom; one dialog, not two).A fault of ours, found by reading and fixed here
A passkey notice that names no site opened the list alone, with no boxes, and brought sign-ins only. Official opens the whole dialog then, on "All sites" with both boxes (
panel.tsx:607: nositeis passed). Ours now does the same; a notice that names a site still opens the list for that site.A second fault of ours, found by the run and fixed here
Settings > Browser, opened for the first time in a run, read "No other browser found on this computer" on a machine that has some, and kept reading it; the rows came only after leaving the page and opening it again. On
devsince #550, not new with this port. Two things were wrong:runtime/motion/timer_wake.rs:362-369), and none did. The listing's end, and the end of a browser icon's read, which had the same gap, now reach the poll as an event (apps/desktop/src/surfaces/browser/app_icons.rsLanded,surfaces/browser/poll.rs).settings.tsx:151,jobs.ts:313sourcesLoaded); until then the section is empty. The host now answers nothing before its first listing (plugin_host/native/browser/history.rs) and the page says none only after it (plugins/browser/settings.luau,init.luau).A third fault of ours, older than this change, fixed here
Reading another browser's sites or sign-ins copies its cookie database into the app's own state folder for the length of the read (
crates/browser-pane/src/cookies/database.rssnapshot_database). The copy is removed when the read ends, on every path that returns. It was not removed when the app ended during the read, so before this change a copy of another browser's cookie database could be left behind in the app's state folder. A later read swept it, but another process's copy only once it was ten minutes old, and nothing swept at the app's start: the copy could stay until the next import was opened. Ondevsince the import was written; this change makes the read happen at every open of the dialog, so it is fixed here.Official removes every copy no read uses at each read and once at its start (
packages/gui-plugins/src/browser/profile/index.ts:102,profile/database.ts:62-86).opencode-browser-import-<pid>.lockbeside them for as long as it lives. A sweep that can take another process's lock knows that process is gone and removes its copies at once, and the claim file with them. The ten minutes stay only for a copy with no claim file, which an earlier build made.browser-import-sweep(apps/desktop/src/surfaces/browser/cookie_import.rssweep_left_copies, started fromapps/desktop/src/workspace/lifecycle/launch/mod.rsengine_fetch). That is after the first frame, after the window shows its content and the loop has waited for input (or two seconds with no server), where the browser engine's background fetch already starts: nothing of it runs before the first frame.opencode-browser-import-*in the app's ownimport-scratchfolder, and nothing else; never a browser's folder.How it differs from official
packages/ui/src/forms/select/select.css:22-45: 28 high, 6 pt corners, on bg-base). The plugin kit has no select: ours is a button of that height and shape that opens a menu, as the plugin's other pickers are. By reading; not compared in pixels. Needs a select in the plugin kit to be exact.site-chooser.tsx:682-694). Ours is the kit's loading button (crates/opencode-plugin-runtime/src/ui_nodes.rs,button: a loading button takes the loading look). By reading; the run shows what it looks like.site-chooser.tsx:570-591); ours is a list of list items, each with its own checkbox, as before this change.How its run is kept inside a scratch root
This dialog reads other browsers' profiles, so no pass opens it against real ones.
USERPROFILE,LOCALAPPDATAandAPPDATA(crates/browser-pane/src/cookies/sources.rs:user_home,definitions,locate_profiles). There is no registry read and no fixed path in it. A listed browser's icon is looked for underProgramFiles,ProgramFiles(x86)andLOCALAPPDATA, and then, for every browser but Chromium and Helium, in the registry's App Paths (crates/browser-pane/src/cookies/icons.rs:candidates,app_path_name,windows_app_path).USERPROFILE,LOCALAPPDATAandAPPDATApointing under one scratch root, checked in the app process's own environment before the first tap. The root holds only made-up profiles of Chromium and Helium, the two browsers whose icon needs no registry read, so no real browser can be listed and the registry read is never reached.ProgramFilesitself in a 64-bit process, so it cannot be pointed away: for the two made-up browsers the icon lookup tests whether their program file exists under the real Program Files, and reads that file's icon if it does. It reads no profile and writes nothing. The run's result says whether either program was there.Run
A PR build is of the PR's own head. Every pass is headless on a Windows x64 CI build, with made-up browser profiles in a scratch root, the app's own fixture file and no server.
b7edbacba(run45700004963; it holdsdevup to fix(browser): the address field shows the I-beam over its whole box while it is edited #1247 on the Rune pin of fix(deps): pin rune to d5c7a5ad, the effect warm for backdrop blur only (214 commits, rune#1962-#2246) #1192). Before, for cases 1, 2 and 7: fix(deps): pin rune to d5c7a5ad, the effect warm for backdrop blur only (214 commits, rune#1962-#2246) #1192's own PR build, headcc991c6505, run45629508899, the same pin.076f30a9b, the same code): the three made-up rows are there on the first open. Before: "No other browser found on this computer" and no row.site-chooser.tsx:103,:691-693); twice: none; with a search it acts on the shown site only; back on "All sites" the list goes. Before: "Choose sites" opens a 680 wide dialog with all four ticked.b7edbacba: on076f30a9b"Only sites I choose" was laid out as wide as its ring (24, its label 0), so a press on its words did not choose it. It stands in a row of its own now: 140 wide, its label 116; a press on the words chooses it and shows the list; a press beside the words leaves "All sites" chosen.0e3df708a, the head that merges (Windows x64 CI build, run45714465939; holdsdevwith the Rune pin5342f14d, fix(deps): pin rune to 5342f14d (93 commits): window buttons on Wayland without server decorations, smaller backdrop blur copies #1257, and the sweep above; 11 sealed launches + 5 sample launches, each exit code read whole and 0; wall clock only for sealed passes, every process environment verified under the scratch root before the first tap). Before = opencode-rune chore(pgo): the profiles re-keyed to Rune 5342f14d's symbol names #1271's own PR build, head278f9aaf38, run45709668204:deva5c55ecf42with the same pin and the re-keyed profile, and nothing of this change.278f9aaf38) first dialog open 16.916 ms;0e3df708afirst dialog open 40.969 ms (with "All sites" count "4" shown at rest); subsequent dialog passes 23.206 to 27.376 ms; sweep passes 18.696 to 22.045 ms. An earlier run onb7edbacbahad one 2,352 ms frame on its first dialog open; it did not recur here (cause not found).opencode-browser-import-99999-1\Cookiesand emptyopencode-browser-import-99999.lockare both gone after a 7 s start, whilekeep-me.txtandother-folder\file.txtstay. Before (278f9aaf38): both planted entries stay.opencode-browser-import-88888-1\Cookieswith no.lockstays after a start when fresh, and is removed after a start once its folder last-write time is set 11 minutes back;keep-me.txtandother-folder\file.txtstay.opencode-browser-import-<pid>.lock, and the next start removed that.lockfile. Not shown: aCookiescopy caught in the middle of a read (the read ended inside 0.15 s on the made-up profile); case 8's planted copy stands for it.0e3df708aall hold:--extensionsroot): 480 x 498, framed list labelled"Extensions in Chromium · Madeup Work", header["From","Chromium · Madeup Work"]with picker, 5 rows +"Won't work in OpenCode"heading,"Load from folder"and"Done".Browser/Pane(fix(browser): the address field shows the I-beam over its whole box while it is edited #1247 sample): clickingbrowser-address, typingabc, clicking(873.3, 201)and typingdleavesbrowser-address-inputholding"abcd"(before fix(browser): the address field shows the I-beam over its whole box while it is edited #1247 oncc991c6505, run45629508899:browser-address-inputabsent).en.json/renamerow (A bare /rename asks the server for a new session title (opencode#66396) #1249 sample):/rentyped in the composer listscommand-builtin.renamewith["/rename","Rename the session, or generate a new title when run without one","Ctrl+R"].0e3df708a: clock scan (bun scripts/web-clock.ts) exited 0 (1,096 files in 49 crates, nostd::time::InstantorSystemTime::now);cargo checkforwasm32-unknown-unknownNOT RUN (the build host refused for disk). By the diff of the launch/sweep commit (f66d12bb8..0e3df708a), every changed line inapps/desktop/src/workspace/lifecycle/launch/mod.rsandapps/desktop/src/surfaces/browser/cookie_import.rsis inside#[cfg(not(target_arch = "wasm32"))], andcrates/browser-paneis native-only. Fullscripts/web.ps1 -Checkis owed ondevonce the build host has room.45714465939green on0e3df708a(guardrails, macOS, Windows x64, Windows arm64, Linux x64; Linux arm64 skipped).devtook no file of this change since its base.The cases:
import-scratchfolder: a made-up folderopencode-browser-import-99999-1holding a file, an empty fileopencode-browser-import-99999.lockbeside it, a filekeep-me.txtand a folderother-folderwith a file. Start the app, wait five seconds, end it. The made-up folder and its.lockfile are gone;keep-me.txtandother-folderare as they were. Before: the made-up folder stays.opencode-browser-import-88888-1with no.lockfile: after a start it is still there; with its last-write time set eleven minutes back, a start removes it.opencode-browser-import-<pid>-<n>is left, the next start removes it and that pid's.lockfile. If the end cannot be made to fall inside the read, case 8 stands for the same path.