Repository navigation
docs: correct the format.duration examples and list format.harnessIcon in the view helpers table - #274
docs: correct the format.duration examples and list format.harnessIcon in the view helpers table#274connorburgess wants to merge 3 commits into
Conversation
…n in the view helpers table
Symptom: docs/theme-authoring.md says format.duration(ms) gives "4 m 12 s",
but a view calling it for 252000 ms gets "4 m". The table also leaves out
format.harnessIcon(harness), which the host has handed to views since the
harness marks landed.
Cause: format.duration is dur() in web/src/lib/time.ts, whose grammar shows
seconds only in the first minute; the table kept an example from before
that grammar. harnessIcon was added to the contract (shared/theme-api.ts)
and wired in web/src/themes/host/api.ts without a row here.
Fix: give the duration row the examples dur() returns ("<0.1 s", "0.4 s",
"12 s", "4 m", "2 h 05 m", "3 d") and add a harnessIcon row worded from
the contract's comment and harnessIconSvg(). The format.ago examples
already hold.
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
|
The view format helper documentation correction still applies to SessionPipe GUI v0.8.18. Merged current Validation on this head, macOS / Node 22.23.2:
GitHub CI run 47453783730 for head The desktop shard 3 failure is d16a2c01, npx playwright test test/e2e/split.spec.ts --project=desktop --grep "covering the page locks" --repeat-each=6 --workers=2 reproduced four first-attempt failures; all four passed on retry, with two other repetitions passing initially. This establishes baseline flakiness, but does not turn the failed PR run green.
A maintainer needs to rerun the failed job (and aggregate gate), or resolve the baseline flake, before merging. The job-rerun API rejected this account with HTTP 403: “Must have admin rights to Repository.” Independently evaluated the documented duration examples against the current implementation; every value matches. Also checked the harness icon return shape, Claude Code name, currentColor SVG and unknown-harness null fallback. |
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
|
Merged current CI run 47497352567 for head The earlier run 47453783730 on Locally on |
Updated against v0.8.19 / main
e8bfe999on 2026-12-05. Current validation and refresh details.What
Docs only: two rows of the
format.*helpers table indocs/theme-authoring.mdnow match what the host hands a view.format.duration(ms)listed"4 m 12 s", which it never returns: seconds show only in the first minute. The row now gives the examplesdur()returns:"<0.1 s","0.4 s","12 s","4 m","2 h 05 m","3 d".format.harnessIcon(harness)had no row, though the contract has it (shared/theme-api.ts, optional) and the host wires it (web/src/themes/host/api.ts). The new row is worded from the contract's comment andharnessIconSvg():{ svg, name }, a 14 px mark drawn incurrentColor,nullfor a harness without one, called asformat.harnessIcon?.(harness)from TypeScript since it is optional in the type.The
format.agoexamples already hold, so that row is unchanged.Why
format.durationisdur()inweb/src/lib/time.ts, and its grammar shows seconds only under a minute; the table kept an example from before that grammar. A theme author sizing a column from the doc expects"4 m 12 s"and gets"4 m".harnessIconhas been on the API since the harness marks landed (in every tag from v0.1.0), but a theme author reading the table would not know it exists.Original proof (before the v0.8.18 refresh)
A node script that imports
web/src/lib/time.tsandweb/src/lib/harnessIcons.tsat6165bed(the functionsapi.tswires toformat.duration,format.agoandformat.harnessIcon):npm run typecheck && npm run lint && npm teston48bb870:Typecheck printed nothing, and the lint warnings were already there on
main. On an earlier run of the suite on this branch,server/control/remote.parity.test.tshit its 15 s timeout. Unmodifiedmain(6165bed) times out the same way when the whole suite runs (TestTimeoutError: Test timed out in 15000ms,remote.parity.test.ts:343). The test passes when run alone.Checklist
git commit -s): the DCO is the only paperwork.npm run typecheck && npm run lint && npm testpass;npm run test:e2efor a UI change. (No UI change.)// SPDX-License-Identifier: Apache-2.0. (None added.)--demo).shared/*names the wire-contract change in the description. (Noshared/*change.)CHANGELOG.mdif a person would notice. (Not added: a person running the GUI would not notice a docs fix.)