ui: log page tone badge follows the toggle (novice / pro)

The Strategic Log Archive panel header used to show two engineery
badges sourced from server config:
  new logs use: tone intermediate analysis speculative

Both were misleading:
- The tone badge described the SERVER's generator setting, not the
  user's reading preference — confusingly disconnected from the
  Novice | Pro toggle in the topbar that actually controls what AI
  panels render.
- The analysis flag is always SPECULATIVE in production, so the badge
  carried no information.

Drop the "new logs use:" prefix and the analysis badge. The tone badge
now mirrors the user's toggle: NOVICE → "novice", INTERMEDIATE → "pro"
(same data values; just the display label flips, matching the header
relabel from 3e1a14f).

Wiring lives in base.html: a new cassandraSyncToneBadge(tone) helper
updates the #tone-badge element when present. Called from
DOMContentLoaded (so the initial badge picks up the localStorage tone)
and from cassandraSetTone (so toggling the header updates the badge
live, without a page refresh).

current_tone / current_analysis are removed from _log_page_context —
log.html was the only consumer and neither key is referenced now.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Giorgio Gilestro 2026-05-29 12:17:49 +02:00
parent 259146ecdc
commit 6c4c711830
3 changed files with 23 additions and 6 deletions

View file

@ -8,9 +8,11 @@
<span class="meta">
selected {{ selected_iso }}
&nbsp;·&nbsp;
<span class="meta__hint">new logs use:</span>
<span class="badge badge--tone-{{ current_tone | lower }}">tone {{ current_tone | lower }}</span>
<span class="badge badge--analysis-{{ current_analysis | lower }}">analysis {{ current_analysis | lower }}</span>
{# Tone badge mirrors the header toggle. base.html's DOMContentLoaded
hook and cassandraSetTone() both update this element so the label
stays in step with the user's choice — no need to re-render the
page when the toggle flips. #}
<span id="tone-badge" class="badge badge--tone-pro">tone <span data-tone-label>pro</span></span>
</span>
</div>