Public: anyone can read this; the crew can change it.
A test runs the toolbar pill's script and proves it draws one freshness line under "Preview of pull #N" for a merged, closed, deploying or behind preview, and nothing for an open, current one #9141
Check · Review · Land · Live done — Landed and live in production.
The tests prove the pill draws one freshness line for a merged, closed, deploying or behind preview, and none for an open, current one. The by-eye check is not done.
shipped production is serving it deploy 309b41e
The tests prove the pill draws one freshness line for a merged, closed, deploying or behind preview, and none for an open, current one. The by-eye check is not done.
Changes
- Words table:
src/apps/toolbar.tsnow hasFRESHNESS_WORDS, one exported table holding the four sentences. The script embeds it asWinside its closure, so there are no new globals. The drawing code readsW.merged,W.closed,W.deployingandW.behindinstead of literals. - Script change: its content hash changes because the script text changed.
test/apps-toolbar-asset.test.tsstays green. - New tests:
test/apps-pill-freshness.test.tsgains a group that runstoolbarJsagainst a small stand-indocument,windowandlocation, with no new dependency. It reads the panel's lines from the element carryingrole="region". - What they assert:
- Merged, closed, deploying and behind each give exactly one freshness line, right after "Preview of pull #7" and the title. - With no title, the line follows "Preview of pull #7" directly. - Merged and closed win over deploying and behind, and deploying wins over behind. - An open, current preview draws none, and neither does production, which shows only the app name and "Production". A viewer sent no state or flags also gets none.
Checks run
bun testontest/apps-pill-freshness.test.tsandtest/apps-toolbar-asset.test.ts: 15 pass.bun scripts/gate.tsandbun x tsc --noEmit: clean.
Not done
- By-eye check: I could not do it. A request for the #9139 preview's
/returned no pill tag (probably it needs a signed-in grant), and I cannot take screenshots here. Someone should open the pill on one open pull's preview and confirm it shows no freshness line when current. - Fields and proxy: I left them alone, as the issue asked.
🤖 Generated with Claude Code
The four sentences now live in one FRESHNESS_WORDS table that the script is built from. The new tests run the real script against a stand-in document and assert the panel lines. They cover merged, closed, deploying and behind (one line, right after the pull and its title), the no-title case, the precedence (merged and closed beat deploying and behind; deploying beats behind), and open/current and production (none). No new dependency, no dead code. Next, I would (1) make the stand-in fail loudly if the script touches an element method it does not model, so the test breaks on drawing changes and does not pass quietly; (2) put a screenshot or note of the pill on an open preview in the pull. A note on the pill: the HTML served at / on this preview carries no pill script tag when fetched with the bearer token, so the pill cannot be seen by curl.
Left #9140 open: 1 unticked item remain (Seen by eye: a screenshot or a note of the pill opened on one open pull's preview (any of the listed previews) shows the line or its absence as described.).
The tests prove the pill draws one freshness line for a merged, closed, deploying or behind preview, and none for an open, current one. The by-eye check is not done.
Changes
src/apps/toolbar.tsnow hasFRESHNESS_WORDS, one exported table holding the four sentences. The script embeds it asWinside its closure, so there are no new globals. The drawing code readsW.merged,W.closed,W.deployingandW.behindinstead of literals.test/apps-toolbar-asset.test.tsstays green.test/apps-pill-freshness.test.tsgains a group that runstoolbarJsagainst a small stand-indocument,windowandlocation, with no new dependency. It reads the panel's lines from the element carryingrole="region".- Merged, closed, deploying and behind each give exactly one freshness line, right after "Preview of pull #7" and the title. - With no title, the line follows "Preview of pull #7" directly. - Merged and closed win over deploying and behind, and deploying wins over behind. - An open, current preview draws none, and neither does production, which shows only the app name and "Production". A viewer sent no state or flags also gets none.
Checks run
bun testontest/apps-pill-freshness.test.tsandtest/apps-toolbar-asset.test.ts: 15 pass.bun scripts/gate.tsandbun x tsc --noEmit: clean.Not done
/returned no pill tag (probably it needs a signed-in grant), and I cannot take screenshots here. Someone should open the pill on one open pull's preview and confirm it shows no freshness line when current.🤖 Generated with Claude Code
Closes #9140