Skip to content

Chart lines added and lines deleted the way input and output tokens are charted #10

Description

@Nitjsefnie

Description

The dashboard charts token throughput but not code churn. Input and output tokens each get the
per-bucket + cumulative treatment via TimeSeriesPanel (src/dashboard-charts.jsx:226) — bars for
the value in each time bin, a cumulative line on the right-hand axis, and the bin/cumulative pair
surfaced in the tooltip. Lines added and lines deleted have no equivalent, and no panel at all.

They also have no producer. Grepping the parser, backend and frontend for lines_added /
linesAdded / lines_deleted / additions / deletions / insertions returns nothing — so unlike
the token figures, this is not a display gap over existing data. The counts are not extracted, not
stored, and not served.

Expected Behavior

Lines added and lines deleted are charted the same way input and output tokens are: per-bucket bars
plus a cumulative total, over the selected range and bin size, honouring the project filter.

Environment / Context

Deliberately deferred — filed for later, not for immediate work.

Presentation is open. Two separate panels (mirroring the two token panels) is the obvious route,
but a single panel showing both series is acceptable if it can be done without looking cramped or
muddled — added and deleted on one chart risks an unreadable double-encoding, especially with the
cumulative axis already occupying the right gutter. Whoever picks this up should choose on how it
actually renders, not in the abstract, and fall back to two panels if one is ugly.

Suggested Fix

Unverified as to detail; the work spans the whole chain rather than just the view layer:

  1. Producer — extract per-edit line counts in the parser. The natural source is the tool-result
    payload for edit/write operations; whether it carries enough to count added vs deleted lines
    directly, or whether a diff has to be reconstructed, needs checking before committing to a shape.
  2. Storage and API — persist alongside the existing per-event fields and serve them from
    /api/dashboard in the same bucketed shape the token series use, so the panel needs no special
    casing.
  3. View — reuse TimeSeriesPanel rather than writing a new chart. It already takes
    {title, events, valueKey, color, isCurrency, range, binMs} and handles the per-bin/cumulative
    pairing, the right-hand axis and the tooltip. Two instances is a near-zero-cost implementation;
    a combined panel is the part that needs design judgement.

Worth deciding early whether a deletion counts as a negative value or a separate positive series —
that choice determines whether one combined chart is even coherent.

Discovered During

Requested by the repo owner, 2026-07-28.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions