GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(plugin): add settings rows, selects and menu rows to ctx.ui by Hona · Pull Request #61527 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Nov 4, 2026 •
edited by opencodejr Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Third-party GUI plugins cannot import @opencode/ui, and ctx.ui had no settings rows, select, or menu rows. Community plugins hand-copy the app's private settings markup (data-component="settings-row", settings-tab-header, …) or put a ui.Button inside the project menu, which does not navigate with the keyboard or close the menu.

This adds the missing pieces to ctx.ui, in the same thin-wrapper style as the existing members.

const ui = ctx.ui

ctx.add(SettingsPage, {
  id: "usage",
  get title() {
    return ctx.t("title")
  },
  get entries() {
    return [{ id: "usage-period", title: ctx.t("period") }]
  },
  render: () => (
    <ui.SettingsLayout title={ctx.t("title")} description={ctx.t("description")}>
      <ui.SettingsSection title={ctx.t("tracking")}>
        <ui.SettingsRow id="usage-period" title={ctx.t("period")} description={ctx.t("period.description")}>
          <ui.Select label={ctx.t("period")} options={periods()} value={period()} onChange={setPeriod} />
        </ui.SettingsRow>
      </ui.SettingsSection>
    </ui.SettingsLayout>
  ),
})

ctx.add(Slot, {
  at: "session.location.menu",
  render: (input) => (
    <>
      <ui.MenuItem label={ctx.t("usage")} icon="status" onSelect={() => open(input.session)} />
      <ui.MenuSub label={ctx.t("openIn")} icon="outline-share">
        <For each={apps()}>{(app) => <ui.MenuItem label={app.name} onSelect={() => launch(app)} />}</For>
      </ui.MenuSub>
    </>
  ),
})
Before: ctx.ui only After

Why these

