Allow toggling favorite models from the chat model picker #597

Merged
vdmkenny merged 1 commit from vdmkenny/favorite-models into main 2026-06-01 20:08:32 +02:00
vdmkenny commented 2026-06-01 17:32:43 +02:00 (Migrated from github.com)

Chat picker already displayed favorites and shared the odysseus-model-favorites key, but favorites could only be toggled from the side panel. This adds the toggle to the chat picker too.

New:

  • Clickable toggle per row to pin/unpin a model.
  • Re-renders on toggle (keeps search text) so rows move between Favorites/All-models without reopening.
  • Star clicks isolated from row clicks (toggling never picks the model).
  • Inline favorites loader refactored into shared helpers.

Files: static/js/modelPicker.js, static/style.css (.model-switch-fav).

Testing

  • node --check static/js/modelPicker.js — passes.
  • Manual: open chat model picker, click the star on a row → model pins to Favorites and toast shows; click again → unpins. Search text preserved across toggle. Clicking the row body (not the star) still selects the model.
Screenshot 2026-06-01 at 17 33 00
Chat picker already displayed favorites and shared the `odysseus-model-favorites` key, but favorites could only be toggled from the side panel. This adds the toggle to the chat picker too. New: - Clickable toggle per row to pin/unpin a model. - Re-renders on toggle (keeps search text) so rows move between Favorites/All-models without reopening. - Star clicks isolated from row clicks (toggling never picks the model). - Inline favorites loader refactored into shared helpers. Files: `static/js/modelPicker.js`, `static/style.css` (`.model-switch-fav`). ## Testing - `node --check static/js/modelPicker.js` — passes. - Manual: open chat model picker, click the star on a row → model pins to Favorites and toast shows; click again → unpins. Search text preserved across toggle. Clicking the row body (not the star) still selects the model. <img width="381" height="382" alt="Screenshot 2026-06-01 at 17 33 00" src="https://github.com/user-attachments/assets/7fe15ebd-648d-42ae-b906-2b8c74eb3574" />
sleepy merged commit ca3b0b15d1 into main 2026-06-01 20:08:32 +02:00
Owner

Merged via squash. Star toggle in model picker with proper click isolation, ARIA attributes, and touch-friendly hitbox. CSS layout improvements for long model names included.

Merged via squash. Star toggle in model picker with proper click isolation, ARIA attributes, and touch-friendly hitbox. CSS layout improvements for long model names included.
Sign in to join this conversation.
No description provided.