Skip to content

feat(browser): the Add extension dialog redesigned (opencode#66355) - #1216

Merged
Hona merged 3 commits into
devfrom
upstream-f/add-extension-dialog
Nov 25, 2026
Merged

Hona merged 3 commits into
devfrom
upstream-f/add-extension-dialog

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Ports opencode#66355 (5050225a09): the browser's Add extension dialog redesigned.

What changes

  • The other browser's extensions stand in a bordered list whose header is the profile picker: "From" and the profile, or a picker when there are several profiles. The picker's menu opens under its start (packages/gui-plugins/src/browser/settings.tsx:672-727).
  • Extensions that work, fully or in part, come first. The ones that will not work follow under their own heading, "Won't work in OpenCode" (settings.tsx:501-509, :709-722).
  • Loading from a folder is a quiet "Load from folder" action at the start of the footer. The closed "For developers" disclosure is gone. While the folder loads the action shows a spinner and the same words (settings.tsx:740-760).
  • What the last add did stands under the link field and no longer scrolls with the list (settings.tsx:642-671).
  • The dialog stands on the base background with the list one layer up, in both of its steps (settings.tsx:589). Done and the confirm step's Add use the look of the composer's send button (settings.tsx:761, :773).
  • New words: "Not supported" for "Probably won't work here", "Partly supported" for "May not fully work here", "Load from folder" for "Choose folder" (i18n/en.ts:134, :241, :384).

A difference of ours, found while porting and closed here

The picker listed the browsers in a fixed order, their profiles by folder name, and only profiles that hold an Extensions folder (crates/browser-extensions/src/sources.rs, list_chromium_sources). Official gives the dialog the browsers and profiles of the page's import rows, the one used last first, the Chromium ones only (settings.tsx:90, :474; packages/gui-plugins/src/browser/profile/sources.ts:149-165), so the profile it opens on is the one the person uses, and a profile without extensions says so. Ours now takes the same list (plugins/browser/init.luau, openAddExtensionDialog).

How

  • plugins/browser/extensions.luau: renderAddDialog is laid out again, with one candidateRow for a list row; the confirm step gets the background and the button look.
  • plugins/browser/init.luau: the picker's menu placement; the disclosure's state goes.
  • plugins/browser/locales/en.json: three new strings, three changed, three dropped. No other language held the dropped or changed keys.

Official's plugin API gains the button variant submit (packages/plugin/src/gui/host-apis.ts:1745-1750). This plugin API already draws that look under the name primary (crates/opencode-plugin-runtime/src/ui_nodes.rs, variant), so the contract is not touched.

How it differs from official

  • The list's greatest height. Official's list takes up to half the window's height (settings.tsx:698, max-h-[50vh]). Ours keeps the fixed 280 it had before this change: a plugin's layout has no size that is a share of the window. On a tall window official shows more rows at once. Closing it needs a contract addition (a greatest height as a share of the window), which is a follow-up PR once the contract numbers in flight have settled.

Seen while porting, not part of this change:

  • A plugin button that is busy. Official keeps the button's look and words, disables it and puts a 14 loader before the words (packages/app/src/runtime/plugin/ui.tsx:25-41). Ours does so for a small button only; a normal or large one turns into the loading look with the loader alone (crates/opencode-plugin-runtime/src/ui_nodes.rs, button). In this dialog that is the large Add beside the link field. It is in the host, for every plugin: fix(plugins): a busy plugin button keeps its look and its words #1220.

Run

A PR build is of the PR's own head. Head eefdf6dee holds the Rune pin bump #1192. The dialog reads other browsers' profiles, so every pass is kept as the import dialog's is (#1202): the profile variables point under a scratch root of made-up profiles and extensions and are checked in the app's own environment; no Add and no Load from folder is pressed; the root is deleted.

  • Cases 1, 2, 3, 4, 6 and 7 hold on eefdf6dee (Windows x64 CI build, run 45646015198; headless, the app's fixture file, no server; 8 launches, every exit 0). Before: 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: dev on the same pin without this change.
    • 1: a framed list, its head 'From' and the picker; the two that work and the one that partly works first ('Partly supported' under it), then 'Won't work in OpenCode' and the two that will not ('Not supported', 'Add anyway'). Before: no frame, 'From your browsers', one list by name.
    • 2: the picker's menu opens under the picker's start and the second profile's list shows when it is chosen. The dialog opens on the profile used last; the before build opens on a fixed first browser.
    • 3: 'This browser has no extensions' inside the frame.
    • 4: fourteen rows scroll inside the frame's 280-high scroller; the head and the footer stay.
    • 6: 'Load from folder' at the start of the footer with its words on the dialog's text edge; Done at the end in the send button's look; no 'For developers'. Before: Done grey, no 'Load from folder' in the footer.
    • 7: in both themes the dialog is on the base background and the list one layer up. Before, in dark: one colour for all of it.
  • Cases 5 and 8 ran after the merge and hold, on this head's own build (eefdf6dee), sealed the same way, the root made with one browser and one profile; 6 launches, each exit code read whole and 0. 5: the list's head reads 'From' and the browser's name alone; no picker; fourteen rows scroll inside the frame. Before: 'From your browsers', no frame. 8: the link https://example.test/not-a-store typed and the field's Add pressed: a red line, 'The store did not provide this extension. Check the link.', stands under the field and above the frame, outside the scroller; the field is empty again. The app made no connection (0 TCP rows of its process in 120 readings 100 ms apart; with a loopback link, 0 connections offered to a listener), and nothing was written under the root's extension folders. Not read: the installed extensions' list afterwards.

The cases:

  1. A profile with extensions of all three kinds: the list is framed, its header reads "From" and a picker; the two that work and the one that partly works ("Partly supported") come first, by name; then "Won't work in OpenCode" and the two that will not ("Not supported", their button "Add anyway"). Before: one list by name, under "From your browsers".
  2. The picker: its menu opens under the picker's start; choosing the other profile lists that profile's extensions.
  3. A profile with no extension: "This browser has no extensions" in the frame.
  4. A profile with more extensions than fit: the rows scroll inside the frame; the header and the footer stay.
  5. One profile only: the header reads "From" and the browser's name alone, with no picker (packages/gui-plugins/src/browser/choices.tsx:14-16, settings.tsx:683).
  6. The footer: "Load from folder" at the start, its words on the dialog's edge; Done at the end, in the send button's look. No "For developers".
  7. Both themes: the dialog on the base background, the list one layer up.
  8. A link that is not a store link: the failure line stands under the field, above the frame.

Not reached by this run: the confirm step (it needs an extension that installs) and the folder action's spinner (it needs the system's folder picker).

The picker's order is part of case 2: the profile used last is the one the dialog opens on; before, a fixed order of browsers.

@Hona
Hona marked this pull request as ready for review November 25, 2026 17:46
@Hona
Hona merged commit 6dce9f2 into dev Nov 25, 2026
7 checks passed
@Hona
Hona deleted the upstream-f/add-extension-dialog branch November 25, 2026 17:46
Hona added a commit that referenced this pull request Nov 25, 2026
…aft (#1250)

No new official commit since 3ac14c053c. UP-236 (the Add extension dialog redesigned) is ported by #1216, with what ran, the two cases still to run and the one open difference. UP-240 names its draft, #1249, and its line on ours is put right: Rename session edits the title in place, it does not open a dialog.
Hona added a commit that referenced this pull request Nov 25, 2026
Hona added a commit that referenced this pull request Nov 25, 2026
…1259)

No new official commit since 01328b65e9. The Add extension dialog's two cases that followed #1216's merge have run and hold: one profile only, and a link that is not a store link (rejected with no connection made and nothing written).
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