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 — fix(app): keep the model picker responsive with large catalogs by neriousy · Pull Request #65189 · anomalyco/opencode

Conversation

@neriousy

@neriousy neriousy commented Nov 20, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Issue for this PR

Closes #65179

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

model picker got really slow with big catalogs (2k+ models). profiled it with a stress story, fixed the hot spots:

  • every hover removed and re-inserted the flyout as a direct child of the dialog, which restyled the whole dialog (2-4k elements, 20-60ms each). the flyout now sits in a wrapper that stays mounted
  • usage(item()) built a new Intl.NumberFormat + Intl.DateTimeFormat per row, and because the row's Show also read active(), it ran again for every row on every hover. formatters are now built once per locale in useUsageFormat, and each row memoizes its budget label. this is the big one for Zen/Go users with budgets
  • SearchList rows use createSelector for the active key, so moving the highlight updates 2 rows instead of all of them
  • model rows keep their object across searches when nothing changed, so a narrower query doesn't re-render every row that stays
  • content-visibility: auto on model dialog rows, so offscreen rows skip layout/paint
  • provider grouping was O(n²) (spread per item), now Map.groupBy
  • SearchHighlight gets the trimmed/lowercased query once from the list instead of computing it per row

still renders every row (no virtualization), so typing is still O(n). virtualizing SearchList w/ sticky headers is a bigger change, left it for a follow up if needed

How did you verify your code works?

stress story with 2,012 models (2x1000 + 2x6, 3 variants each), Playwright, 4x CPU throttle, medians:

before after
open 1.46s 0.67s
hover a row 691ms 123ms
keystroke 456ms 230ms
arrow down 117ms 17ms

same thing with a Console budget on every row:

before after
open 4.42s 1.02s
hover a row 1.73s 164ms
keystroke 837ms 241ms
arrow down 135ms 24ms
  • bun typecheck in app + ui
  • unit tests in src/providers and src/usage pass
  • e2e mobile-model-pickers, composer, settings-search, command-palette in built mode: 93 pass, 3 fail locally on macOS (2 composer paste, 1 command palette shortcut). they fail the same way on origin/dev

Screenshots / recordings

no visual change, only speed. same stress story with a Console budget on every row, 4x CPU throttle. the red dot is the pointer, it lags when the main thread is blocked. the box in the top left shows how long the last action took

before (dev)

before.mp4

after

after.mp4
before after
before: median open 2484 ms, hover 1751 ms, key 752 ms, arrow 132 ms after: median open 1042 ms, hover 185 ms, key 229 ms, arrow 30 ms

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

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

All reactions
@neriousy
fix(app): keep the model picker responsive with large catalogs
23cd20e
opencodejr[bot]
opencodejr Bot reviewed Nov 20, 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.

Looks good. On a 2,023-model catalog, served from source and timed with the #65179 Playwright script, the base was clearly slow: hover took ~460 ms, ArrowDown ~270 ms and search keystrokes 575–900 ms. With this PR, hover takes ~45 ms, ArrowDown ~17 ms and keystrokes 46–160 ms. Opening went from ~1.1 s to ~0.8 s. The flyout looks the same in base and PR screenshots. tsc is clean in app and ui. The unit tests in src/providers and src/usage have the same 2 failures on the base.

I checked a few things that could regress and they hold up:

  • Map.groupBy is already polyfilled.
  • Rows have a fixed 32px height, so content-visibility: auto doesn't collapse offscreen rows or throw off scroll and reveal positions.
  • The display: contents wrapper doesn't change where the flyout is positioned.

Public API is unchanged; this only touches app and UI internals.

Related: #64570, #62583

Sorry, something went wrong.

Uh oh!

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

All reactions
@neriousy
neriousy merged commit bf006b5 into dev Nov 20, 2026
15 checks passed

Uh oh!

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

@neriousy
neriousy deleted the model-picker-perf branch November 20, 2026 14:46
@neriousy neriousy mentioned this pull request Nov 20, 2026
Performance issues in the model settings when signed in with OpenRouter #62583
Closed
huuhabn pushed a commit to huuhabn/opencode that referenced this pull request Nov 20, 2026
@neriousy Huu Ha
fix(app): keep the model picker responsive with large catalogs (anoma…
bed53e1
…lyco#65189)
@neriousy neriousy mentioned this pull request Nov 23, 2026
desktop: model picker stutters on hover and scroll #64570
Closed
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
@opencodejr opencodejr Bot mentioned this pull request Nov 25, 2026
Huge input lag/performance problems when searching model list in TUI #66326
Closed
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

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.

Desktop regression: model list takes 8+ seconds to load and update, freezing the UI

Uh oh!

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

1 participant

@neriousy
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.