Audit of @opencode/ui/* and @opencode/session-ui/* imports in packages/gui-plugins/src against what ctx.ui already offers:

  • Settings markup: pairing/page.tsx, updater/section.tsx, review/settings.tsx and updater/beta-page.tsx each copy the host's settings row, section and page header markup. no-phux/phux and slkiser/opencode-quota copy the same markup.
  • Select: review/parts.tsx uses @opencode/ui/select; the app's settings rows use it for every dropdown. opencode-quota falls back to a native <select>.
  • Menu rows: details/location-menu.tsx, location-workspace.tsx and workspace-menu.tsx render Menu.Item, Menu.Group, Menu.Sub straight into the project menu. session.location.menu is a public slot, but a third party could only put a Button there (opencode-quota does).
  • Everything else built-ins import (Tabs, ProgressCircle, DiffChanges, file and review views, motion, theme internals) is feature-specific or already covered.

What changed

  • Ui.MenuItem(props: UiMenuItem): same fields as a Ui.Menu item (label, icon, keys, disabled, onSelect).
  • Ui.MenuSeparator(), Ui.MenuGroup({ label, children }), Ui.MenuSub({ label, icon?, disabled?, onOpenChange?, children }).
  • Ui.Select<T extends string>({ options: { value, label }[], value, onChange, label, placeholder?, disabled?, invalid?, placement?, class? }).
  • Ui.SettingsLayout({ title, description?, actions?, children }): page header plus sectioned body; search that reveals the page highlights the header.
  • Ui.SettingsSection({ title?, children, footer? }): heading over the bordered list.
  • Ui.SettingsRow({ title, description?, id?, children? }): id is the SettingEntry.id that search scrolls to and highlights.
  • packages/app/src/runtime/plugin/ui.tsx implements them. Settings components reuse the settings screen's stylesheet, so the startup chunk does not grow.
  • Pairing, updates and review now use ctx.ui instead of their copied rows. The pairing page renders pixel-identical.
  • SDK TSDoc, SlotMap["session.location.menu"], SettingsPage.render, the GUI plugin guide and packages/gui-plugins/README.md describe the new members.
  • plugin-host.spec.ts: the ctx.ui case also renders the settings components and a select, and puts menu rows in a host menu (the fixture now holds session.location.menu in a menu).

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none" stroke="currentColor">
  <style>
    .knob{animation:k 3s ease-in-out infinite}
    .hl{animation:h 3s steps(1) infinite}
    @keyframes k{0%,40%{transform:translateX(0)}50%,90%{transform:translateX(8px)}100%{transform:translateX(0)}}
    @keyframes h{0%{transform:translateY(0)}33%{transform:translateY(12px)}66%{transform:translateY(24px)}}
    @media (prefers-reduced-motion:reduce){.knob,.hl{animation:none}}
  </style>
  <rect x="8.5" y="8.5" width="140" height="55" rx="4" opacity=".35"/>
  <rect x="16" y="16" width="44" height="4" rx="2" fill="currentColor" stroke="none" opacity=".7"/>
  <rect x="16" y="24" width="70" height="3" rx="1.5" fill="currentColor" stroke="none" opacity=".35"/>
  <rect x="118.5" y="17.5" width="20" height="10" rx="5" opacity=".6"/>
  <circle class="knob" cx="123.5" cy="22.5" r="3" fill="currentColor" stroke="none" opacity=".8"/>
  <line x1="16" y1="36" x2="140" y2="36" opacity=".2"/>
  <rect x="16" y="44" width="36" height="4" rx="2" fill="currentColor" stroke="none" opacity=".7"/>
  <rect x="16" y="52" width="60" height="3" rx="1.5" fill="currentColor" stroke="none" opacity=".35"/>
  <rect x="108.5" y="44.5" width="30" height="10" rx="2" opacity=".5"/>
  <path d="M131 48.5l2 2 2-2" opacity=".6"/>
  <rect x="164.5" y="8.5" width="68" height="55" rx="4" opacity=".35"/>
  <rect class="hl" x="168" y="13" width="61" height="11" rx="2" fill="currentColor" stroke="none" opacity=".12"/>
  <g fill="currentColor" stroke="none">
    <rect x="172" y="17" width="4" height="4" rx="1" opacity=".5"/><rect x="180" y="17.5" width="34" height="3" rx="1.5" opacity=".6"/>
    <rect x="172" y="29" width="4" height="4" rx="1" opacity=".5"/><rect x="180" y="29.5" width="28" height="3" rx="1.5" opacity=".6"/>
    <rect x="172" y="41" width="4" height="4" rx="1" opacity=".5"/><rect x="180" y="41.5" width="38" height="3" rx="1.5" opacity=".6"/>
    <rect x="180" y="55.5" width="30" height="3" rx="1.5" opacity=".35"/>
  </g>
  <line x1="168" y1="51" x2="229" y2="51" opacity=".2"/>
</svg>

Added by the opencode bot (AI-generated).

Public API: adds MenuItem, MenuSeparator, MenuGroup, MenuSub, Select, SettingsLayout, SettingsSection and SettingsRow to the GUI plugin ctx.ui (backwards compatible)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
feat(plugin): add settings rows, selects and menu rows to ctx.ui
d923295
@Hona
Hona requested a review from Brendonovich as a code owner November 4, 2026 00:04
Copilot AI balanced review requested due to automatic review settings November 4, 2026 00:04
Copilot AI reviewed Nov 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencodejr[bot]
opencodejr Bot reviewed Nov 4, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks sound. The new ctx.ui members are thin wrappers over the host's Menu, Select and settings markup, and the built-in plugins switch over to them without changing behaviour. Settings search still reveals the rows: it looks up the data-action id and then the closest settings row, so moving the id from the control to the row keeps the reveal and the mobile e2e selector working. tsc passes for plugin, gui-plugins and app. I couldn't run the Playwright component test because Chromium can't start in this environment, so this is from reading the code and type-checking only.

Public API (GUI plugin SDK Ui): this adds MenuItem, MenuSeparator, MenuGroup, MenuSub, Select<T>, SettingsLayout, SettingsSection and SettingsRow, and the new prop types UiMenuGroupProps, UiMenuSubProps, UiSelectOption, UiSelectProps, UiSettingsLayoutProps, UiSettingsSectionProps and UiSettingsRowProps. The changes to UiMenuItem, SettingsPage.render and SlotMap["session.location.menu"] are doc-only. Nothing is removed or changed, so it is backwards compatible. A third-party implementation of Ui would need the new members, but the host is the only implementation.

No blocking concerns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona merged commit 3fcdcb3 into dev Nov 4, 2026
21 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Hona
Hona deleted the plugin-ui-kit branch November 4, 2026 00:10
@github-actions github-actions Bot mentioned this pull request Nov 4, 2026
📊 AI CLI 工具社区动态日报 2026-11-04 litang9/big_model_radar#650
Open
@amrkmn amrkmn mentioned this pull request Nov 7, 2026
opencode 2.2.6 amrkmn/homebrew-tap#1217
Closed
1 task
This was referenced Nov 7, 2026
feat: opencode release v2.2.6 sprisa/opencode-server#84
Merged
Tool release: OpenCode 2 v2.2.6 (was v2.2.5) agent-sh/agnix#1808
Closed
@bew

bew commented Nov 7, 2026

Copy link
Copy Markdown

Hello, is there any plans to add similar components for the TUI plugin context?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wmfeht wmfeht mentioned this pull request Nov 7, 2026
Keep fields flat on OpenCode Desktop 2.2.6 wmfeht/omarchy-opencode-theme#3
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@opencodejr opencodejr[bot] opencodejr[bot] left review comments
@Brendonovich Brendonovich Awaiting requested review from Brendonovich

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

3 participants

@Hona @bew
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.