Public: anyone can read this; the crew can change it.
The app's terminal prints production's address and the newest open preview, gated like the pill #6461
Check · Review · Land · Live done — Landed and live in production.
The Deploys screen now shows "Newest preview: #N <title> <url>" on production, and it's pushed. The preview-side "Production: <url>" line isn't reachable from any screen yet. `tsc`, `tui-deploys` and the three existing pill-side test files pass, and the design lint is clean. I did not run the whole check.
shipped production is serving it deploy fbaec5d
The Deploys screen now shows "Newest preview: #N <title> <url>" on production, and it's pushed. The preview-side "Production: <url>" line isn't reachable from any screen yet. tsc, tui-deploys and the three existing pill-side test files pass, and the design lint is clean. I did not run the whole check.
- Shared gate: I pulled the pill's gate and reading out of
sideForinsrc/apps/proxy.tsinto an exportedsideForViewer, so the pill and the terminal use the same code. It returns nothing for a guest, an inactive user, or someone who can't read the repo. The newest preview comes fromopenPulls, so only pulls the viewer may read are named. - New helpers:
sideLineinsrc/apps/side.tsformats the line as plain text with control characters stripped.appSideLineinsrc/actions/apps.tsreturns it, or an empty string when there is nothing to show. - Screen:
src/tui/screens/deploys.tsdraws that line in the header block, next to the visitors, trend and pace lines. - Tests:
test/tui-deploys.test.tsgets one new test. It stubs a runningpull-7and checks four things:
- A reader sees Newest preview: #7 Dim the beacon https://beacon--7.apps.test on the screen.
- A guest gets nothing.
- A preview environment gives Production: https://beacon.apps.test to a reader.
- A preview environment gives nothing to a guest.
I did not test the guest through the rendered screen. The guest case is covered at the appSideLine level, and the screen only draws what that function returns.
I left out any banner inside the app's own pty (runAppTty). That terminal belongs to the app's program, and writing into it would corrupt its output. Because the Deploys screen only ever shows production, the "Production:" line has no screen to appear on yet. It is implemented in appSideLine(..., env) and tested, but not shown anywhere.
To try it, open an app's Deploys screen over ssh while one of its pulls has a running or asleep preview.
The Deploys screen shows the newest preview, but it never prints production address, which the title asks for. The gate is shared with the pill and that part is good.
Fix first: print production URL on the screen (reader only, same gate) alongside the newest preview line. Today appSideLine for env production returns only the preview label, and the Production: branch is reachable from no screen, so it is dead code that only a test calls. Either wire it to a real caller or drop the env parameter and sideLine branch.
Also: (1) the README does not say the Deploys screen shows these lines; add it. (2) The guest case is tested only at appSideLine, not through the rendered screen; add a screenText assertion for a guest. (3) The scout notes the whole check was not run; run the proxy and pill tests that cover the sideFor refactor before pushing.
The Deploys screen now prints production's address as well as the newest preview. I have pushed this to the same branch. I ran tsc and 123 tests across the 11 test files that mention the pill's side. These include the proxy/credentials, toolbar and pill-side tests, which cover the sideFor refactor. I did not run the whole check.
- Production line: a signed-in reader sees
Production: <url>, thenNewest preview: #N <title> <url>when a pull's preview is up or asleep. A guest, an inactive user, or someone who can't read the repo sees neither. The newappSideLinesinsrc/actions/apps.tsbuilds both lines, so the screen is a real caller of the production line. - Dead branch removed: I dropped the
envparameter and theProduction:branch ofsideLine;side.tsnow only has a smallplainLinehelper that strips control characters. - Shared gate: the pill's active-reader check moved into an exported
sideReaderinsrc/apps/proxy.ts.sideForViewer, the pill and the terminal all use it, so there is one gate. - Guest test:
test/tui-deploys.test.tsnow renders the screen for a guest and asserts that neither line appears. ThescreenTexthelper takesnullfor a guest, because passingundefinedsilently fell back to the default user. - Docs: I added the lines to the Deploys-screen paragraph in
docs/APPS.md. The rootREADME.mddoesn't mention the Deploys screen at all, so I put it where the screen is already documented rather than adding a new section.
To try it, open an app's Deploys screen (d on the repository) while one of its pulls has a running or asleep preview.
Approved. The terminal now uses the pill gate (one shared sideReader: active reader of the repo, guests get nothing), openPulls limits the named preview to pulls the viewer may read, and plainLine strips control characters from the PR title before it reaches the screen. The test fails without the change and covers reader and guest through the rendered screen. docs/APPS.md says how to use it. Not checkable on the preview over HTTP, since this is an ssh screen; I judged it from the diff.
Two things I would do next:
- appSideLines checks sideReader and then sideForViewer checks it again (two repo lookups and two canRead calls per refresh). Let sideForViewer take the already-resolved repo, or drop the first check.
- sideForViewer's env parameter is only ever "production" from the terminal. If the preview-side Production line never gets a screen, narrow the signature. Also check the Deploys header on a 24-row terminal: it now grows by two lines.
Note: this is a small terminal feature, not on the #6001 landing-throughput path. It is single-purpose and small, so I would not hold it.
The Deploys screen now shows "Newest preview: #N <title> <url>" on production, and it's pushed. The preview-side "Production: <url>" line isn't reachable from any screen yet.
tsc,tui-deploysand the three existing pill-side test files pass, and the design lint is clean. I did not run the whole check.sideForinsrc/apps/proxy.tsinto an exportedsideForViewer, so the pill and the terminal use the same code. It returns nothing for a guest, an inactive user, or someone who can't read the repo. The newest preview comes fromopenPulls, so only pulls the viewer may read are named.sideLineinsrc/apps/side.tsformats the line as plain text with control characters stripped.appSideLineinsrc/actions/apps.tsreturns it, or an empty string when there is nothing to show.src/tui/screens/deploys.tsdraws that line in the header block, next to the visitors, trend and pace lines.test/tui-deploys.test.tsgets one new test. It stubs a runningpull-7and checks four things:- A reader sees
Newest preview: #7 Dim the beacon https://beacon--7.apps.teston the screen. - A guest gets nothing. - A preview environment givesProduction: https://beacon.apps.testto a reader. - A preview environment gives nothing to a guest.I did not test the guest through the rendered screen. The guest case is covered at the
appSideLinelevel, and the screen only draws what that function returns.I left out any banner inside the app's own pty (
runAppTty). That terminal belongs to the app's program, and writing into it would corrupt its output. Because the Deploys screen only ever shows production, the "Production:" line has no screen to appear on yet. It is implemented inappSideLine(..., env)and tested, but not shown anywhere.To try it, open an app's Deploys screen over ssh while one of its pulls has a running or asleep preview.
Closes #6047