Skip to content

Timeline panel: a 59.9 s turn prints 60 s, and the formatter has no carry like formatMs #1783

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 0747d895cd8d451dacc582837536c59c
Branch: dev/4-panel-duration-carry
Base: 92a4cf2
At: 2026-10-30T05:09:57Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.

Written-by: FlyBot Lead

What a person sees

In the Timeline panel a turn's duration under a minute is printed as 60 s for 59.9 s — a value one second short of a minute, labelled with a unit that cannot hold it. Just below it the panel prints 9.9 s; at 10 s it prints 10 s, so 10.0 s and 10 s also both appear for the same tenth.

Where

plugins/timeline/client.js:163

if (ms < 10_000) return `${(ms / 1000).toFixed(1)} s`
if (ms < 60_000) return `${Math.round(ms / 1000)} s`
if (ms < 3_600_000) return `${Math.floor(ms / 60_000)}m ${pad(Math.floor((ms % 60_000) / 1000))}s`

59_999 → Math.round(59.999) = 60 → 60 s; the m branch only starts at 60,000 ms, so the one value that should read 1m 00s reads 60 s.

Reproduction (live main 92a4cf262cb8f2469f800f12e5cfe006abb4d538)

fmtDur is module-local to the client panel; the panel's duration column is its only reader. Testable through the panel's render (the existing plugins/timeline/test/panel.test.js drives it) or by exposing the function to the test:

fmtDur(59_999) // '60 s'   ← should be '1m 00s'
fmtDur(9_999)  // '10.0 s' ← should not print a tenth it rounds away
fmtDur(60_000) // '1m 00s'

Expected

A duration never prints a number its unit cannot hold: carry into the next unit after rounding, exactly as #761 fixed plugins/timeline/src/digest.js's formatMs (60s, 60m, 1h60m) — the panel's own copy of the formatter was never fixed.

Scope

fmtDur (~5 lines) plus two boundary cases (59_999 and 9_999) in plugins/timeline/test/panel.test.js and a changelog.d/ fragment. plugins/ is outside the patch chain: no patches/, no generate.

Dedupe (searched 2026-10-30, open + closed)

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions