Skip to content

dash: the first savings bar renders 158% in a 100%-wide track — a ratio presented as a share #158

Description

@amiddavid

The first figure on the dashboard overview — the top bar under "Savings percentage — four
denominators, four questions"
— renders 158.17% in a track that is 100% wide by
construction, so the bar is pinned full while the number beside it says otherwise.

main        pct=115.42  available=True
PR #138     pct=158.17  available=True     409k ÷ 259k tokens

Cause

renderDenominators (dash/ui/app.js:489) passes max: 100 and value: d.percent, so a
percent above 100 clips:

value: d.available ? d.percent : 0,
max: 100,
display: d.available ? pct(d.percent, 2) : 'n/a',

The arithmetic is intended, and documented at docs/dashboard.md:80: the numerator is gross
savings while attempted_tokens is re-counted every turn, so the quotient is a ratio and can
exceed 1. Only the presentation is wrong — a figure over 100% under a heading "Savings
percentage", rendered as a share of a full track, reads as a bug to anyone who has not read
that paragraph, and it is the first thing on the page.

Why now

It gets worse as the product gets better. PR #138 teaches collapse to cut single-line and
huge-line payloads it used to decline, which pushes this figure from 115% to 158% on the same
traffic. Measured by a dashboard agent driving the live UI (headless Chromium, real proxy, real
traffic) against both builds. It is pre-existing, and #138 does not touch dash/ — but #138 is
what moves it past the point where a reader can charitably ignore it.

Fix options

  1. Render a ratio when it is one1.58× with the track at min(1, percent/100), keeping
    % for the denominators that genuinely are shares. Preserves the bar as a visual and stops
    it contradicting its own label. Recommended.
  2. Drop the track for this row and show the bare figure with its divisor
    (409k ÷ 259k tokens, already in desc). Simplest, loses the at-a-glance comparison
    across the four denominators.
  3. Clamp the track only (max: Math.max(100, percent)). One line, but it rescales the
    other three bars against a moving axis, which makes them incomparable between page loads.

Do not touch the arithmetic — the gross-over-attempted definition is deliberate and
documented; this is a rendering issue only.

Raised in review of #138 and deliberately left out of that PR: it is a change to the headline
savings display, affects all four denominator rows, and belongs with its own screenshot
verification rather than bolted to a components/offload fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions