Public: anyone can read this; the crew can change it.

The forge pill says where you are: app, production or preview of pull #n with its title, and a link home #1652

Closed opened this
Closed without merging

The expanded pill now names the app and environment and has a Home link. I ran tsc and test/apps-toolbar.test.ts (13 pass). A broader bun test test/apps run timed out in the sandbox, so I never saw its result.

Notes

stopped closed without shipping deploy d6eb41d

opened this

The expanded pill now names the app and environment and has a Home link. I ran tsc and test/apps-toolbar.test.ts (13 pass). A broader bun test test/apps run timed out in the sandbox, so I never saw its result. I did not look at the pill on a phone or desk, which the issue's Look item asks for.

What changed

  • Tag attributes: the proxy now adds data-app and data-env to the injected script tag. On a preview it also adds data-pull, data-title and data-href, a link to the pull on the forge. Every value is escaped for HTML attributes. This is in pillInfo in src/apps/proxy.ts.
  • Private titles: the pull title is sent only to a viewer who can read the repository, and for a sealed report only to someone who may see it. Anyone else gets the pull number and link, with no title.
  • Pill: expanding it shows the app name and either "production" or "preview of pull #n — title" as a link to the pull. A Home link goes to the forge's /, which is the feed. The script reads the attributes with textContent only, with no innerHTML. It uses the pull link only if it starts with the forge's own origin.
  • Tests: test/apps-toolbar.test.ts is already in GATE, so I added no new test file. It now covers the production labels and a preview whose title is <img onerror=…> with quotes, which comes out escaped in the tag. It also covers a pull with no title and checks that the script uses no innerHTML.
  • Changed test: the existing exact-tag assertion changed because the tag now carries data-app and data-env.

Left out

  • I used data attributes rather than a JSON endpoint, so there is no extra request.
  • The old "Built on forge" link text is gone, replaced by Home.

To try

  • Open any app page, press the ⚒ dot, and check the panel.
  • Open a <slug>--<n>.<domain> preview and check that the panel reads "preview of pull #n" with the title.

🤖 Generated with Claude Code

Closes #1502

2 earlier comments
commented

The check failed because test/crew-sandbox-real.test.ts came in from main after my branch point and was in neither GATE nor EXCLUDED. I merged main into the branch and added the file to EXCLUDED in scripts/gate.ts. It is listed as "not yet admitted" under issue 261, like its neighbours.

I haven't run the full check, as instructed. tsc --noEmit and test/check-list.test.ts both pass locally, and I pushed the fix.

The forge pill change itself is untouched.

commented

The check failed this time because test/crew-sandbox-real.test.ts was listed twice in EXCLUDED. main had added its own entry (issue 1238) after my last push, on top of the one I added earlier.

I merged main into the branch and deleted my entry, so main's is the only one left. tsc --noEmit and test/check-list.test.ts pass locally. I pushed the fix and haven't run the full check.

The forge pill change itself is untouched.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs