Skip to content

Commit 4de3f96

Browse files
author
DavidQ
committed
Add sample-local README contract and prevent silent fallback for fullscreen preview capture - PR_26126_028-sample-local-readme-and-fullscreen-capture-fix
1 parent f0077b5 commit 4de3f96

262 files changed

Lines changed: 33283 additions & 360 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/dev/codex_commands.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
# Codex Commands - PR_26126_026-locate-missing-samples
1+
# Codex Commands - PR_26126_028-sample-local-readme-and-fullscreen-capture-fix
22

33
```bash
4-
codex run "Create PR_26126_026-locate-missing-samples. Do not modify code. Perform a repo search to determine where sample IDs 0125, 0126, and 0127 are defined or referenced. Search for these IDs across samples, metadata, tool hints, and any index/registry files. Report exact file paths where they exist, or explicitly confirm they do not exist as folders under samples/phase-* directories. If they are referenced but missing physically, identify the source (metadata, index, or generator logic) that is producing them. Output findings only in docs/dev/reports/missing_samples_0125_0126_0127.txt. Produce review artifacts."
4+
codex run "Create PR_26126_028-sample-local-readme-and-fullscreen-capture-fix. Fix Preview Generator V2 documentation and capture behavior. Add a README.md template under existing sample folders using the pattern samples/phase-xx/XXXX/README.md. The README must explain where the sample implementation actually lives, how the sample folder/index.html launches or bypasses into that code, and how Preview Generator V2 should discover/launch the sample without assuming numeric folders. Do not add a root samples README. Do not modify sample JSON. Also fix Full Screen (1600x900 HTML Page) capture so it does not silently fall back to non-fullscreen capture when html-to-image/html2canvas fails on unsupported CSS color functions such as color(...). For fullscreen mode, capture must either use the intended 1600x900 viewport/full-page path or fail clearly with an actionable error; do not mark OK when fallback was used for fullscreen. Preserve Canvas Only behavior. Produce review artifacts."
55
```
66

77
## Validation Commands
88

99
```bash
10-
Get-ChildItem -Path samples -Directory -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.Name -in @('0125','0126','0127') } | Select-Object -ExpandProperty FullName
11-
rg -n --hidden --no-ignore --glob '!node_modules/**' --glob '!.git/**' --glob '!tmp/**' --glob '!**/*.svg' --glob '!**/*.png' --glob '!**/*.jpg' --glob '!**/*.jpeg' --glob '!**/*.gif' --glob '!**/*.zip' "\b(0125|0126|0127)\b" samples docs tools src scripts tests games package.json *.json *.md
12-
Select-String -Path tools/preview-generator-v2/index.html -Pattern 'resolveSamplePhase|phaseDir.entries|hasIndexHtml|sampleEntries.push|sampleEntries.sort|No sample index.html' -Context 2,3
13-
Select-String -Path @('scripts/generate-sample-manifest.mjs','scripts/generate-samples-index.mjs','scripts/generate-runtime-sample-previews.mjs') -Pattern 'readdir|phase-|index.html|samplesDir|sampleId|id' -Context 2,3
14-
Select-String -Path samples/metadata/metadataReference.js,samples/metadata/samples.index.metadata.json -Pattern '0125|0126|0127|0124|0101|phase-01' -Context 1,2
15-
rg -n "0225|0226|0227" samples/metadata/samples.index.metadata.json samples/index.html samples/index.render.js --glob '!**/*.svg'
16-
rg -n -i "executeSample|execute sample|sample-card|samples-phase-list|samples-pinned-list|buildSampleRows|createSampleCard" samples/index.html samples/index.render.js samples/metadata/samples.index.metadata.json
17-
git diff --check -- docs/dev/reports/missing_samples_0125_0126_0127.txt docs/dev/codex_commands.md docs/dev/commit_comment.txt
18-
git diff --cached --name-only -- samples games start_of_day tools src scripts tests
10+
$sampleDirs = Get-ChildItem samples -Directory -Filter 'phase-*' | Sort-Object Name | ForEach-Object { Get-ChildItem $_.FullName -Directory | Where-Object { $_.Name -match '^\d{4}$' } | Sort-Object FullName }
11+
$missingReadmes = $sampleDirs | Where-Object { !(Test-Path (Join-Path $_.FullName 'README.md')) }
12+
if ($missingReadmes) { $missingReadmes.FullName; throw "Missing sample README files." }
13+
if (Test-Path samples/README.md) { throw "Unexpected root samples/README.md" }
14+
$sampleReadmes = $sampleDirs | ForEach-Object { Join-Path $_.FullName 'README.md' }
15+
rg -n "SAMPLE_LOCAL_CONTRACT_README|Preview Generator V2 discovers samples|SKIP|FAIL|games/<gamename>|index.html is the only discovery" $sampleReadmes
16+
rg -n "Full Screen capture failed|html2canvas may not support CSS color functions|extractBestToolFallbackSvg|using fallback" tools/preview-generator-v2/index.html
17+
git diff --check
18+
git diff --cached --name-only -- '*.json' start_of_day tools/shared tools/schemas
19+
npm run test:workspace-v2
20+
npm test
1921
npm run codex:review-artifacts
2022
```
2123
22-
## Notes
24+
## Playwright
2325
24-
No Playwright impact. This PR is search/report only and does not modify runtime code, samples, schemas, or tests.
26+
No Playwright test was added. This PR changes documentation and Preview Generator V2 fullscreen capture error handling only. `npm run test:workspace-v2` was attempted but is not defined in the current `package.json`.
27+
28+
## Test Notes
29+
30+
`npm test` was attempted as the available default test gate and failed in the existing shared extraction guard baseline before this PR's changed Preview Generator V2 code or README files were involved. The reported violations are outside this PR scope.
31+
32+
## Manual Test
33+
34+
Use Preview Generator V2 with Canvas Only to confirm existing canvas capture still works. Use Full Screen (1600x900 HTML Page) on a target with unsupported CSS color functions and confirm it logs a clear `FAIL` instead of silently falling back to a non-fullscreen capture.

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Locate missing sample IDs 0125-0127 - PR_26126_026-locate-missing-samples
1+
Document sample-local contracts and harden fullscreen preview capture - PR_26126_028-sample-local-readme-and-fullscreen-capture-fix
Lines changed: 281 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,282 @@
1-
# PR_26126_026-locate-missing-samples
1+
# git status --short
2+
M docs/dev/codex_commands.md
3+
M docs/dev/commit_comment.txt
4+
A samples/phase-01/0101/README.md
5+
A samples/phase-01/0102/README.md
6+
A samples/phase-01/0103/README.md
7+
A samples/phase-01/0104/README.md
8+
A samples/phase-01/0105/README.md
9+
A samples/phase-01/0106/README.md
10+
A samples/phase-01/0107/README.md
11+
A samples/phase-01/0108/README.md
12+
M samples/phase-01/0109/README.md
13+
M samples/phase-01/0110/README.md
14+
M samples/phase-01/0111/README.md
15+
M samples/phase-01/0112/README.md
16+
M samples/phase-01/0113/README.md
17+
M samples/phase-01/0114/README.md
18+
M samples/phase-01/0115/README.md
19+
M samples/phase-01/0116/README.md
20+
M samples/phase-01/0117/README.md
21+
M samples/phase-01/0118/README.md
22+
M samples/phase-01/0119/README.md
23+
M samples/phase-01/0120/README.md
24+
M samples/phase-01/0121/README.md
25+
M samples/phase-01/0122/README.md
26+
M samples/phase-01/0123/README.md
27+
M samples/phase-01/0124/README.md
28+
M samples/phase-02/0201/README.md
29+
M samples/phase-02/0202/README.md
30+
M samples/phase-02/0203/README.md
31+
M samples/phase-02/0204/README.md
32+
M samples/phase-02/0205/README.md
33+
M samples/phase-02/0206/README.md
34+
M samples/phase-02/0207/README.md
35+
M samples/phase-02/0208/README.md
36+
M samples/phase-02/0209/README.md
37+
M samples/phase-02/0210/README.md
38+
M samples/phase-02/0211/README.md
39+
M samples/phase-02/0212/README.md
40+
M samples/phase-02/0213/README.md
41+
M samples/phase-02/0214/README.md
42+
M samples/phase-02/0215/README.md
43+
M samples/phase-02/0216/README.md
44+
M samples/phase-02/0217/README.md
45+
M samples/phase-02/0218/README.md
46+
M samples/phase-02/0219/README.md
47+
M samples/phase-02/0220/README.md
48+
M samples/phase-02/0221/README.md
49+
M samples/phase-02/0222/README.md
50+
M samples/phase-02/0223/README.md
51+
M samples/phase-02/0224/README.md
52+
A samples/phase-02/0225/README.md
53+
M samples/phase-02/0226/README.md
54+
M samples/phase-02/0227/README.md
55+
M samples/phase-03/0301/README.md
56+
M samples/phase-03/0302/README.md
57+
M samples/phase-03/0303/README.md
58+
M samples/phase-03/0304/README.md
59+
M samples/phase-03/0305/README.md
60+
M samples/phase-03/0306/README.md
61+
M samples/phase-03/0307/README.md
62+
M samples/phase-03/0308/README.md
63+
M samples/phase-03/0309/README.md
64+
M samples/phase-03/0310/README.md
65+
M samples/phase-03/0311/README.md
66+
M samples/phase-03/0312/README.md
67+
M samples/phase-03/0313/README.md
68+
M samples/phase-03/0314/README.md
69+
M samples/phase-03/0315/README.md
70+
M samples/phase-03/0316/README.md
71+
M samples/phase-03/0317/README.md
72+
M samples/phase-03/0318/README.md
73+
M samples/phase-03/0319/README.md
74+
M samples/phase-03/0320/README.md
75+
M samples/phase-03/0321/README.md
76+
M samples/phase-03/0322/README.md
77+
M samples/phase-03/0323/README.md
78+
M samples/phase-03/0324/README.md
79+
A samples/phase-03/0325/README.md
80+
A samples/phase-03/0326/README.md
81+
A samples/phase-03/0327/README.md
82+
M samples/phase-04/0401/README.md
83+
M samples/phase-04/0402/README.md
84+
M samples/phase-04/0403/README.md
85+
M samples/phase-04/0404/README.md
86+
M samples/phase-04/0405/README.md
87+
M samples/phase-04/0406/README.md
88+
M samples/phase-04/0407/README.md
89+
M samples/phase-04/0408/README.md
90+
M samples/phase-04/0409/README.md
91+
M samples/phase-04/0410/README.md
92+
M samples/phase-04/0411/README.md
93+
M samples/phase-04/0412/README.md
94+
A samples/phase-04/0413/README.md
95+
A samples/phase-05/0501/README.md
96+
A samples/phase-05/0502/README.md
97+
A samples/phase-05/0503/README.md
98+
A samples/phase-05/0504/README.md
99+
A samples/phase-05/0505/README.md
100+
A samples/phase-05/0506/README.md
101+
A samples/phase-05/0507/README.md
102+
A samples/phase-05/0508/README.md
103+
A samples/phase-05/0509/README.md
104+
A samples/phase-05/0510/README.md
105+
A samples/phase-05/0511/README.md
106+
A samples/phase-05/0512/README.md
107+
A samples/phase-06/0601/README.md
108+
A samples/phase-06/0602/README.md
109+
A samples/phase-06/0603/README.md
110+
A samples/phase-06/0604/README.md
111+
A samples/phase-06/0605/README.md
112+
A samples/phase-06/0606/README.md
113+
A samples/phase-06/0607/README.md
114+
A samples/phase-06/0608/README.md
115+
A samples/phase-06/0609/README.md
116+
A samples/phase-06/0610/README.md
117+
A samples/phase-06/0611/README.md
118+
A samples/phase-06/0612/README.md
119+
A samples/phase-06/0613/README.md
120+
A samples/phase-06/0614/README.md
121+
A samples/phase-07/0701/README.md
122+
A samples/phase-07/0702/README.md
123+
A samples/phase-07/0703/README.md
124+
A samples/phase-07/0704/README.md
125+
A samples/phase-07/0705/README.md
126+
A samples/phase-07/0706/README.md
127+
A samples/phase-07/0707/README.md
128+
A samples/phase-07/0708/README.md
129+
A samples/phase-07/0709/README.md
130+
A samples/phase-07/0710/README.md
131+
A samples/phase-07/0711/README.md
132+
A samples/phase-07/0712/README.md
133+
A samples/phase-07/0713/README.md
134+
A samples/phase-08/0801/README.md
135+
A samples/phase-08/0802/README.md
136+
A samples/phase-08/0803/README.md
137+
A samples/phase-08/0804/README.md
138+
A samples/phase-08/0805/README.md
139+
A samples/phase-08/0806/README.md
140+
A samples/phase-08/0807/README.md
141+
A samples/phase-08/0808/README.md
142+
A samples/phase-08/0809/README.md
143+
A samples/phase-08/0810/README.md
144+
A samples/phase-09/0901/README.md
145+
A samples/phase-09/0902/README.md
146+
A samples/phase-09/0903/README.md
147+
A samples/phase-09/0904/README.md
148+
A samples/phase-09/0905/README.md
149+
A samples/phase-09/0906/README.md
150+
A samples/phase-10/1001/README.md
151+
A samples/phase-10/1002/README.md
152+
A samples/phase-10/1003/README.md
153+
A samples/phase-11/1101/README.md
154+
A samples/phase-11/1102/README.md
155+
A samples/phase-11/1103/README.md
156+
A samples/phase-11/1104/README.md
157+
A samples/phase-11/1105/README.md
158+
A samples/phase-11/1106/README.md
159+
M samples/phase-12/1201/README.md
160+
M samples/phase-12/1202/README.md
161+
M samples/phase-12/1203/README.md
162+
M samples/phase-12/1204/README.md
163+
M samples/phase-12/1205/README.md
164+
M samples/phase-12/1206/README.md
165+
M samples/phase-12/1207/README.md
166+
M samples/phase-12/1208/README.md
167+
A samples/phase-12/1209/README.md
168+
A samples/phase-12/1210/README.md
169+
A samples/phase-12/1211/README.md
170+
A samples/phase-12/1212/README.md
171+
M samples/phase-12/1212/assets/images/preview.svg
172+
A samples/phase-12/1213/README.md
173+
M samples/phase-12/1213/assets/images/preview.svg
174+
A samples/phase-12/1214/README.md
175+
M samples/phase-12/1214/assets/images/preview.svg
176+
A samples/phase-12/1215/README.md
177+
M samples/phase-12/1215/assets/images/preview.svg
178+
A samples/phase-12/1216/README.md
179+
M samples/phase-12/1216/assets/images/preview.svg
180+
A samples/phase-12/1217/README.md
181+
M samples/phase-12/1217/assets/images/preview.svg
182+
A samples/phase-12/1218/README.md
183+
M samples/phase-12/1218/assets/images/preview.svg
184+
A samples/phase-12/1219/README.md
185+
M samples/phase-12/1219/assets/images/preview.svg
186+
A samples/phase-12/1220/README.md
187+
M samples/phase-12/1220/assets/images/preview.svg
188+
A samples/phase-13/1301/README.md
189+
A samples/phase-13/1302/README.md
190+
A samples/phase-13/1303/README.md
191+
A samples/phase-13/1304/README.md
192+
A samples/phase-13/1305/README.md
193+
A samples/phase-13/1306/README.md
194+
A samples/phase-13/1307/README.md
195+
A samples/phase-13/1308/README.md
196+
A samples/phase-13/1309/README.md
197+
A samples/phase-13/1310/README.md
198+
A samples/phase-13/1311/README.md
199+
A samples/phase-13/1312/README.md
200+
A samples/phase-13/1313/README.md
201+
A samples/phase-13/1314/README.md
202+
A samples/phase-13/1315/README.md
203+
A samples/phase-13/1316/README.md
204+
A samples/phase-13/1317/README.md
205+
A samples/phase-13/1318/README.md
206+
A samples/phase-13/1319/README.md
207+
A samples/phase-13/1320/README.md
208+
A samples/phase-14/1401/README.md
209+
A samples/phase-14/1402/README.md
210+
A samples/phase-14/1403/README.md
211+
A samples/phase-14/1404/README.md
212+
A samples/phase-14/1405/README.md
213+
A samples/phase-14/1406/README.md
214+
A samples/phase-14/1407/README.md
215+
A samples/phase-14/1408/README.md
216+
A samples/phase-14/1409/README.md
217+
A samples/phase-14/1410/README.md
218+
A samples/phase-14/1411/README.md
219+
A samples/phase-14/1412/README.md
220+
A samples/phase-14/1413/README.md
221+
A samples/phase-14/1414/README.md
222+
A samples/phase-14/1415/README.md
223+
A samples/phase-14/1416/README.md
224+
A samples/phase-14/1417/README.md
225+
A samples/phase-14/1418/README.md
226+
A samples/phase-15/1501/README.md
227+
A samples/phase-15/1502/README.md
228+
A samples/phase-15/1503/README.md
229+
A samples/phase-15/1504/README.md
230+
A samples/phase-15/1505/README.md
231+
A samples/phase-15/1506/README.md
232+
A samples/phase-16/1601/README.md
233+
A samples/phase-16/1602/README.md
234+
A samples/phase-16/1603/README.md
235+
A samples/phase-16/1604/README.md
236+
A samples/phase-16/1605/README.md
237+
A samples/phase-16/1606/README.md
238+
A samples/phase-16/1607/README.md
239+
A samples/phase-16/1608/README.md
240+
A samples/phase-16/1609/README.md
241+
A samples/phase-16/1610/README.md
242+
A samples/phase-16/1611/README.md
243+
A samples/phase-16/1612/README.md
244+
A samples/phase-16/1613/README.md
245+
A samples/phase-16/1614/README.md
246+
A samples/phase-16/1615/README.md
247+
A samples/phase-16/1616/README.md
248+
A samples/phase-16/1617/README.md
249+
A samples/phase-16/1618/README.md
250+
A samples/phase-16/1619/README.md
251+
A samples/phase-16/1620/README.md
252+
A samples/phase-16/1621/README.md
253+
A samples/phase-16/1622/README.md
254+
A samples/phase-17/1701/README.md
255+
A samples/phase-17/1702/README.md
256+
A samples/phase-17/1703/README.md
257+
A samples/phase-17/1704/README.md
258+
A samples/phase-17/1705/README.md
259+
A samples/phase-17/1706/README.md
260+
A samples/phase-17/1707/README.md
261+
A samples/phase-17/1708/README.md
262+
A samples/phase-17/1709/README.md
263+
A samples/phase-17/1710/README.md
264+
A samples/phase-17/1711/README.md
265+
A samples/phase-17/1712/README.md
266+
A samples/phase-17/1713/README.md
267+
A samples/phase-18/1801/README.md
268+
A samples/phase-19/1901/README.md
269+
A samples/phase-19/1902/README.md
270+
M tools/preview-generator-v2/index.html
2271

3-
Staged PR files:
4-
- docs/dev/codex_commands.md
5-
- docs/dev/commit_comment.txt
6-
- docs/dev/reports/codex_changed_files.txt
7-
- docs/dev/reports/codex_review.diff
8-
- docs/dev/reports/missing_samples_0125_0126_0127.txt
9-
10-
Unstaged files excluded from this docs-only PR:
11-
- samples/phase-12/1212/assets/images/preview.svg
12-
- samples/phase-12/1213/assets/images/preview.svg
13-
- samples/phase-12/1214/assets/images/preview.svg
14-
- samples/phase-12/1215/assets/images/preview.svg
15-
- samples/phase-12/1216/assets/images/preview.svg
16-
- samples/phase-12/1217/assets/images/preview.svg
17-
- samples/phase-12/1218/assets/images/preview.svg
18-
- samples/phase-12/1219/assets/images/preview.svg
19-
- samples/phase-12/1220/assets/images/preview.svg
272+
# git diff --stat
273+
samples/phase-12/1212/assets/images/preview.svg | 17 ++---------
274+
samples/phase-12/1213/assets/images/preview.svg | 17 ++---------
275+
samples/phase-12/1214/assets/images/preview.svg | 17 ++---------
276+
samples/phase-12/1215/assets/images/preview.svg | 40 ++++++++++++++++---------
277+
samples/phase-12/1216/assets/images/preview.svg | 40 ++++++++++++++++---------
278+
samples/phase-12/1217/assets/images/preview.svg | 40 ++++++++++++++++---------
279+
samples/phase-12/1218/assets/images/preview.svg | 17 ++---------
280+
samples/phase-12/1219/assets/images/preview.svg | 17 ++---------
281+
samples/phase-12/1220/assets/images/preview.svg | 17 ++---------
282+
9 files changed, 96 insertions(+), 126 deletions(-)

0 commit comments

Comments
 (0)