Commit 4af65b6
Add optional image field to PuzzleConfig for share/preview images
Per new PR review feedback, adding a placeholder capability for a
per-puzzle preview/share image, to eventually populate og:image/
twitter:image. Confirmed by investigation (per the review request) that
DCR has no site-wide default/fallback share image anywhere for pages
without one - frontend's MetaData.opengraphProperties/SimplePage only add
og:image via explicit per-page overrides, never a default. So an unset
image is expected to simply omit og:image/twitter:image, matching
existing sitewide behaviour, rather than needing a placeholder asset.
- src/model/puzzles/puzzleConfigs.ts: added an optional image?: string
field to PuzzleConfig, documented as intentionally unset on every
current registry entry - none of the 6 V0 games have a real, licensed
preview image yet, and this commit deliberately does NOT invent
placeholder image URLs for any of them. isValidPuzzleConfig updated to
allow image being absent, but reject it if present-and-empty or
whitespace-only (same validation style already used for description).
- src/model/puzzles/puzzleConfigs.test.ts: added tests confirming every
current entry has no image set, that validatePuzzleConfigs does not
throw when a valid non-empty image is present, and that it rejects an
empty-string or whitespace-only image.
tsc --noEmit clean, eslint clean, 17/17 tests passing in this suite (4
new tests added).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 067215b commit 4af65b6
2 files changed
Lines changed: 54 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
95 | 133 | | |
96 | 134 | | |
97 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
| |||
138 | 150 | | |
139 | 151 | | |
140 | 152 | | |
| 153 | + | |
141 | 154 | | |
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
145 | 158 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
149 | 162 | | |
150 | 163 | | |
151 | 164 | | |
| |||
0 commit comments