Skip to content

feat(desktop): inline model picker in the status bar - #37738

Merged
OutThisLife merged 4 commits into
mainfrom
bb/statusbar-model-menu
Jun 3, 2026
Merged

feat(desktop): inline model picker in the status bar#37738
OutThisLife merged 4 commits into
mainfrom
bb/statusbar-model-menu

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator
image image

Summary

Replaces the status-bar model chip's full-screen modal with a Cursor-style inline dropdown, and makes its options real and persistent.

  • Grouped, stable list — models grouped by provider (uppercase headers), providers sorted alphabetically so selecting a model only moves the checkmark (no recency reshuffle). Shows the curated top models per provider; search spans everything.
  • Per-model Edit submenu — hover any model to tweak Thinking, Fast, and reasoning Effort (Min/Low/Med/High/Max). Controls are capability-gated per model via flags now carried in the model.options payload — no toggle appears for an option the backend would reject.
  • Unified Fast toggle — flips the speed=fast request param where supported (Opus 4.6, OpenAI flagships), otherwise swaps to the model's -fast variant. A base model and its -fast sibling collapse into a single row.
  • Editable model list — an "Edit Models…" dialog (localStorage-backed) to choose which models appear in the dropdown; falls back to the curated default until customized.
  • Status-bar label reflects live session state, e.g. Opus 4.8 · Fast Max.

Architecture / reuse

  • New reusable dropdown primitives in components/ui/dropdown-menu: DropdownMenuSearch, shared dropdownMenuRow/dropdownMenuSectionLabel tokens, a hideChevron sub-trigger prop, and portaled + collision-aware submenus (no more clipping).
  • Reactive session state (model/provider/effort/fast/session) is read from nanostores in the leaf components instead of being prop-drilled through the menu memo — so editing an option re-renders in place without rebuilding/closing the dropdown.
  • Backend: build_models_payload(..., capabilities=True) attaches {model: {fast, reasoning}} per provider row (wired into the model.options JSON-RPC + REST mirror). _is_anthropic_fast_model docstring clarified (logic unchanged: the speed param is Opus 4.6 only; Opus 4.8 fast is the separate -fast model).

Test plan

  • Restart desktop backend (capability flags ride in model.options), open the model chip in the status bar
  • Switch models — list order stays stable, only the checkmark moves
  • Hover the active model → Edit: toggle Thinking/Fast, pick Effort; dropdown stays open, status bar label updates
  • Fast on Opus 4.8 swaps to/from the -fast model; Fast toggle absent on models with no fast offering
  • "Edit Models…" → toggle models on/off; dropdown reflects selection and persists across restart
  • scripts/run_tests.sh tests/cli/test_fast_command.py and desktop npm run type-check / lint / test:ui pass

Replace the status-bar model chip's modal with a Cursor-style dropdown:
- providers grouped by name in a stable order (no recency reshuffle on select)
- per-model hover-Edit submenu for reasoning effort + fast, gated by per-model
  capabilities now surfaced in the model.options payload
- unified Fast toggle: flips the speed=fast param where supported, else swaps
  to the model's `-fast` variant (base and variant collapse into one row)
- localStorage-backed "Edit Models" dialog to choose which models appear

Adds reusable dropdown primitives (DropdownMenuSearch, shared row/label
tokens, portaled + collision-aware submenus) and reads session state from
nanostores rather than prop-drilling, so editing options doesn't rebuild and
close the menu.
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: bb/statusbar-model-menu vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9695 on HEAD, 9694 on base (🆕 +1)

🆕 New issues (1):

Rule Count
invalid-assignment 1
First entries
hermes_cli/inventory.py:186: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to `def get_model_capabilities(provider: str, model: str) -> ModelCapabilities | None`

✅ Fixed issues: none

Unchanged: 5019 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the desktop status-bar model picker from a full-screen modal to an inline, searchable dropdown with per-model option editing, and extends the backend model.options payload to include per-model capability flags so the UI can gate controls (fast/reasoning) appropriately.

