GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
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
|
Before: ctx.ui only |
After |
|---|---|
![]() |
![]() |
Audit of @opencode/ui/* and @opencode/session-ui/* imports in packages/gui-plugins/src against what ctx.ui already offers:
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.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>.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).Tabs, ProgressCircle, DiffChanges, file and review views, motion, theme internals) is feature-specific or already covered.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.ctx.ui instead of their copied rows. The pairing page renders pixel-identical.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).<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.
There was an error while loading. Please reload this page.
There was a problem 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.
There was an error while loading. Please reload this page.
There was a problem 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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hello, is there any plans to add similar components for the TUI plugin context? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.