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

Signed out, the toolbar page of a public app offers "Report a problem, no account needed" beside Sign in #6294

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Signed out on a public app, the toolbar page now shows a "Report a problem, no account needed" button next to Sign in. The toolbar and report tests pass and design-lint is clean. `bun x tsc --noEmit` couldn't run here because the `bun` type definitions are missing, so the type check is unverified until the forge's check runs.

shipped production is serving it deploy 47e6991

opened this

Signed out on a public app, the toolbar page now shows a "Report a problem, no account needed" button next to Sign in. The toolbar and report tests pass and design-lint is clean. bun x tsc --noEmit couldn't run here because the bun type definitions are missing, so the type check is unverified until the forge's check runs.

  • Link: it is an ordinary btn link to /<owner>/<name>/report?from=<address>. The address goes through pageAddress (src/web/studio/toolbar.ts), which drops the query string and fragment. The link shows only when the repository is readable by a guest.
  • Report form: it already read from into its hidden page field. It now also runs that value through pageAddress and shows "About this page: <address>" above the form. An address that isn't http or https, such as javascript:, is dropped and no line is drawn. The change is in src/web/pages/reports.ts.
  • Private apps: a guest still gets 404 on a private app's toolbar page, and no report link appears.
  • Tests: both are in test/toolbar-signed-out.test.ts.

- Public app: the first fetches the toolbar page signed out, checks the link, checks that a ?t=secret query on the page address doesn't survive, then follows the link and finds the address on the form. It also checks that a javascript: address shows nothing. - Private app: the second checks the guest 404 and that no report link appears.

I did not change the logged-in toolbar, and I added no dependencies.

🤖 Generated with Claude Code

Closes #6287

commented

Signed out on a public app, the toolbar page now shows a "Report a problem, no account needed" button next to Sign in. The toolbar and report tests pass and design-lint is clean. bun x tsc --noEmit couldn't run here because the bun type definitions are missing, so the type check is unverified until the forge's check runs.

  • Link: it is an ordinary btn link to /<owner>/<name>/report?from=<address>. The address goes through pageAddress (src/web/studio/toolbar.ts), which drops the query string and fragment. The link shows only when the repository is readable by a guest.
  • Report form: it already read from into its hidden page field. It now also runs that value through pageAddress and shows "About this page: <address>" above the form. An address that isn't http or https, such as javascript:, is dropped and no line is drawn. The change is in src/web/pages/reports.ts.
  • Private apps: a guest still gets 404 on a private app's toolbar page, and no report link appears.
  • Tests: both are in test/toolbar-signed-out.test.ts.

- Public app: the first fetches the toolbar page signed out, checks the link, checks that a ?t=secret query on the page address doesn't survive, then follows the link and finds the address on the form. It also checks that a javascript: address shows nothing. - Private app: the second checks the guest 404 and that no report link appears.

I did not change the logged-in toolbar, and I added no dependencies.

🤖 Generated with Claude Code

Approved

Signed-out toolbar on a public app now offers an ordinary link button to the anonymous report, gated on canRead for a guest. The address is stripped of query and fragment and non-http schemes are dropped, with tests for the public case, the secret query, javascript: and the private 404. Nothing needs a mouse or JavaScript. Two things I would do next: (1) move pageAddress out of studio/toolbar.ts into a small module of its own (e.g. src/web/page_address.ts), since pages/reports.ts now imports from the studio toolbar just for it, and put the new import in the file's sorted order; (2) type owner in the test as a real user shape instead of never. I could not reach a matching public app on the preview to click through, so the verdict rests on the source and tests.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs