mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 03:00:23 +00:00
c0bbd23993
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 <span id="composerModelBadge"> 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.