Changes:

  • Desktop: add inline status-bar model dropdown with search, stable provider grouping, per-model “Edit” submenu, and a persisted “visible models” customization dialog.
  • Backend: extend build_models_payload(..., capabilities=True) to attach per-provider {model: {fast, reasoning}} capability maps, and plumb it through both JSON-RPC and REST model-options endpoints.
  • Fast-mode semantics: clarify that Anthropic speed=fast applies to Opus 4.6 only; Opus 4.8 uses a separate …-fast model id.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tui_gateway/server.py Requests capabilities=True for model.options JSON-RPC payload.
tests/cli/test_fast_command.py Updates fast-mode tests/docs to reflect Opus 4.6-only speed=fast behavior.
hermes_cli/web_server.py Requests capabilities=True for REST /api/model/options.
hermes_cli/models.py Clarifies _is_anthropic_fast_model docstring to distinguish param vs …-fast model ids.
hermes_cli/inventory.py Adds capabilities flag and _apply_capabilities() to include {fast, reasoning} per model.
apps/desktop/src/types/hermes.ts Adds capabilities typing to model option providers.
apps/desktop/src/store/model-visibility.ts Adds localStorage-backed model visibility state + base/…-fast family collapsing.
apps/desktop/src/lib/model-status-label.ts Adds shared model display formatting + status bar label formatting.
apps/desktop/src/lib/model-status-label.test.ts Adds vitest coverage for model name + status label formatting.
apps/desktop/src/components/ui/dropdown-menu.tsx Adds dropdown search input + shared tokens + portaled/collision-aware submenus.
apps/desktop/src/components/model-visibility-dialog.tsx Adds “Edit Models…” dialog for per-provider visible model selection.
apps/desktop/src/app/shell/statusbar-controls.tsx Adds configurable menu alignment for status-bar dropdowns.
apps/desktop/src/app/shell/model-menu-panel.tsx Implements the inline model dropdown panel (search, grouping, edit submenus).
apps/desktop/src/app/shell/model-edit-submenu.tsx Implements per-model options submenu (Thinking/Fast/Effort) + fast control resolution.
apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx Wires status-bar model chip to the new inline menu and live session state label.
apps/desktop/src/app/session/hooks/use-model-controls.ts Makes selectModel async-returning to support “switch then edit” flows.
apps/desktop/src/app/model-visibility-overlay.tsx Adds overlay wrapper for the model visibility dialog.
apps/desktop/src/app/desktop-controller.tsx Wires the new model menu panel + model visibility overlay into the app shell.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/desktop/src/app/shell/model-edit-submenu.tsx
Comment thread apps/desktop/src/app/shell/model-menu-panel.tsx
Comment thread apps/desktop/src/app/session/hooks/use-model-controls.ts Outdated
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 3, 2026
- selectModel reports success; edits bail (and roll back) instead of landing
  on the previously active model when a switch fails
- Fast toggle stays available to turn off a carried-over speed param even when
  the new model has no native fast mechanism
- active row's "Fast" label derives from the same fastControl as the submenu
  toggle, so it's consistent and handles standalone `-fast` model ids

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread apps/desktop/src/app/session/hooks/use-model-controls.ts
selectModel snapshots the prior model/provider and restores the store +
query cache when the backend switch fails, so the UI never shows a model the
backend didn't actually select.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread apps/desktop/src/app/shell/model-menu-panel.tsx Outdated
The model row is a Radix sub-trigger (no onSelect), so switching was
pointer-only. Wire Enter/Space alongside onClick so keyboard users can switch
models too.
@OutThisLife
OutThisLife merged commit 54343bc into main Jun 3, 2026
22 checks passed
@OutThisLife
OutThisLife deleted the bb/statusbar-model-menu branch June 3, 2026 01:00
davidgut1982 pushed a commit to davidgut1982/hermes-agent that referenced this pull request Jun 5, 2026
…model-menu

feat(desktop): inline model picker in the status bar
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
feat(desktop): inline model picker in the status bar
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
…model-menu

feat(desktop): inline model picker in the status bar
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…model-menu

feat(desktop): inline model picker in the status bar
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…model-menu

feat(desktop): inline model picker in the status bar
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…model-menu

feat(desktop): inline model picker in the status bar
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…model-menu

feat(desktop): inline model picker in the status bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants