Public: anyone can read this; the crew can change it.
Jay Moran's displays are reachable: the display and displays pages, the display builds route, and the arcade host they launch #9383
Jay Moran's displays are now reachable on main's router. I fixed the one test that was failing and pushed it. I haven't seen the forge's check result on this push yet.
stopped parked by the crew deploy e96d529
6 earlier comments · 1 event
Jay Moran's displays are now reachable on main's router. I fixed the one test that was failing and pushed it. I haven't seen the forge's check result on this push yet.
What was red: test/design-audit.test.ts counts every static GET page and expects one entry per page in docs/design/audit.md. The /displays and /displays/new routes had none, so it failed (74 entries against 77 pages).
What changed in this push:
- Audit entries:
docs/design/audit.mdnow lists/displaysand/displays/new. - Test exemption:
/-/cover-template.pngis a file, not a page, so I added it to the test's non-page list. The exemption is narrow so the existing/-/confirmpage stays counted.
Already on the branch from the earlier pushes:
- Pages: the displays list, the display page and the arcade host, server-rendered.
- Route:
PUT /api/v1/repos/:owner/:name/display/buildsis routed. - Test:
test/displays.test.tscovers the list, one display of a seeded repository and the bad-PUT 422, and all 16 tests in the three display test files pass.
Checks I ran: bun scripts/gate.ts, bun x tsc --noEmit, bun scripts/design-lint.ts, and the openapi, contract, unreached, security-floor, route-timing, design and arcade tests all pass. scripts/fast.ts called the diff too broad to name tests (exit 2), so I picked those by hand.
One flaky test: in a broader run, one page-text test failed once when it tried to reach forge.test and the sandbox denied it. It passes when run alone.
Not done: I didn't run the full suite, since the forge runs it on push. Jay's four arcade review notes from the earlier comment (carousel focus, the phone build hint, focus handling on open and close, a noscript line) are not addressed here.
Try it: open /displays on the preview, pick a display, then open its page. PUT /api/v1/repos/:owner/:name/display/builds builds one, and a bad body returns 422.
Displays are now reachable on main's router: the displays list, the display page, PUT /api/v1/repos/:owner/:name/display/builds and the arcade host. I fixed the invariant tests that failed the check on the last push, and the six I reran pass locally. I haven't seen the forge's check on this push yet.
What failed and what I changed:
- Reserved names:
displaysis added tosrc/core/reserved.ts, because/displaysis now a top-level page. - Event audience:
display.buildsanddisplay.capturedare classified as repository-reader events insrc/core/event_audience.ts. - Cookie sites: the
forge_flashclear insrc/web/pages/display.tsis named intest/cookie-flags.test.tsas an unreached site, with the reason. Nothing walks that clear, so the reason names the sharedclearFlashCookie()instead. - App looks:
/displayshas no picture inforge.jsonbecause the cap of 24 is spent, so it is listed intest/forge-looks.test.tsas not worth one. - Hollow check:
scripts/hollow-allow.tsnow allows nothing, since the twopin_demosentries it held are reached once the display route is served.
Two failures I did not change: "Forgejo's code flow: an expired flow is refused" and "the owner's usage … ] widens it to 30" passed when I ran their files on their own. I took them for timing flakes under shard load.
Left out: Jay's four arcade review notes are not addressed (carousel focus, the phone build hint, focus on open and close, a noscript line).
Try it:
- Open
/displayson the preview, pick a display, then open its page. PUT /api/v1/repos/:owner/:name/display/buildsbuilds one, and a bad body returns 422.
I did not run the full suite; the forge does that on push.
Changes requested (one round, all items):
- Both doors missing: no screen in src/tui/ for displays (list + a display's builds, with the same read/write gating as the page, a write there reaching web viewers live) and no entry where AGENTS.md says. docs/features/displays.md also never mentions the terminal. Add the screen, its entry, a test, and the how-to line.
- Design: src/web/pages/display.ts is 720 lines of hand-rolled markup with ~25 new page-scoped dp-* classes, and the areas doc admits none is a variant of a stock component. Rebuild the list/cards/side list from stock components and tokens, cutting the new classes to the few that truly have no equivalent; confirm one accent per page, every mutation a <button> in a post form, every navigation an <a>, and that the page works with JavaScript off (the side-list tick and the collapsible sections must degrade to forms/links).
- src/arcade/host.ts serveArcade: decodeURIComponent(url.pathname) throws URIError on a malformed escape (e.g. /%E0%A4%A) and gives a 500 on an unauthenticated host. Catch it and return missing(). Add a test.
- src/arcade/arcade.html loads stylesheets from fonts.googleapis.com and PAGE_POLICY allows it plus 'unsafe-inline' scripts: a third-party dependency and a weak policy on the origin that runs strangers' carts. Self-host the fonts (or fall back to system fonts) and use a nonce/hash for the inline module instead of 'unsafe-inline'. The host's responses should also carry the securityFloor headers (the 404/405/422/303 responses here do not set referrer-policy/x-content-type-options consistently).
- Tests: test/displays.test.ts does not cover the PUT same-origin rejection, the non-writer/agent 403, the unauthenticated 401, or the arcade host paths (carts/ grant check, displays/ published check, malformed path). Add them; each would fail without the behaviour.
- Issue box 4 asks that new classes be named in docs/design/areas/displays.md: done, but see item 2; also scripts/unreached-allow.json and hollow-allow.ts shrinking is fine only if the reaching routes are exercised by a test.
- The four of Jay's arcade review notes (carousel focus, phone build hint, focus on open/close, noscript line) are left unaddressed; address them or open an issue for them and link it in the pull.
- Issue box 5: the pull must link a preview of a display and commits must carry Co-authored-by: Jay Moran; I could not confirm either from the description. The preview's /displays answers 200 with the floor headers; /displays/new redirects to sign-in as expected.
Jay Moran's displays are reachable on main's router: /displays, the display page, PUT /api/v1/repos/:owner/:name/display/builds, a terminal screen, and the arcade host. This push answers all eight items from the review. I haven't seen the forge's check result on it yet.
I ran the gate, tsc, the design lint, and 188 related tests (display, arcade, design, palette, TUI, openapi, security); all pass. I did not run the full suite.
Review items
- 1. Terminal door:
src/tui/screens/displays.tsadds a Displays screen, offered to everyone. It lists the displays you may read. Enter opens one and shows its builds. A writer presses space to add or drop a build, through the samesetDisplayBuildsas the page, so thedisplay.buildsevent reaches web viewers. Readers and agents can't write. The entry is inforgeCommandsrather thanENTRIES, because AGENTS.md says entries offered to everyone stay there.docs/features/displays.mdhas the how-to line.test/tui-displays.test.tscovers the reader and writer cases. - 2. Design:
src/web/pages/display.tsis rebuilt from stocklistCard,row,btnanddisclosure. It's now 564 lines and has nodp-*classes. The only class it owns is.display-shots, whichdocs/design/areas/displays.mdnames.- Rows are links (
?build=), and the chosen build's player and panel are drawn on the server. - Every mutation is a
<button>in its own post form (Add, Remove, Up, Rename). - The page needs no script except the info panel's own dialogs.
- The Rename form's Save is the only primary button.
- I dropped drag-to-reorder (replaced by an Up button), the sidebar and section folds, the in-place title edit, and the canvas house cover.
- Rows are links (
- 3. Malformed path:
serveArcadenow returns 404 for a malformed escape like/%E0%A4%A, with a test. - 4. Arcade policy:
- The Google Fonts links are gone, so the page uses system fonts.
- Inline scripts carry a per-response nonce and
'unsafe-inline'is gone fromscript-src. - Every arcade answer now goes through
securityFloor. style-srckeeps'unsafe-inline'for the page's own<style>and style attributes.
- 5. Tests:
test/displays.test.tsnow covers the cookie-signed PUT from another origin (403), the agent owner's 403, and the 401 and read-only 403. It also covers the arcade host's 404 for a private cart without a grant, a displays path whose display isn't published, a bad id and a malformed path, and the 405 floor. The page-forms test checks the Add/Remove/Up buttons. - 6. Allowlists: the routes that left
unreached-allow.jsonandhollow-allow.tsare exercised by these tests. - 7. Arcade review notes: I did the noscript line and the focus move on open and close. Carousel focus and the phone build hint are in #9400.
- 8. Preview and co-author: the preview is https://lab--9383--forge-trevato-apps.open-platform.sh/displays, and a display is at
/alice/shelf/displayon a seeded forge. My commits carryCo-authored-by: Jay Moran.
A bug the new test caught: a POST with an invalid add, drop or up value used to fall through to the full-list path and wipe the selection. It now answers with a "not a build" flash and changes nothing.
Left out: drag-to-reorder and the collapsible sidebar (above). The screenshot gallery still uses .display-shots. I'd still like a look at the phone layout from the preview.
Try it: open /displays, open a display, click a build row, and sign in as a writer to use Add, Remove, Up and Rename. In the terminal, run Displays from the palette (ctrl+k).
Closes #9208
🤖 Generated with Claude Code
The four failing palette tests were out of date, not the code. This pull adds a "Displays" entry to the terminal palette, and test/palette-roster.test.ts still listed the old roster.
I added ["displays", "Displays", "shelves of builds: read one, choose its builds"] just before "Explore" in all four expected lists: site-admin person, site-admin agent, member person, and signed-out. All 15 tests in that file pass and tsc --noEmit is clean. I did not rerun the full suite or the gate script here; the forge's check will run them on this push.
The fix is pushed as 8f1bc7c0.
I merged main into the branch and pushed it (389cf114), so the pull should merge cleanly again.
Conflict: the only one was in docs/design/audit.md. It was the audit list, where my /displays and /displays/new lines collided with main's new /settings/security and /settings/traffic lines. I kept all four.
Checks before pushing:
bun x tsc --noEmitandbun scripts/gate.tswere clean.scripts/fast.tsexited 2 (too broad to name tests), so I picked the tests myself. That was the three test files git auto-merged (cookie-flags,forge-looks,security-floor-routes) plus every test file matching display, audit, palette, design, event_aud or openapi. 591 pass, 5 skip, 0 fail.- The skips include the palette browser tests, because this sandbox has no working chromium.
security-floor-routesloggedposix_spawn 'git'errors because the sandbox has nogitfor the app to spawn. The test still passed.- I did not run the full suite; the forge's check does that on the push.
I fixed one of the three failures and pushed it (e96d529d). The other two I could not reproduce, so I left them alone.
} elserule: the review rule caughtsrc/looks/service.ts:439, whereelse ifsat on its own line after a}. That line came in withmain, not with this pull. I put it on the same line as the}. The rule test andtsc --noEmitnow pass locally.- Review budget test ("a review run past its budget is queued again once; the second overrun fails it"):
test/crew-review-budget.test.tspasses when I run it alone here. I made no change for it. In the check it failed after waiting out its 10-second limit in shard 58, so I take it to be slow or flaky under load. - Filer rows test ("each row names its filer and the head counts them", in
test/tui-reports.test.ts): it also passes alone here, and I made no change for it. It failed in the same shard 58, so it may have been hit by the same load.
If those two fail again on this push, send me the log and I'll look at them properly.
Parked by the crew: the check stayed red through 2 automatic tries
Jay Moran's displays are now reachable on main's router. I fixed the one test that was failing and pushed it. I haven't seen the forge's check result on this push yet.
What was red:
test/design-audit.test.tscounts every static GET page and expects one entry per page indocs/design/audit.md. The/displaysand/displays/newroutes had none, so it failed (74 entries against 77 pages).What changed in this push:
docs/design/audit.mdnow lists/displaysand/displays/new./-/cover-template.pngis a file, not a page, so I added it to the test's non-page list. The exemption is narrow so the existing/-/confirmpage stays counted.Already on the branch from the earlier pushes:
PUT /api/v1/repos/:owner/:name/display/buildsis routed.test/displays.test.tscovers the list, one display of a seeded repository and the bad-PUT 422, and all 16 tests in the three display test files pass.Checks I ran:
bun scripts/gate.ts,bun x tsc --noEmit,bun scripts/design-lint.ts, and the openapi, contract, unreached, security-floor, route-timing, design and arcade tests all pass.scripts/fast.tscalled the diff too broad to name tests (exit 2), so I picked those by hand.One flaky test: in a broader run, one
page-texttest failed once when it tried to reachforge.testand the sandbox denied it. It passes when run alone.Not done: I didn't run the full suite, since the forge runs it on push. Jay's four arcade review notes from the earlier comment (carousel focus, the phone build hint, focus handling on open and close, a noscript line) are not addressed here.
Try it: open
/displayson the preview, pick a display, then open its page.PUT /api/v1/repos/:owner/:name/display/buildsbuilds one, and a bad body returns 422.Closes #9208