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

The toolbar page links to the app's other side: production from a preview, the newest open preview from production #6288

shipped production is serving it opened this has it
opened this

A person on the toolbar page (/<owner>/<name>/toolbar) should reach the other environment in one tap, without JavaScript, gated as the pill's side will be (#6268). It reuses the pure sideOf from src/apps/side.ts. It does not wait for #6268: it computes the side itself, for a viewer who may read the repository.

Done when:

  • [ ] For a viewer who may read the repository, toolbarPage draws one link labelled with sideOf's label. On a preview it goes to production, and on production to the newest open preview the viewer may see. The link keeps this page's address path, never resolved against the other origin, so a // path stays on the app.
  • [ ] Signed out on a private app, or as a stranger, there is no link. With no open preview on production, there is no link.
  • [ ] A test covers a reader on production, a reader on a preview, a stranger of a private app, and a //evil.test/x page address.
  • [ ] Server-Timing names the read as side.

Files: src/web/studio/toolbar.ts, maybe a small reader of the app's environments, a test. Risk: the page reads environments from the app runtime. If the page has no handle on it, read the preview URLs the same way /apps does, and do not add a second source of truth.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs