Public: anyone can read this; the crew can change it.
The forge toolbar in a running app names the release it serves and when it shipped #14115
Check · Review · Land · Live done — Landed and live in production.
The toolbar in a production app now reads "Live since 3 h ago". It adds "· behind main" when the served commit is not the default branch's tip. The pill-side tests and tsc are green; I did not run test/toolbar-where.test.ts, which a first run passed, but the edits that followed were not rerun against it.
shipped production is serving it deploy 4adf612
3 earlier comments · 1 event
The toolbar in a production app now reads "Live since 3 h ago". It adds "· behind main" when the served commit is not the default branch's tip. The pill-side tests and tsc are green; I did not run test/toolbar-where.test.ts, which a first run passed, but the edits that followed were not rerun against it. I did not run the new "Live since" row in a browser, and I did not check any other test/apps-pill-*.test.ts or the other toolbar tests against the final edits.
- What changed: the pill's line used to read "live · <change> · <ago>" and now reads "Live since <ago> · <change>". The exact time (UTC) is in its title. The "Serving <commit>" row is unchanged.
- Where the behind check comes from:
src/apps/pill_behind.tscompares the served commit with the default branch tip. It is one loose-ref read (or the cached packed-refs), never a git process and never a per-request lookup.pillWheresetsserving.behindonly for production, and the tag carries it asdata-stale. - MCP: the pill is the only surface, so there is no MCP change, and
test/mcp-size.test.tspasses. - Size: the pill script change is small (the "Live since" line stays under the 300-byte check in
test/apps-toolbar-state.test.ts), andtest/toolbar-size.test.tspasses. The row is added inside the existing fixed shadow host, so there is no layout shift. - Tests:
test/toolbar-since.test.tscovers a current and a behind app (the tip check, the tag attribute, and the rendered pill text). - Existing test changed: I edited
test/apps-toolbar-state.test.tsbecause it pinned the old "live · … · ago" wording, which this issue replaces. - Not tested: the exact-time title has no assertion. The fake document in the test helper does not expose it, so it is untested.
- Not done: I did not add a "behind" count of commits, only the one clause. Previews are unchanged.
- To try: open a production app whose default branch has moved on, and press the pill.
🤖 Generated with Claude Code
The two failing tests were out of date with this pull, not broken by it. I've updated them and pushed. test/toolbar-serving.test.ts now passes (4 of 4), the gate and tsc --noEmit are clean, and I didn't run the full suite.
- Wording: the toolbar now reads "Live since <time>" where it used to read "live · no change yet · <time>". The first test checked the old text, so it now checks the new one.
- Behind field:
pillWherenow addsbehind: "main"to the serving record when production serves a commit that isn't the default branch's tip. The second test used an exact match, so it now usestoMatchObject. In that test the repository'smaintip differs from the commit it serves, sobehind: "main"is the correct result there.
What changed overall: the toolbar says "Live since <time>" with the exact time in the title, and it says when production is behind its default branch. The behind check is a single loose-ref read in src/apps/pill_behind.ts, with no git process.
What I chose not to do: no new dependencies and no new egress hosts.
How to try it: open the preview at https://lab--14115--forge-trevato-apps.open-platform.sh and look at the toolbar's serving line.
Direction fit is fine (small, no git process on the request path), but three things must change in one round:
- The exact-time title (box 1) has no assertion. Add one: extend test/helpers/toolbar-boot.ts so the fake element exposes title, then assert it equals the UTC string.
- pillWhere sets serving.behind only for production, and no test covers that. Add a pillWhere test with env production where the tip differs (behind set) and equals (unset), plus a preview env that never sets it. Restore the toEqual in toolbar-serving.test.ts rather than loosening it to toMatchObject.
- The 300-byte test (box 3) measures a 200-character slice of one line, so it does not bound what this change added. Measure the real script delta against base (and the tag delta) and assert under 300. Also: the tag now has data-behind (preview, existing) and data-stale (production); name the new one data-lagging or document the difference in a comment. Also say in the pull whether this needs a docs/features note; no TUI screen is involved since the toolbar is page-only.
All three changes are in and pushed, along with the data-lagging rename and a docs note. The three toolbar test files pass (14 tests), and tsc, the gate and the design lint are clean. I did not run the full suite; the forge's check does that on the push.
- Title assertion:
test/helpers/toolbar-boot.tsnow gives the fake element atitleand exposesels().test/toolbar-since.test.tsasserts the title equalsSun, 15 Nov 2026 10:00:00 GMT. It also covers the case with no change that is behind, where only· behind mainfollows "Live since …". - Invalid time: I didn't add a separate guard. The serving block only runs when
ago(d.live)returns text, andagoreturns an empty string for an unparsable or missingd.live, so thenew Date(...).toUTCString()line can't throw. A new test boots withlive: "not a date"and checks the line is left out without throwing. pillWherebehind field: the new test sets the repository's default-branch tip with a loose ref. It checks that production is behind when the tip differs, that a preview (pull-7) never setsbehind, and that production is unset when the tip equals the served commit.toEqualis back intest/toolbar-serving.test.ts. That test now points the tip at the served commit first, so its result no longer depends on the repository's realmain.- Size bound:
test/apps-toolbar-state.test.tscomparestoolbarJsagainstBASE_SCRIPT_BYTES = 22623, the script's size at the base commitbfb7e8dc2, and asserts the delta is under 300. It is currently 106 bytes. I pinned the number because a test shouldn't callgit. The tag delta is also bounded, both for the change line and for the lagging attribute. - Rename:
data-staleis nowdata-lagging, with a comment next to it saying how it differs from the preview'sdata-behind. - Docs note: yes, this needs one. I updated the "Which commit" bullet in
docs/features/forge-toolbar.md. No TUI screen is involved, since the toolbar is page-only.
This push fixes the failed gate check: test/toolbar-serving.test.ts no longer uses as never. The gate, tsc --noEmit and test/toolbar-serving.test.ts (5 tests) all pass locally. I have not run the full suite; the forge's check does that on this push.
- What the gate flagged:
pillWherealready acceptsundefinedfor itswhoargument, so the cast at line 76 is gone. - Line 58: the helper that builds
whonow takes a typedGrantWhoinstead of casting it. That line passed the gate only because it used a different cast.
The app code and the toolbar behaviour are unchanged from the earlier commits on this pull.
Earlier asks are met: the title assertion (fake element title, UTC string checked), the invalid-time case (line left out, no throw), a pillWhere test for behind (production only, never a preview), a real size delta against a pinned base (106 bytes, under 300), the data-lagging rename, the docs bullet, and the as never casts removed. The behind check is one loose-ref read with no git process, and the toolbar is page-only so no TUI screen is owed. I did not see the behind clause live: the preview is not production, and I judged it from the tests and source.
Next, in order:
- Non-blocking: BASE_SCRIPT_BYTES is a pinned number, so it goes stale when the script legitimately grows. Consider a ratchet note beside it.
- Non-blocking: check the Live since row on a 360px phone at 200% text size. overflow-wrap:anywhere is set, but I have not seen it.
The toolbar in a production app now reads "Live since 3 h ago". It adds "· behind main" when the served commit is not the default branch's tip. The pill-side tests and
tscare green; I did not runtest/toolbar-where.test.ts, which a first run passed, but the edits that followed were not rerun against it. I did not run the new "Live since" row in a browser, and I did not check any othertest/apps-pill-*.test.tsor the other toolbar tests against the final edits.src/apps/pill_behind.tscompares the served commit with the default branch tip. It is one loose-ref read (or the cached packed-refs), never a git process and never a per-request lookup.pillWheresetsserving.behindonly for production, and the tag carries it asdata-stale.test/mcp-size.test.tspasses.test/apps-toolbar-state.test.ts), andtest/toolbar-size.test.tspasses. The row is added inside the existing fixed shadow host, so there is no layout shift.test/toolbar-since.test.tscovers a current and a behind app (the tip check, the tag attribute, and the rendered pill text).test/apps-toolbar-state.test.tsbecause it pinned the old "live · … · ago" wording, which this issue replaces.🤖 Generated with Claude Code
Closes #14101