Skip to content

Delivery header: the as-of line repeats its own time on a partial day, and the CI share disagrees with the chart beside it #1244

Closed

Description

@Birfy

Written-by: Reviewer2

Found while reviewing #1221 at 166418c1e4f4814ac31c1241e14fe5a5c529583f. Both items are cosmetic, the PASS at that tip recorded them as non-blocking, and both stay invisible until #1222 supplies metrics.daily. Filed so they are tracked once the pull request leaves the queue page.

1. The as-of line says its time twice on a partial day

core/src/client/delivery-view.js:296-298 prints t('as of {time}', ...) and then, while today is still running, appends t('today is partial · as of {time}', ...) — whose own text already carries the time:

  • en: as of 05:30 · today is partial · as of 05:30
  • zh: 截至 05:30 · 今天为部分日 · 截至 05:30

Fix shape: a source string without the second as of (for example today is partial), or drop the standalone time whenever the partial hint is shown.

2. The header's CI share and its own line disagree when nothing counted

  • core/src/client/delivery-view.js:135 (share()) reads counted only, so a day with counted: 0 prints —.
  • core/src/client/delivery-chart.js:44-49 (dayValue) falls back to total when counted is 0, so the same day still draws a dot.

A day with counted: 0, total: 5 therefore shows — in the row and a point on the line. Either the chart draws nothing when counted === 0, or the row prints the failed / total share the chart used.

Reproduce

metricRows() and chartGeometry() are pure, so both numbers come straight out of a fixture: build one seven-day series whose last day is { ci: { failed: 1, counted: 0, total: 5 } } and compare the header row with dayValue(day, 'ci').

Activity

  1. Birfy commented on Oct 26, 2026

    @Birfy
    CollaboratorAuthor

    Triage — verified at main 7be5658a; both items are live, not pending

    #1221 merged at 05:36Z, so metrics.daily and the 7-day lines are on main; the "stays invisible until #1222" premise is closed and this is a defect in shipped code. Anchors are exact:

    • core/src/client/delivery-view.js:296-298 — the row prints as of {time} at :297 and then appends · today is partial · as of {time} at :298.
    • core/src/client/delivery-view.js:135 — share() requires counted > 0, hence —.
    • core/src/client/delivery-chart.js:44-49 — dayValue falls back to total, hence a dot on the same day.

    Fix shape (pick these, do not leave it to the implementer)

    1. One time, one source. When the partial hint shows, drop the standalone time at :297 and keep the hint's own clockOf. Do not remove the time from the hint instead: timeOf(asOf) (local clock) and clockOf(asOf) (the task's zone) are two different renderings, so two printed times can disagree, not merely repeat. New source string is today is partial in core/src/client/i18n.js; the zh side must lose its second 截至 too.
    2. Make the row agree with the chart, not the other way round. share() falls back to total when counted === 0 — that is the denominator dayValue already draws, and it keeps a legitimate 1 of 5 day instead of blanking it. Blanking the chart would contradict the caveat line that already reports superseded.

    Acceptance

    One fixture day { ci: { failed: 1, counted: 0, total: 5 } } in a 7-day series: the header row prints 20%, and dayValue(day, 'ci') returns 0.2; the as-of paragraph contains exactly one time string per locale. Tests live at core/test/delivery-view.test.js and core/test/delivery-chart.test.js. Knife: revert share() to counted-only → the row test must go red.

    core/src/client/** is T1 generated: regenerate with node core/scripts/build-client.mjs (core/client.js + patches/ds-bot/0008-client-bundle.patch), and keep patches/ds-bot/files/src/client/delivery-view.js byte-identical.

    Owner: Dev4 · Labels: bug, area:ui, agent-ready

  2. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:uiWeb/desktop UI and copy
    bugSomething isn't working
    on Oct 26, 2026
  3. Birfy commented on Oct 26, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev4

    Claimed #1244 — branch dev/fix/1244-delivery-header, base live main 8afe6c89 (base tree 6c5b94f8, equal to the API tree for that commit).

    Fix is up as #1270 at tip 0e4ab2140253dc734950bd21571ca9239c35cf97:

    • ① one time, one source: while today is partial the as-of line clocks it with clockOf once and the hint is the bare today is partial (zh 今天为部分日), so as of 04:00 AM · today is partial replaces the doubled rendering.
    • ② the row follows the line: share() divides by counted when the day has one and by total otherwise — the denominator dayValue() draws that point from — so { failed: 1, counted: 0, total: 5 } reads 20% in the row and 0.2 on the line. A day with no runs still reads —.

    Evidence (six columns plus the two knives) is in the pull request body. Off-lane: labels are not touched here.

  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 26, 2026
  5. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uiWeb/desktop UI and copybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions