GeezerVison is showing github.com — feat(browser): the import dialog in two groups: what to import and which sites (opencode#66339) by Hona · Pull Request #1202 · anomalyco/opencode-rune
Conversation
Hona
commented
Nov 25, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Ports opencode#66339 (eec153e79a): the browser's import dialog in two groups, what to import and which sites.
What changes
- Two groups. "Include" holds the two boxes, Sign-ins and Browsing history. "Sites" is a choice: "All sites", with the number of sites once the list is read, or "Only sites I choose" (
packages/gui-plugins/src/browser/site-chooser.tsx:405-470).
- The list under the choice. "Only sites I choose" shows the search and the list under it, with nothing ticked; before, a "Choose sites" disclosure in the footer showed the list with every site ticked (
site-chooser.tsx:85, :96-103, :471-659). The disclosure is gone.
- One box in the list's header ticks every shown site, or clears them when all are ticked, and shows a dash when some are; it replaces the Select all and Select none buttons (
site-chooser.tsx:347-348, :523-533). The count stands beside it, inside the list's frame.
- The profile picker ("From") shows only where the dialog has several profiles to offer: the pane's offer and a passkey notice. A Settings row opens the dialog for its own profile; its title names the browser, with the profile as a badge for a browser that has several (
settings.tsx:72, site-chooser.tsx:358-373, :380-402).
- A new dialog size, tall: 480 wide, as tall as its content up to 600, its top edge kept, so showing the list only grows the dialog downward (
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.
- Settings > Browser: the row's button reads "Import", not "Import…", and a profile's name beside its browser is a badge (
i18n/en.ts:439, settings.tsx:887-895).
- The Import button reads "Import" with nothing chosen (then disabled), and is the primary button (
site-chooser.tsx:682-694).
- Return on a box imports, as it does on the list (
site-chooser.tsx:408-412). Ours did not do this before.
How
- Plugin contract 1.11 (additions only; 1.10 is the
cursor prop of fix(cursor): the five cursors that waited for Rune, as official has them #1187): the dialog size tall; indeterminate on ui.checkbox; badge on ui.dialogHeader; a ui.badge node. The contract's text for large and x-large named sizes the app does not use (880 x 600, 1040 x 680); it now says 680 x 600 and 880 x 680, as crates/opencode-ui/src/dialog.rs has them.
- Rust:
DialogSize::Tall in crates/opencode-ui/src/dialog.rs; the plugin dialog's frame for it in apps/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 in crates/opencode-plugin-runtime/src/ui_nodes.rs.
- Luau: the dialog in
plugins/browser/settings.luau (renderImportDialog, siteList) and its state in plugins/browser/init.luau (siteChoice.scope in place of revealed and custom; 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: no site is 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 dev since #550, not new with this port. Two things were wrong:
- The page was not built again when the listing was in. The browsers are listed off the UI thread; the listing's end woke the app, but a wake alone draws nothing: the app builds its view again only when a poll reports a change (Rune
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.rs Landed, surfaces/browser/poll.rs).
- "No other browser" was said while the list was still being read. Official says it only once the browsers are listed and there are none (
settings.tsx:151, jobs.ts:313 sourcesLoaded); 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.rs snapshot_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. On dev since 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).
- A process claims its copies: it holds an OS lock on
opencode-browser-import-<pid>.lock beside 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.
- The app sweeps once when the launch is over, on a thread of its own named
browser-import-sweep (apps/desktop/src/surfaces/browser/cookie_import.rs sweep_left_copies, started from apps/desktop/src/workspace/lifecycle/launch/mod.rs engine_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.
- What it touches: entries named
opencode-browser-import-* in the app's own import-scratch folder, and nothing else; never a browser's folder.
How it differs from official
- The "From" picker. Official's is its select at its base size (
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.
- The Import button while an import runs. Official's stays the primary button, disabled, with a 14 pt spinner before its text (
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.
- Rows' roles. Official's list is a listbox of options (
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.
- What the app reads. Which browsers and profiles it lists, their sites and an import all come from folders under three variables:
USERPROFILE, LOCALAPPDATA and APPDATA (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 under ProgramFiles, ProgramFiles(x86) and LOCALAPPDATA, 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).
- How a pass is started. With
USERPROFILE, LOCALAPPDATA and APPDATA pointing 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.
- One look outside the root. Windows sets
ProgramFiles itself 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.
- The first pass is a dry one: it opens the page and compares every browser and profile name it shows with the made-up names; a name that is not on the list stops the run. Import is pressed only after that, on the made-up rows only, and the root is deleted at the end.
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.
- The dialog's cases, on
b7edbacba (run 45700004963; it holds dev up 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, head cc991c6505, run 45629508899, the same pin.
- Case 7 holds (on
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.
- Case 1 holds: 480 x 296 with its top at y 150; the title "Import from Chromium" with the badge "Madeup Work"; "Include" and "Sites"; "All sites" and "Only sites I choose"; "Import". Before: the old dialog, 480 x 168, centred, a one-line title, a footer with "Choose sites".
- Case 2 holds: nothing ticked and "0 of 4 selected" with Import dimmed; two ticked: "2 of 4 selected", a dash, "Import 2 sites"; the header box once: all four, a check, and the button reads "Import", as official's does when every site is chosen (
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.
- Case 3 holds: with 400 sites in a 1280 x 900 window the dialog is 480 x 600 at y 150, the list 217 tall inside it, the footer inside. In a 1280 x 560 window it is 464 tall and ends inside the window, with the footer in view. No wheel was turned in the list.
- Case 6 holds: two Tabs put the focus on the Sign-ins box; Return starts the import (the made-up profile holds no key, so it ends with "Access was denied. Try again and allow access when asked.").
- A fault of an earlier head of this change, found by that run and fixed in
b7edbacba: on 076f30a9b "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.
- On
0e3df708a, the head that merges (Windows x64 CI build, run 45714465939; holds dev with the Rune pin 5342f14d, 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, head 278f9aaf38, run 45709668204: dev a5c55ecf42 with the same pin and the re-keyed profile, and nothing of this change.
- Shared strings and the words press hold: headings "Include" and "Sites" show; "Only sites I choose" is 140 wide (label 116); a press on the words chooses it and shows the list of 4 ("0 of 4 selected", dialog 519 tall at y 150); a press beside the words leaves "All sites" chosen with no list.
- First-open longest frame: before build (
278f9aaf38) first dialog open 16.916 ms; 0e3df708a first 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 on b7edbacba had one 2,352 ms frame on its first dialog open; it did not recur here (cause not found).
- Case 8 holds: planted
opencode-browser-import-99999-1\Cookies and empty opencode-browser-import-99999.lock are both gone after a 7 s start, while keep-me.txt and other-folder\file.txt stay. Before (278f9aaf38): both planted entries stay.
- Case 9 holds: planted
opencode-browser-import-88888-1\Cookies with no .lock stays after a start when fresh, and is removed after a start once its folder last-write time is set 11 minutes back; keep-me.txt and other-folder\file.txt stay.
- Case 10: ending 0.15 s after pressing Import on row 2 left its real claim file
opencode-browser-import-<pid>.lock, and the next start removed that .lock file. Not shown: a Cookies copy 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.
- Shared-file samples on
0e3df708a all hold:
- Add extension dialog framed list (sealed,
--extensions root): 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".
- Address field on
Browser/Pane (fix(browser): the address field shows the I-beam over its whole box while it is edited #1247 sample): clicking browser-address, typing abc, clicking (873.3, 201) and typing d leaves browser-address-input holding "abcd" (before fix(browser): the address field shows the I-beam over its whole box while it is edited #1247 on cc991c6505, run 45629508899: browser-address-input absent).
- Shared
en.json /rename row (A bare /rename asks the server for a new session title (opencode#66396) #1249 sample): /ren typed in the composer lists command-builtin.rename with ["/rename","Rename the session, or generate a new title when run without one","Ctrl+R"].
- Web check on
0e3df708a: clock scan (bun scripts/web-clock.ts) exited 0 (1,096 files in 49 crates, no std::time::Instant or SystemTime::now); cargo check for wasm32-unknown-unknown NOT RUN (the build host refused for disk). By the diff of the launch/sweep commit (f66d12bb8..0e3df708a), every changed line in apps/desktop/src/workspace/lifecycle/launch/mod.rs and apps/desktop/src/surfaces/browser/cookie_import.rs is inside #[cfg(not(target_arch = "wasm32"))], and crates/browser-pane is native-only. Full scripts/web.ps1 -Check is owed on dev once the build host has room.
- Merged on: CI run
45714465939 green on 0e3df708a (guardrails, macOS, Windows x64, Windows arm64, Linux x64; Linux arm64 skipped). dev took no file of this change since its base.
- Not run on any head: case 4 (it needs the browser pane) and case 5 (an import that brings cookies; by reading only).
The cases:
- From a Settings row of a browser with several profiles: the title names the browser with the profile as a badge; no "From" picker; "Include" with two ticked boxes; "Sites" on "All sites" with the count; the button reads "Import"; the row's own button reads "Import" and the profile is a badge.
- "Only sites I choose": the dialog's top edge does not move and it grows downward; the search and the list show, nothing ticked, "0 of N selected", Import disabled; ticking two sites gives "Import 2 sites" and a dash in the header box; the header box ticks all (a check), again clears all; with a search it acts on the shown sites only. Back on "All sites" the list goes and the button reads "Import".
- A profile with more sites than fit: the dialog stops at its size's height and the list scrolls inside it; the footer stays in view.
- From the pane's offer ("Choose sites to import") with two profiles or more: the title is "Import from another browser", the "From" picker shows and switches the profile, the list is shown at once.
- An import of two chosen sites brings those two (Settings > Browser counts their cookies); an import on "All sites" brings all.
- Return with the focus on a box starts the import.
- Settings > Browser opened for the first time in a run: the rows of the made-up profiles are there without leaving the page; before, the page read "No other browser found on this computer" and kept reading it. With no other browser the page says so, after a moment with the section empty.
- A left copy is swept at a start. In the scratch root's
import-scratch folder: a made-up folder opencode-browser-import-99999-1 holding a file, an empty file opencode-browser-import-99999.lock beside it, a file keep-me.txt and a folder other-folder with a file. Start the app, wait five seconds, end it. The made-up folder and its .lock file are gone; keep-me.txt and other-folder are as they were. Before: the made-up folder stays.
- A copy with no claim file waits its ten minutes. A made-up folder
opencode-browser-import-88888-1 with no .lock file: after a start it is still there; with its last-write time set eleven minutes back, a start removes it.
- The app ended during a read. The dialog opened on the 400-site profile and the app ended while the list is still being read: if a folder
opencode-browser-import-<pid>-<n> is left, the next start removes it and that pid's .lock file. If the end cannot be made to fall inside the read, case 8 stands for the same path.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…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.
Uh oh!
There was an error while loading. Please reload this page.
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 was referenced Nov 26, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|