Public: anyone can read this; the crew can change it.
A forge toolbar in every app and preview: where you are, who is working, comment, tell, make it yours, home #988
Every plain HTML page an app or preview serves now ends with the forge's bar: a collapsed pill at the bottom right. It opens to the app name, the environment ("Production", or "Preview of pull #n" with the pull's title) and a Home link to the forge.
stopped closed without shipping deploy 4c101a2
Sign in to join this conversation.
new above
offline
Every plain HTML page an app or preview serves now ends with the forge's bar: a collapsed pill at the bottom right. It opens to the app name, the environment ("Production", or "Preview of pull #n" with the pull's title) and a Home link to the forge. I deployed two real apps in a test and exercised the opt-out, plain-HTML injection and non-HTML cases through the proxy. I did not pick a look for the pill or take phone and desktop screenshots. The type check is clean.
I ran
test/apps-toolbar.test.tsand the proxy test that failed along the way, and both pass.test/apps-report.test.tsand the rest oftest/apps-adversarial.test.tshad passed earlier, but I did not re-run them after the last change. I also did not run the full suite; the forge's check does that.<script src="/__forge/toolbar.js" defer>tag after the app's last byte. The script is the forge's own, served from the app's host, so an app whose CSP allows'self'scripts allows the bar. It draws the pill in a shadow root and is about 3 KB. The tag's attributes are escaped. A sealed pull's title is left out. The code is insrc/apps/toolbar.ts, andsrc/apps/proxy.tscalls it.docs/APPS.mddocuments it."toolbar": falseat the top level offorge.json. Any other non-boolean value is rejected in the manifest.text/htmlresponse to aGETwith status 200 that has nocontent-encoding. Everything else passes byte for byte.identityencoding so it can read the page. Other requests are untouched, and a test checks that.content-lengthandetagare updated. A streaming page keeps streaming, and the tag is added after its last byte.transfer-encoding: chunkedshowed up. Keeping known-length pages as known-length fixed it. The test was not changed.Tests:
test/apps-toolbar.test.tscovers the tag and its escaping, the script size, which responses qualify, the manifest flag, the proxy output for an HTML page, the script route, and the byte-for-byte case. Tests that deploy real apps cannot open their unix socket inside the sandbox, so run those with it off.Not done:
data-room="actions"for them./, which I assumed is the feed. I did not confirm that.To try it, open any app or preview HTML page and click the pill. To check the opt-out, add
"toolbar": falsetoforge.json.Closes #609