From c0bbd23993e6bc7ac7ffe1567a341fff4ecbb178 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 30 Apr 2026 03:11:57 +0000 Subject: [PATCH] fix: remove PRIMARY chip badge + add Claude Opus 4.7 label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The composer-model-badge ("PRIMARY"/"FALLBACK N") added in #1287 was projected onto the model chip itself, which added ~71px (≈30% of the chip's width) of redundant signal: the model name is already right there, so a pill announcing "this is your configured primary" is just clutter that competes with real affordances. The badges still render in the dropdown rows (model-opt-badge), where they actually distinguish picker rows. This PR strips the chip projection only. Separately, the new claude-opus-4-7 model had no label entry, so the generic "split on dashes, replace with spaces" fallback formatter was turning it into "Claude Opus 4 7" (no dot between the major and minor versions). Every other Claude model in this hardcoded label table is explicitly listed, so adding the missing entry is the right fix. Changes: - static/index.html: drop from chip - static/ui.js: drop badgeEl/badge logic from syncModelChip() - static/style.css: drop .composer-model-badge* rules (4 lines) - api/config.py: add 3 label entries for claude-opus-4.7 — the anthropic/claude-opus-4.7 form (in _FALLBACK_MODELS), the bare claude-opus-4.7 form (in _PROVIDER_MODELS["anthropic"]), and the dashed claude-opus-4-7 form (in the bare-id static labels block, which is what live-fetched Anthropic API responses return) - tests/test_model_picker_badges.py: flip the chip-badge presence assertions into absence assertions, plus a symmetric guard that syncModelChip() never references composerModelBadge again Backend `_build_configured_model_badges()` and the `configured_model_badges` payload in `/api/models` are intentionally preserved — the dropdown rows still consume them. Tests: 3252 passed, 2 skipped, 3 xpassed (full suite). Visual verification: chip width 235px → 164px (saves 71px) when the model is the configured primary. Label correctly renders "Claude Opus 4.7" instead of "Claude Opus 4 7". Closes nothing — direct user feedback from Nathan. --- api/config.py | 3 +++ static/index.html | 1 - static/style.css | 4 ---- static/ui.js | 12 ------------ tests/test_model_picker_badges.py | 23 +++++++++++------------ 5 files changed, 14 insertions(+), 29 deletions(-) diff --git a/api/config.py b/api/config.py index 21dde7d6..406261e2 100644 --- a/api/config.py +++ b/api/config.py @@ -503,6 +503,7 @@ _FALLBACK_MODELS = [ {"provider": "OpenAI", "id": "openai/gpt-5.4-mini", "label": "GPT-5.4 Mini"}, {"provider": "OpenAI", "id": "openai/gpt-5.4", "label": "GPT-5.4"}, # Anthropic — 4.6 flagship + 4.5 generation + {"provider": "Anthropic", "id": "anthropic/claude-opus-4.7", "label": "Claude Opus 4.7"}, {"provider": "Anthropic", "id": "anthropic/claude-opus-4.6", "label": "Claude Opus 4.6"}, {"provider": "Anthropic", "id": "anthropic/claude-sonnet-4.6", "label": "Claude Sonnet 4.6"}, {"provider": "Anthropic", "id": "anthropic/claude-sonnet-4-5", "label": "Claude Sonnet 4.5"}, @@ -641,6 +642,7 @@ def _resolve_provider_alias(name: str) -> str: # Well-known models per provider (used to populate dropdown for direct API providers) _PROVIDER_MODELS = { "anthropic": [ + {"id": "claude-opus-4.7", "label": "Claude Opus 4.7"}, {"id": "claude-opus-4.6", "label": "Claude Opus 4.6"}, {"id": "claude-sonnet-4.6", "label": "Claude Sonnet 4.6"}, {"id": "claude-sonnet-4-5", "label": "Claude Sonnet 4.5"}, @@ -738,6 +740,7 @@ _PROVIDER_MODELS = { {"id": "gpt-5", "label": "GPT-5"}, {"id": "gpt-5-codex", "label": "GPT-5 Codex"}, {"id": "gpt-5-nano", "label": "GPT-5 Nano"}, + {"id": "claude-opus-4-7", "label": "Claude Opus 4.7"}, {"id": "claude-opus-4-6", "label": "Claude Opus 4.6"}, {"id": "claude-opus-4-5", "label": "Claude Opus 4.5"}, {"id": "claude-opus-4-1", "label": "Claude Opus 4.1"}, diff --git a/static/index.html b/static/index.html index 34dd1515..50d5a59e 100644 --- a/static/index.html +++ b/static/index.html @@ -401,7 +401,6 @@