1. Reset Preview state when switching jobs (1ccb6d72)
Key the Preview reset layout's child subtree by params.jobId. Switching jobs now remounts the stateful job layout, initializing that job's status, links, errors, phases and logs and closing the previous progress stream. The same job keeps its state and observer across Overview/Page/Icon/Share tabs.
The key uses the unique job ID directly, as agreed in code review; no serialized file/job pair or additional lifecycle framework.
2. Copy attachments into Preview job outputs (9e5e21bc)
Include the existing attachment transform in Preview's transform list. The workflow already supplies every transform with the isolated job output directory, so the existing copying code now writes attachments alongside that job's images and Open Graph PNG:
Remove fabricated archive-path attachment passthroughs from Preview assembly. Download helpers now receive actual worker-generated attachment records; old retained jobs without attachment outputs no longer offer fabricated download links. Image fallbacks and output-only Overview inspection are preserved.
No new dependencies, services, archive writes, CDN uploads, serving-path exceptions, or publish behavior changes. No README changes. Each fix has its own patch changeset.
Verification
Full web suite: 72 files / 1,276 tests passed.
Full worker suite: 46 files / 279 tests passed, with coverage; Preview transform step has 100% coverage.
Web production build and worker production TypeScript build: passed.
Svelte check: 0 errors / 0 warnings.
Changed-file web lint/formatting, worker lint, and git diff --check: passed.
A temporary headless-browser fixture using the actual client layout components reproduced stale links/logs/stream before the fix and verified keyed-subtree replacement, same-job tab preservation, stream cleanup, and terminal-state behavior. No real Preview workflows were started. The committed lifecycle regression is explicitly a structural/SSR guard, not a browser navigation test.
Attachment workflow tests use the production transform list, real attachment copying, temporary files, and SQLite. They verify generated records, job-local bytes, phase reporting, and absence of reported outputs when copying fails. Assembly/helper tests verify actual download URLs and removal of fabricated references.
Retention and existing limitations
Attachments share the existing job directory cleanup: recursive deletion during the normal purge (startup and daily, 7-day retention). The UI's existing 2-day expiry is unchanged. Retained previews need regeneration to acquire attachments.
The existing attachment output naming can collide for files with identical basenames; this already affects publishing and is not changed here.
Existing local demo archive edits and generated preview artifacts are excluded from both commits.
## Summary
Closes #116. Closes #117.
Two focused commits on one branch:
### 1. Reset Preview state when switching jobs (`1ccb6d72`)
Key the Preview reset layout's child subtree by `params.jobId`. Switching jobs now remounts the stateful job layout, initializing that job's status, links, errors, phases and logs and closing the previous progress stream. The same job keeps its state and observer across Overview/Page/Icon/Share tabs.
The key uses the unique job ID directly, as agreed in code review; no serialized file/job pair or additional lifecycle framework.
### 2. Copy attachments into Preview job outputs (`9e5e21bc`)
Include the existing `attachment` transform in Preview's transform list. The workflow already supplies every transform with the isolated job output directory, so the existing copying code now writes attachments alongside that job's images and Open Graph PNG:
```text
<dirname(config.paths.assets)>/previews/<jobId>/<type>/<pieceKey>/<filename>
```
Remove fabricated archive-path attachment passthroughs from Preview assembly. Download helpers now receive actual worker-generated attachment records; old retained jobs without attachment outputs no longer offer fabricated download links. Image fallbacks and output-only Overview inspection are preserved.
No new dependencies, services, archive writes, CDN uploads, serving-path exceptions, or publish behavior changes. No README changes. Each fix has its own patch changeset.
## Verification
- Full web suite: **72 files / 1,276 tests passed**.
- Full worker suite: **46 files / 279 tests passed**, with coverage; Preview transform step has 100% coverage.
- Web production build and worker production TypeScript build: passed.
- Svelte check: **0 errors / 0 warnings**.
- Changed-file web lint/formatting, worker lint, and `git diff --check`: passed.
- A temporary headless-browser fixture using the actual client layout components reproduced stale links/logs/stream before the fix and verified keyed-subtree replacement, same-job tab preservation, stream cleanup, and terminal-state behavior. No real Preview workflows were started. The committed lifecycle regression is explicitly a structural/SSR guard, not a browser navigation test.
- Attachment workflow tests use the production transform list, real attachment copying, temporary files, and SQLite. They verify generated records, job-local bytes, phase reporting, and absence of reported outputs when copying fails. Assembly/helper tests verify actual download URLs and removal of fabricated references.
## Retention and existing limitations
Attachments share the existing job directory cleanup: recursive deletion during the normal purge (startup and daily, 7-day retention). The UI's existing 2-day expiry is unchanged. Retained previews need regeneration to acquire attachments.
The existing attachment output naming can collide for files with identical basenames; this already affects publishing and is not changed here.
Existing local demo archive edits and generated preview artifacts are excluded from both commits.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Closes #116. Closes #117.
Two focused commits on one branch:
1. Reset Preview state when switching jobs (
1ccb6d72)Key the Preview reset layout's child subtree by
params.jobId. Switching jobs now remounts the stateful job layout, initializing that job's status, links, errors, phases and logs and closing the previous progress stream. The same job keeps its state and observer across Overview/Page/Icon/Share tabs.The key uses the unique job ID directly, as agreed in code review; no serialized file/job pair or additional lifecycle framework.
2. Copy attachments into Preview job outputs (
9e5e21bc)Include the existing
attachmenttransform in Preview's transform list. The workflow already supplies every transform with the isolated job output directory, so the existing copying code now writes attachments alongside that job's images and Open Graph PNG:Remove fabricated archive-path attachment passthroughs from Preview assembly. Download helpers now receive actual worker-generated attachment records; old retained jobs without attachment outputs no longer offer fabricated download links. Image fallbacks and output-only Overview inspection are preserved.
No new dependencies, services, archive writes, CDN uploads, serving-path exceptions, or publish behavior changes. No README changes. Each fix has its own patch changeset.
Verification
git diff --check: passed.Retention and existing limitations
Attachments share the existing job directory cleanup: recursive deletion during the normal purge (startup and daily, 7-day retention). The UI's existing 2-day expiry is unchanged. Retained previews need regeneration to acquire attachments.
The existing attachment output naming can collide for files with identical basenames; this already affects publishing and is not changed here.
Existing local demo archive edits and generated preview artifacts are excluded from both commits.