From 48bb870911f816c946a654059ccb10a01d0c26b1 Mon Sep 17 00:00:00 2001 From: Connor Burgess Date: Fri, 4 Dec 2026 09:03:56 +0700 Subject: [PATCH] docs: correct the format.duration examples and list format.harnessIcon 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 --- docs/theme-authoring.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/theme-authoring.md b/docs/theme-authoring.md index f6b21b3b..fd95181e 100644 --- a/docs/theme-authoring.md +++ b/docs/theme-authoring.md @@ -98,10 +98,11 @@ Scrolling inside it is yours to do. Return the function that unmounts (it may be | `react` | `{ React, ReactDOM, createRoot }`: the host's React 19 (18 up to 0.8.5; `React.version` says which), for a theme that wants it without bundling its own. See [what React 19 no longer has](#what-react-19-no-longer-has). | | `shortcuts` | The host's keymap: `register(actions)` adds your keys while you are mounted (listed in the `?` help and on `/shortcuts`, rebindable, dispatched by the host), `active()` is every binding in force. See [Keyboard](#keyboard). | | `format.ago(iso)` | `"12 s ago"`, `"3 m ago"`, `"yesterday"`. | -| `format.duration(ms)` | `"0.4 s"`, `"4 m 12 s"`, `"2 h 05 m"`. | +| `format.duration(ms)` | `"<0.1 s"`, `"0.4 s"`, `"12 s"`, `"4 m"`, `"2 h 05 m"`, `"3 d"`: seconds show only in the first minute. | | `format.title(session)` | The title, else the cwd's basename, else the id's head. | | `format.repoBranch(session)` | `"org/repo @ main"`. | | `format.monogram(harness)` | `"Cl"` for claude-code, `"Cx"` for codex, … | +| `format.harnessIcon(harness)` | `{ svg, name }`: the harness's monochrome mark as inline SVG (14 px, drawn in `currentColor`) with its human name, `"Claude Code"`; `null` for a harness without one (draw the monogram then). Optional in the type, so from TypeScript call it as `format.harnessIcon?.(harness)`. | A `ThemeSnapshot`: