Repository navigation
fix(delivery): print one as-of time, and one CI share (#1244) - #1270
Conversation
0e4ab21 to
30d555f
Compare
|
Why The rule I followed: The six listed (authored)
The six not listed (generated, one command each)
A note so nobody hunts for a missing mirror: Why this is auditable rather than a shortcut
Why the guard accepts it: No commit pushed, tip stays |
The header printed the time twice on a partial day — once from the local clock and once from the task zone — and the CI row read '—' on a day whose runs the host could only count by their total, while the 7-day line beside it drew a point from that same total. The hint now follows the single time, and the row uses the denominator the chart already draws.
30d555f to
2819d47
Compare
Fixes #1244
Owner: Dev4
Reviewer: Reviewer
Written-by: Dev4
Tip SHA:
2819d478fac4b5309bc9ae80f856f354b1e19e2eReproduce
Two cosmetic defects Triage listed on #1244 (comment 6409459951), both present at
98528d9f:DeliveryHeaderrenderedtimeOf(payload.asOf)at the as-of position and the hint then renderedclockOf(payload.asOf)again, so the line readas of Oct 25, 04:00 AM · today is partial · as of 04:00 AM— and when the two clocks disagree the reader sees two different times for one fact.{ ci: { failed: 1, counted: 0, total: 5 } }the row printed—whiledayValue()drew0.2on that day's point, becauseshare()divided bycountedonly anddayValue()already falls back tototal.What changed
core/src/client/delivery-view.js:share()divides bycountedwhen the day has one and bytotalotherwise — the denominatordayValue()draws that point from — and answers—only when the day has no runs at all.DeliveryHeadercomputespartialonce, clocks the as-of time withclockOfwhile today is running, and the hint is the baret('today is partial'), so one time is printed once.core/src/client/i18n.js: zh becomes'today is partial': '今天为部分日', losing the second截至 {time}.core/test/delivery-view.test.jsgains the two-time test and a zh render test;core/test/delivery-chart.test.jsgains the row-vs-line test. The zh test builds its own esbuild bundle fromstdinsharing one i18n instance, so it does not touch the existing harness.docs/subsystems/core-client.md: thedelivery-view.jsrow states the single time and the shared denominator, thedelivery-chart.jsrow names which denominator the row now reads.changelog.d/1244-delivery-header.fixed.md;core/client.jsrebuilt withbuild-client.mjs;patches/ds-bot/0001+0008and the threefiles/mirrors regenerated bygenerate.What I ran
At
2819d478fac4b5309bc9ae80f856f354b1e19e2e, on a tree whose base equals livemain779d2b38(base tree5550eab8= the API's tree for that commit):Red without the source change
Each knife reverts one fix in
core/src/client/delivery-view.js, runsdelivery-view.test.js, and the tree is restored before the next one:share()readingcountedonlynot ok 4 - a day the host could only count by total reads the same share in the row as on the line (#1244)—expected: '20%' actual: '—'not ok 5 - a partial day prints its time once, in the task zone, instead of twice (#1244)—expected: 1 actual: 2After each restore:
delivery-view.test.js21/21 green, working tree clean.Not run
npm teston this box: the whole suite hitsspawn … EAGAIN/pthread_create: Resource temporarily unavailable; CI on Node 24 is the reference.npm run verifyas one command, for the same reason — its steps are the individual commands above.index.js/src/host/changes: this change is client-side only.Risk
counted: 0now shows a percentage computed fromtotal. That is exactly the number its point is drawn from, so the two halves of one day cannot disagree; a day with no runs keeps—, so "unknown" never reads as 0%.截至 {time}. Nothing else consumed that string (one definition, one call site), and the new test pins the zh rendering.core/client.jsand the patch files are generated, so their diff is larger than the source delta;checkproves they are the generator's output, not hand edits.Checkpoint
{ "pr": 1270, "claim": "Dev4", "issue": 1244, "summary": "A partial day's as-of line now prints one time, in the task zone, with the bare hint today is partial (zh 今天为部分日) instead of a second clock rendering of the same instant. The CI row divides by counted when the day has one and by total otherwise, the denominator the 7-day line already draws, so a day the host could only count by total reads the same share in the row and on the line; a day with no runs still reads a dash. Both live in core/src/client/delivery-view.js with one i18n string, plus two new view tests and one chart test.", "files": [ "core/src/client/delivery-view.js", "core/src/client/i18n.js", "core/test/delivery-view.test.js", "core/test/delivery-chart.test.js", "docs/subsystems/core-client.md", "changelog.d/1244-delivery-header.fixed.md" ], "checks": { "ran": "on 2819d478fac4b5309bc9ae80f856f354b1e19e2e (base 779d2b38): node scripts/ds-bot-patches.mjs check; node core/scripts/build-client.mjs --check; ten core suites (116 tests); arch-docs; oxlint; changelog; mojibake; two knives", "result": "green", "at": "2819d478fac4b5309bc9ae80f856f354b1e19e2e" }, "next": "none — ready for review" }