[PR #4343] Add favorites to model selector (#23) #10942

Closed
opened 2026-02-16 18:15:42 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/4343

State: closed
Merged: Yes


Introduce model favorites across in TUI with grouping, bookmarking (ctrl+f), and cycle keybinds; update config, SDKs, and docs.

  • Shared UI:
    • SelectDialog (packages/ui/src/components/select-dialog.tsx) adds onKeyEvent to handle custom keyboard actions and passes the currently selected item.
  • State/Local Context:
    • Desktop local.model (packages/desktop/src/context/local.tsx) adds favorites persistence (localStorage), favorite() getter, and toggleFavorite().
    • TUI local.model (packages/opencode/src/cli/cmd/tui/context/local.tsx) adds persistent favorite list (saved to model.json), favorite(), toggleFavorite(), and cycleFavorite() with recent list updates and validation/toasts.
  • TUI:
    • Command palette (packages/opencode/src/cli/cmd/tui/app.tsx) adds actions for cycling favorite models forward/reverse.
    • Model dialog (packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx) shows Favorites section, stars for favorites, orders recents with current first, hides duplicates, and supports ctrl+f to toggle favorite.
  • Config/SDK/Docs:
    • Keybinds: add model_cycle_favorite and model_cycle_favorite_reverse in packages/opencode/src/config/config.ts, surfaced in SDKs (Go/TS/Python) and docs (web/docs/keybinds.mdx).
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4343 **State:** closed **Merged:** Yes --- Introduce model favorites across in TUI with grouping, bookmarking (ctrl+f), and cycle keybinds; update config, SDKs, and docs. - **Shared UI**: - `SelectDialog` (`packages/ui/src/components/select-dialog.tsx`) adds `onKeyEvent` to handle custom keyboard actions and passes the currently selected item. - **State/Local Context**: - Desktop `local.model` (`packages/desktop/src/context/local.tsx`) adds `favorites` persistence (localStorage), `favorite()` getter, and `toggleFavorite()`. - TUI `local.model` (`packages/opencode/src/cli/cmd/tui/context/local.tsx`) adds persistent `favorite` list (saved to `model.json`), `favorite()`, `toggleFavorite()`, and `cycleFavorite()` with recent list updates and validation/toasts. - **TUI**: - Command palette (`packages/opencode/src/cli/cmd/tui/app.tsx`) adds actions for cycling favorite models forward/reverse. - Model dialog (`packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx`) shows Favorites section, stars for favorites, orders recents with current first, hides duplicates, and supports `ctrl+f` to toggle favorite. - **Config/SDK/Docs**: - Keybinds: add `model_cycle_favorite` and `model_cycle_favorite_reverse` in `packages/opencode/src/config/config.ts`, surfaced in SDKs (Go/TS/Python) and docs (`web/docs/keybinds.mdx`).
yindo added the pull-request label 2026-02-16 18:15:42 -05:00
yindo closed this issue 2026-02-16 18:15:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10942