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

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

Merged opened this

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

Merged

Pushed as a fast-forward, no force needed.

shipped production is serving it deploy 7cfd21c

opened this

Pushed as a fast-forward, no force needed.

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.

  • previewDataNote in src/web/ui.ts is the one function that writes the sentence — bare text, so each caller places it how 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 (exactly when ensureEnvData takes a copy, and already known — no filesystem stat on render). An empty-policy app has no production data to name, so this returns nothing for it.
  • Wired 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.
  • Production's own card never calls this — untouched, nothing to warn 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 previews list and the Preview card carry "its own copy of production's data, taken …", while production's own card does not.

This picks up where pull #236 was parked: that park was the sandbox's check failing before any change was made (#233/#239, now closed and merged to main). I merged origin/main into this branch (a normal merge, not a rebase, so the push stayed fast-forward) to pull in the check-command fix, reinstalled, and ran bun run check — the exact gate command — twice: once to confirm it's green after the merge (398 pass, 0 fail), matching what main itself now gets.

Left out, as before: the standalone /:owner/:name/app environments page (pages/apps.ts's appPage/envCard) — it already carries a general "Preview data: copy/empty" policy line, is shared verbatim between production's and previews' cards, and wasn't in the issue's named files or studio.test.ts's scope.

Closes #222

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs