feat(frontend): per-agent effort-level quick-picker (#1596)

Adds a reasoning-effort quick-picker to the agent page's overflow menu,
a direct sibling of the existing model quick-picker, wired to the backend
seam from #1597/#1600: /api/state carries effort + available_efforts, the
picker POSTs { effort } to /api/effort (operator-only, mirroring
/api/model), and live updates arrive via the effort_changed SSE event.

The available levels are the backend's to declare — the frontend holds no
hard-coded list; availableEfforts is seeded from state.available_efforts
on cold-load and the picker section is omitted until the backend supplies
the set. Mirrors the model picker otherwise: postEffort(),
renderEffortChip() (updates the new amber effort-chip + button active
states), the cold-load seed, and the effort_changed handler. Build green.

Applies on the next claude session (operator uses the existing
clear-session), per the backend contract.
This commit is contained in:
iris 2026-06-10 01:26:52 +02:00 committed by mara
commit ceb3e3b01a
3 changed files with 108 additions and 5 deletions

View file

@ -275,16 +275,19 @@ h2, h3 {
padding: 0 0.7em 0.1em;
text-transform: uppercase;
}
.overflow-item-model {
.overflow-item-model,
.overflow-item-effort {
color: var(--muted);
font-variant-numeric: tabular-nums;
}
.overflow-item-model:hover {
.overflow-item-model:hover,
.overflow-item-effort:hover {
color: var(--fg);
background: color-mix(in srgb, var(--purple) 8%, transparent);
border-color: var(--purple-dim);
}
.overflow-item-model.active {
.overflow-item-model.active,
.overflow-item-effort.active {
color: var(--purple);
border-color: var(--purple-dim);
background: color-mix(in srgb, var(--purple) 6%, transparent);
@ -674,15 +677,17 @@ pre.diff {
font-size: 0.8em;
letter-spacing: 0.05em;
}
.model-chip {
.model-chip,
.effort-chip {
display: inline-block;
padding: 0.1em 0.6em;
border: 1px solid var(--purple-dim);
border-radius: 999px;
color: var(--cyan);
font-size: 0.78em;
letter-spacing: 0.04em;
}
.model-chip { color: var(--cyan); }
.effort-chip { color: var(--amber); }
/* Context-window badge. Mirrors Claude Code's bottom-right "N tokens"
chip single primary number (total prompt tokens in use), full
breakdown on hover. Sized/coloured like a peer of model-chip so