fix(tui): show models in provider section even when in recents/favorites#15025
Open
agopalareddy wants to merge 6 commits intoanomalyco:devfrom
Open
fix(tui): show models in provider section even when in recents/favorites#15025agopalareddy wants to merge 6 commits intoanomalyco:devfrom
agopalareddy wants to merge 6 commits intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
a76f12b to
d848c9b
Compare
…s.ts Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
dialog-select uses JSON.stringify(value) as the DOM id for scroll targeting. When a model appears in both a section (Favorites/Recent) and its provider group, duplicate ids caused moveTo() to always scroll to the section entry instead of the provider entry. Add a `section` discriminator to values returned by buildSectionOptions so each item has a unique identity. onSelect handlers strip the field before calling local.model.set.
25b68c3 to
7347061
Compare
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
6 tasks
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue for this PR
Closes #3874
Type of change
What does this PR do?
Fix 1 — Models disappear from provider section when added to Favorites/Recent
When a model was added to Favorites or Recent it was filtered out of its provider section in the model picker. Removed the filter in
providerOptionsso models now appear in all relevant sections simultaneously.Fix 2 — Navigation jumps to Favorites/Recent when arrowing through provider list
dialog-selectusesJSON.stringify(value)as the DOM id for scroll targeting. When a model appeared in both a section (Favorites/Recent) and its provider group, duplicate ids causedmoveTo()to always scroll to the section entry, making provider-list entries appear invisible when navigating with the keyboard. Added asectiondiscriminator to values returned bybuildSectionOptionsso every item has a unique id.onSelectandtoggleFavoritehandlers strip the field before callinglocal.model.set.Extraction
Pulled the pure helpers into
dialog-model-utils.tsso they can be unit tested without spinning up the full TUI.How did you verify your code works?
Added 8 unit tests in
packages/opencode/test/cli/tui/dialog-model.test.tscovering: models in recents/favorites still appear in provider groups, section values carry unique discriminators, all composed values produce uniqueJSON.stringifyids (no duplicate DOM ids), empty recents/favorites, deprecated model exclusion, and provider ordering.Screenshots / recordings
Screen-recording:
https://github.com/user-attachments/assets/edec6c0f-3ab5-40bc-b931-9f191629dd00
Checklist