|
| 1 | +# PLAN_PR_SAMPLES_PREVIEW_ASSETS_AND_THUMBNAILS |
| 2 | + |
| 3 | +## Objective |
| 4 | +Define a narrow, testable plan for preview assets and thumbnail support for samples so launcher/detail UI can show consistent visual previews without changing gameplay behavior. |
| 5 | + |
| 6 | +## Scope |
| 7 | +Docs-only planning. |
| 8 | +No implementation code changes. |
| 9 | +No gameplay changes. |
| 10 | +No engine-core changes. |
| 11 | +No canonical path normalization. |
| 12 | +No start_of_day directory changes. |
| 13 | + |
| 14 | +## Working Targets |
| 15 | +- Preview image ownership for canonical samples: `samples/phaseXX/XXYY/` |
| 16 | +- Metadata mapping for preview and thumbnail references |
| 17 | +- Consumption expectations for: |
| 18 | + - `samples/index.html` tiles |
| 19 | + - sample detail enhancement surface |
| 20 | + |
| 21 | +## Proposed Asset Contract |
| 22 | +1. Canonical sample path remains source of truth for runnable sample pages: |
| 23 | +- `samples/phaseXX/XXYY/index.html` |
| 24 | + |
| 25 | +2. Preview asset location per sample (planned): |
| 26 | +- `samples/phaseXX/XXYY/preview/` |
| 27 | +- expected files: |
| 28 | + - `thumb.png` (tile-sized image) |
| 29 | + - `preview.png` (detail-sized image) |
| 30 | + |
| 31 | +3. Metadata fields (planned extension of existing metadata layer): |
| 32 | +- `thumbnail` (string, optional): canonical relative path to thumbnail image |
| 33 | +- `preview` (string, optional): canonical relative path to preview image |
| 34 | + |
| 35 | +4. Fallback behavior: |
| 36 | +- if thumbnail/preview missing, UI renders deterministic placeholder and remains fully functional |
| 37 | + |
| 38 | +## Source-of-Truth Boundaries |
| 39 | +1. Canonical folder structure: |
| 40 | +- owns sample existence and entrypoints only |
| 41 | + |
| 42 | +2. Preview assets: |
| 43 | +- own image binary content only |
| 44 | +- must not introduce path aliases or alternate sample IDs |
| 45 | + |
| 46 | +3. Metadata: |
| 47 | +- owns which preview/thumbnail path a sample should use |
| 48 | +- must reference canonical sample-owned paths only |
| 49 | + |
| 50 | +4. UI rendering: |
| 51 | +- consumes metadata + assets |
| 52 | +- must not infer non-canonical sample paths |
| 53 | + |
| 54 | +## Validation + Fail-Fast Expectations |
| 55 | +Fail fast for future BUILD when: |
| 56 | +- duplicate sample IDs in metadata |
| 57 | +- metadata points to non-canonical sample IDs |
| 58 | +- malformed preview paths |
| 59 | +- preview/thumbnail points outside allowed sample-owned scope |
| 60 | +- duplicate or conflicting preview entries for same sample |
| 61 | +- ambiguous ownership between metadata and filesystem assets |
| 62 | + |
| 63 | +Validation expectations for future BUILD: |
| 64 | +- tiles render thumbnail if present |
| 65 | +- detail page renders preview if present |
| 66 | +- placeholder appears when assets are absent |
| 67 | +- representative links still resolve: |
| 68 | + - first sample in first populated phase |
| 69 | + - last sample in last populated phase |
| 70 | + - phase 13: `1316`, `1317`, `1318` |
| 71 | +- no console errors on tested pages |
| 72 | + |
| 73 | +## Future BUILD Shape (Narrow + Testable) |
| 74 | +1. Extend metadata schema minimally for preview/thumbnail. |
| 75 | +2. Validate path safety and ownership constraints. |
| 76 | +3. Wire index/detail rendering to read preview fields. |
| 77 | +4. Preserve deterministic fallback placeholders. |
| 78 | +5. Validate representative sample pages and links. |
| 79 | + |
| 80 | +## Out of Scope |
| 81 | +- gameplay logic updates |
| 82 | +- engine-core refactors |
| 83 | +- broad UI redesign |
| 84 | +- sample path renaming or relocation |
| 85 | +- automated image generation pipeline expansion |
| 86 | + |
| 87 | +## Acceptance Criteria (Planning PR) |
| 88 | +- preview/thumbnail contract defined |
| 89 | +- source-of-truth boundaries defined |
| 90 | +- fail-fast and validation expectations defined |
| 91 | +- future BUILD remains narrow and testable |
0 commit comments