Skip to content

Fix: make the per-turn token metric readable in every theme - #68

Merged
DevMando merged 1 commit into
mainfrom
fix/token-metric-visibility
Sep 10, 2026
Merged

DevMando merged 1 commit into
mainfrom
fix/token-metric-visibility

Conversation

@DevMando

Copy link
Copy Markdown
Owner

Summary

The token count shown after each turn was effectively invisible in several themes. It now sits in a small pill with its own background rather than being faint text at the edge of the pane, and the corner shading on the themes that imitate a screen has been eased.

What was happening

The metric was drawn as pale text, right-aligned. That combination put the smallest and palest element in the application in the exact spot where the themes that imitate a display are darkest — the shading around the edge of a simulated screen.

Measured against the contrast the text needed, it was reaching well under half of it. On the CRT and amber terminal themes it was worse than a 2:1 ratio, which in practice means it was not readable at all. On the vacuum-fluorescent, vector scope, microfiche and LCD themes it was better but still short.

Worth recording for anyone who revisits this: raising the text's colour would not have fixed it. Even at full brightness the metric still failed on two themes, because the corner shading was strong enough to defeat any colour the palette could offer.

That points at a real distinction. An earlier change added a contrast floor for themes viewed through an overlay, and that works for the CRT's scanlines, which dim the whole pane evenly. Corner shading is not even — it varies by position, so the very same colour is comfortably readable in the middle of the window and unreadable near the edge. No palette-level rule can answer that.

What changed

  • The metric is now a pill. It carries its own background and border, so it reads as a deliberate piece of the interface rather than text trailing off the edge, and it stays readable over a busy chat background as well. This follows the treatment the live plan status card already uses for the same reason.
  • It is de-emphasised by size and containment rather than by being faint. That is the more durable choice: something small and bounded stays readable no matter what is drawn over it, whereas something faint stops being readable the moment anything is.
  • The corner shading was too heavy on all four affected themes and has been eased. It had been judged by eye against ordinary body text, which has a great deal of contrast to spare, so nothing revealed that it was consuming everything fainter. Easing it also helps ordinary text near the edges of the pane, not just this metric.

Scope and risk

Low, and limited to the transcript's appearance. No change to what the metric reports, when it appears, or how it is calculated.

One thing a reviewer should be aware of: the pill is deliberately not wrapped in the container class used by the existing status pills. That class is filtered out when a saved session is reopened, on the grounds that status pills describe the live state of a process that has since ended. A token count is the opposite — it is what that turn actually cost, and it belongs to the conversation's history. Reusing that class would have silently removed these from every restored session. There is a comment at the call site recording this, since the two are otherwise near-identical and the trap is easy to walk into again.

Verification

Builds clean, 0 warnings and 0 errors. Full Desktop suite passes, 423 of 423 — unchanged, as this touches presentation only.

Contrast was measured numerically before and after for each affected theme, including compositing the corner shading over both the text and its background, which is what established that a colour change alone was insufficient.

Not covered by tests: the transcript renders in a WebView and is not reachable from the test project. A reviewer should look at Cathode Ray and Pheteven Phosphor, the two worst cases, and confirm the metric is legible in the bottom-right corner — and ideally with a chat background image set, since that is the other case the pill is meant to survive.

The per-turn token count was --dim text, right-aligned. That put the
smallest and palest element in the app in the exact corner where every
themed overlay's vignette is darkest: 2.02:1 on Cathode Ray, 1.95:1 on
Pheteven Phosphor, against a 4.5 floor.

Raising the colour does not fix it. Full foreground still measured 3.79 and
2.77 on those two, because the vignette was strong enough to defeat any
palette value. The distinction matters for the contrast floor added earlier:
scanlines attenuate UNIFORMLY, so a raised floor answers them, but a vignette
attenuates by position, so the same colour passes mid-pane and fails in the
corner. There is no value to pick, and no palette-level rule that helps.

So the metric gets a surface. On its own pill it carries its own background
and border, reads as a deliberate element rather than trailing text, and
survives a busy chat wallpaper — the reasoning the plan-activity card already
uses. De-emphasis now comes from size and containment rather than faintness,
which is the durable form: small and bounded stays legible under anything
painted over it; faint stops being legible the moment something is.

Deliberately NOT wrapped in chip-row, despite holding an ordinary chip:
IsEphemeralStatus drops every chip-row from a restored session, on the
grounds that status pills describe a dead process's live state. A token count
is the opposite — it is what that turn cost, and it belongs to history.
Reusing that class would have silently deleted these from every reopened
session.

The vignettes were also simply too strong, tuned by eye against body text
which has enormous headroom, and were eating everything fainter — including
ordinary text at the pane edges. Eased across all four overlaid themes.
@DevMando
DevMando merged commit f82c492 into main Sep 10, 2026
1 check passed
@DevMando
DevMando deleted the fix/token-metric-visibility branch September 10, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant