Skip to content

refactor: remove preview_url artifact kind, derive preview URLs#19

Open
drepkovsky wants to merge 2 commits intomainfrom
claude/quirky-einstein
Open

refactor: remove preview_url artifact kind, derive preview URLs#19
drepkovsky wants to merge 2 commits intomainfrom
claude/quirky-einstein

Conversation

@drepkovsky
Copy link
Copy Markdown
Member

Summary

  • Removed preview_url as an artifact kind — it was 100% derived data (/api/previews/{runId}/{entry}) that duplicated what preview_file artifacts already provide
  • Added ArtifactService.resolvePreviewUrl() helper that derives the preview URL from preview_file artifacts, used by all bridges and CLI
  • Worker collectPreviewFiles() now only collects browser-renderable files (HTML, CSS, JS, images, fonts, JSON, WASM) — no more "hluche" previews of raw .ts/.md source files
  • FE artifact list hides internal artifacts (preview_file, implementation_prompt) and shows a dedicated Preview button on run cards instead

What changed

Backend (orchestrator)

  • ArtifactKindSchema no longer includes preview_url
  • Run completion + ad-hoc artifact creation no longer auto-create preview_url artifacts
  • resolvePreviewUrl() on ArtifactService derives URL from preview_file presence
  • Notification, task-progress, and query-response bridges use the helper

Worker

  • collectPreviewFiles() filters by PREVIEWABLE_EXTENSIONS set instead of accepting all text files
  • Binary previewable files (PNG, JPEG, etc.) collected as base64

Frontend

  • preview_file and implementation_prompt filtered from artifact list (internal artifacts)
  • Run cards show "Preview" link when preview_file artifacts exist
  • Artifact count badges reflect only user-visible artifacts
  • Removed preview_url from FE types and locales

CLI

  • inbox command derives preview URLs from preview_file artifacts instead of looking up preview_url

Test plan

  • packages/spec — 85 pass, 0 fail
  • packages/worker preview tests — 14 pass, 0 fail
  • packages/orchestrator previews + artifacts — 31 pass, 0 fail
  • packages/orchestrator bridge-integration — 33 pass, 0 fail
  • packages/orchestrator step-io — 11 pass, 0 fail
  • Manual: verify preview serving at /api/previews/{runId}/ still works
  • Manual: verify chat UI shows preview link from run event metadata

🤖 Generated with Claude Code

…preview_file artifacts

preview_url artifacts were redundant derived data — the URL is just
`/api/previews/{runId}/{entry}` and can be computed from preview_file
artifacts. This cleanup:

- Removes preview_url from ArtifactKindSchema and all consumers
- Stops auto-creating preview_url artifacts in run completion and
  ad-hoc artifact creation endpoints
- Adds ArtifactService.resolvePreviewUrl() helper that derives the URL
  from preview_file artifacts
- Updates notification, task-progress, and query-response bridges to
  use the helper instead of artifact lookup
- Updates CLI inbox to derive preview URLs client-side
- Hides preview_file and implementation_prompt from FE artifact list
  (internal/infrastructure artifacts not useful to users)
- Adds dedicated Preview button on run cards in task detail
- Worker collectPreviewFiles() now only collects browser-renderable
  files (HTML, CSS, JS, images, fonts) instead of all changed text files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant