# feat\(web\): OpenCode's model picker folds each vendor into a collapsible section · PR \#30801 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/30801)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: closed

Source repository: Unavailable fork

Source branch: feat/opencode-picker-sections

Target branch: main

Head commit: 217c8a865ce57f6ceefca7871ec3b21ac1b81f60

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/30801)

[Commits](https://git.cafe/pingdotgg/t3code/pull/30801/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/30801/diffs?format=markdown)

## Description

---

With several providers connected through OpenCode (a subscription, an API key, the free Zen models), the model picker lists every model from every vendor in one interleaved list. Finding one vendor's models means scrolling past all the others.

The server already labels each OpenCode model with its upstream vendor (`subProvider`). The picker now uses that label: when a provider tab spans two or more vendors, its models fold into collapsible vendor sections sorted by name. A tab with a single vendor still renders as a plain list.

- The section holding the model the picker opened with starts open, otherwise the first section. Picking or starring a model in the docked picker does not open or collapse other sections; only clicking a header does.
- Favorites and models without a vendor stay above the sections. The Favorites tab and search stay flat, so search still finds models in collapsed sections.
- Headers are list items, so the keyboard and Enter toggle them the same way as the existing "Show more" row, which still trails the list. Number-key shortcuts count only visible models.
- Rows inside a section drop the vendor label, since the header already names it.
- Open sections last for one picker session. Nothing is persisted, and there are no server, contract, or mobile changes. Mobile keeps showing the vendor as a row subtitle.

This revisits #8072, which was closed for its size across server, web, and mobile. This version is web and desktop only (+283 lines, 124 of them tests) and builds on the `subProvider` labels that #7562 kept. I have no maintainer approval of the direction yet: see [this comment on #8072](https://github.com/pingdotgg/t3code/pull/8072#issuecomment-5601682992).

| Before | After, on open | After, second section expanded | After, search |
|---|---|---|---|
| ![before](https://lh3.googleusercontent.com/d/1rwLVE70XSsLR8aMDVwK76WSWfKdMRjkj) | ![after open](https://lh3.googleusercontent.com/d/1rUiFih_1oqDOQY4q34ICj3r8J9AghU8w) | ![after expanded](https://lh3.googleusercontent.com/d/175_y9ojbX-eC1BbTFEdWa7HRPFo0eiGN) | ![after search](https://lh3.googleusercontent.com/d/1hahlIS9yMcCUHEQKDKj4NBXG_rF_eh_V) |

The screenshots render `ProviderModelPicker` in a browser test with a sample four-vendor OpenCode catalog, not a running app with real providers.

Proof: `vp run check:changed` passes. The new case in `ProviderModelPicker.browser.test.tsx` fails on main (the second vendor's models are visible on open). It also covers a docked pick from a second section leaving the first section open. `modelPickerVendorSections.test.ts` covers sort order, pinned models, the two-vendor minimum, and a starred opening model keeping its section open. Not checked: a live OpenCode server with several connected providers, and the Electron desktop shell.

Implemented with Claude Opus 5.5 in T3 Code, reviewed by Claude Opus 5.5 and GPT-6.1 Sol.


Takeover verification on `1b6c5b0e75`: blacksmith `vp run check:changed` passes, including the focused browser tests. The real app was also exercised with the live OpenCode catalog for section toggles, collapsed search, clearing search, provider switching, and model selection.

![live OpenCode picker verification](https://uploads-production-47e4.up.railway.app/files/e3908971-4bc3-4585-9d26-bf0090b8236b/picker-verification.gif)

