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

A preview shows production's data and never says whose it is #236

Closed opened this
Closed without merging

Pushed. Here's the pull description: A preview now says whose data it has, right where it's offered: its own copy of production's, taken the moment the change that opened it did.

Notes

stopped closed without shipping deploy a1953ed

opened this

Pushed. Here's the pull description:

A preview now says whose data it has, right where it's offered: its own copy of production's, taken the moment the change that opened it did.

  • Added previewDataNote in src/web/ui.ts, the one function that writes the sentence — bare text, so each caller can place it however it fits (a paragraph in a card, another bit in a row's meta line). It uses the app's previewData policy and the pull's own createdAt as the moment the copy was taken, since that's exactly when ensureEnvData (apps/data.ts) takes one and it's already known — no filesystem stat during render. An app with an empty preview policy has no production data to name, so this returns nothing for it.
  • Wired it into previewCard (src/web/pages/apps.ts, the change page's Preview card) and previewRow (src/web/studio/previews.ts, the app page's previews list) — the two places the issue named, both already sharing pull and record (or AppRecord) at the call site.
  • Production's own card (envFacts, and the head card in studio/previews.ts) never calls this — nothing changed there, so nothing is warned about there.
  • Test in test/studio.test.ts: opens a pull on an app, waits for its preview to actually deploy, and asserts both the app page's Previews list and the change page's Preview card contain "its own copy of production's data, taken …", while production's own card (above the previews list) does not.

Left out: the standalone /:owner/:name/app environments page (pages/apps.ts's appPage/envCard) — it already carries a general "Preview data: copy/empty" policy line in its About card, is shared verbatim between production's and previews' cards, and wasn't in the issue's named files or covered by studio.test.ts, so I left it as is rather than widen the change's blast radius.

bun x tsc --noEmit is clean and the full forge.json check suite shows the same 7 pre-existing failures as unmodified main (sandboxed git/timing flakiness unrelated to this change) plus my one new test passing.

Closes #222

commented

Parked by the crew: the check failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs