Skip to content

Commit 439f748

Browse files
author
DavidQ
committed
Audit Preview Generator V2 shared dependencies, common style candidates, and Playwright coverage - PR_26126_036-preview-generator-v2-shared-dependency-and-style-audit
1 parent f1c5c5e commit 439f748

8 files changed

Lines changed: 595 additions & 4324 deletions

docs/dev/codex_commands.md

Lines changed: 17 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,42 @@
1-
# Codex Commands - PR_26126_035-preview-generator-v2-file-split-and-control-classes
1+
# Codex Commands - PR_26126_036-preview-generator-v2-shared-dependency-and-style-audit
22

33
```bash
4-
codex run "Create PR_26126_035-preview-generator-v2-file-split-and-control-classes. Fix Preview Generator V2 structure only. Preserve current working behavior exactly. Remove all inline style blocks and inline script blocks from tools/preview-generator-v2/index.html. Move CSS into external stylesheet files. Move JavaScript into external module files. Use one class per JavaScript file. Give each UI control/section its own class. Keep a small app/bootstrap entry file only for wiring classes together. Preserve existing IDs and DOM behavior unless a rename is required for correctness. Do not rewrite generation logic. Do not add schema. Do not modify samples. Do not modify start_of_day folders. Produce review artifacts and class ownership notes."
4+
codex run "Create PR_26126_036-preview-generator-v2-shared-dependency-and-style-audit. Audit Preview Generator V2 structure and validation only. Verify tools/shared dependencies, report common CSS declaration candidates by comparing declaration bodies, verify Playwright launches Preview Generator V2, repair minimal Playwright coverage only if needed, do not modify samples, do not add schema, do not modify start_of_day folders, and produce required review artifacts."
55
```
66

77
## Validation Commands
88

99
```powershell
10+
rg -n "tools/shared|../shared|../../tools/shared|platformShell|shared/" tools/preview-generator-v2 tests/playwright/PreviewGeneratorV2Baseline.spec.mjs
11+
if ($LASTEXITCODE -eq 1) { Write-Output "no tools/shared references found"; $global:LASTEXITCODE = 0 }
12+
rg -n "<link|<script|import .* from" tools/preview-generator-v2 tests/playwright/PreviewGeneratorV2Baseline.spec.mjs
13+
1014
$files = Get-ChildItem -Path tools/preview-generator-v2 -Recurse -Filter *.js | Select-Object -ExpandProperty FullName
1115
foreach ($file in $files) {
1216
node --check $file
1317
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
1418
}
15-
@'
16-
const fs = require('fs');
17-
const html = fs.readFileSync('tools/preview-generator-v2/index.html', 'utf8');
18-
if (/<style\b/i.test(html) || /<\/style>/i.test(html)) throw new Error('Inline style block remains');
19-
const inlineScripts = [...html.matchAll(/<script(?![^>]*\bsrc=)[^>]*>/gi)];
20-
if (inlineScripts.length) throw new Error(`Inline script block remains: ${inlineScripts.length}`);
21-
if (!html.includes('./previewGeneratorV2.css')) throw new Error('External CSS link missing');
22-
if (!html.includes('./previewGeneratorV2.bootstrap.js')) throw new Error('Bootstrap module missing');
23-
console.log('index has no inline style/script blocks');
24-
'@ | node -
25-
@'
26-
const fs = require('fs');
27-
const path = require('path');
28-
const root = 'tools/preview-generator-v2';
29-
const files = [];
30-
function walk(dir) {
31-
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
32-
const full = path.join(dir, entry.name);
33-
if (entry.isDirectory()) walk(full);
34-
if (entry.isFile() && entry.name.endsWith('.js')) files.push(full);
35-
}
36-
}
37-
walk(root);
38-
for (const file of files) {
39-
const text = fs.readFileSync(file, 'utf8');
40-
const classes = [...text.matchAll(/\bclass\s+[A-Za-z0-9_]+/g)].map(match => match[0]);
41-
if (classes.length > 1) throw new Error(`${file} has more than one class: ${classes.join(', ')}`);
42-
}
43-
console.log('one class per js file check ok');
44-
'@ | node -
45-
@'
46-
const fs = require('fs');
47-
const path = require('path');
48-
const root = 'tools/preview-generator-v2';
49-
const files = [];
50-
function walk(dir) {
51-
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
52-
const full = path.join(dir, entry.name);
53-
if (entry.isDirectory()) walk(full);
54-
if (entry.isFile() && entry.name.endsWith('.js')) files.push(full);
55-
}
56-
}
57-
walk(root);
58-
for (const file of files) {
59-
const text = fs.readFileSync(file, 'utf8');
60-
for (const match of text.matchAll(/from\s+["'](.+?)["']/g)) {
61-
const target = path.resolve(path.dirname(file), match[1]);
62-
if (!fs.existsSync(target)) throw new Error(`${file} imports missing ${match[1]}`);
63-
}
64-
}
65-
console.log('local module imports resolve');
66-
'@ | node -
19+
node --check tests/playwright/PreviewGeneratorV2Baseline.spec.mjs
20+
npx playwright test tests/playwright/PreviewGeneratorV2Baseline.spec.mjs --project=playwright --reporter=list
6721
git status --short -- samples tools/schemas start_of_day
68-
git diff --check -- tools/preview-generator-v2 docs/dev/codex_commands.md docs/dev/commit_comment.txt docs/dev/reports/preview_generator_v2_class_responsibilities.md docs/dev/reports/codex_review.diff docs/dev/reports/codex_changed_files.txt
22+
git diff --check -- tools/preview-generator-v2 tests/playwright docs/dev/codex_commands.md docs/dev/commit_comment.txt docs/dev/reports/preview_generator_v2_shared_dependency_audit.txt docs/dev/reports/preview_generator_v2_common_style_candidates.txt docs/dev/reports/preview_generator_v2_playwright_result.txt
6923
npm run test:workspace-v2
7024
```
7125

7226
## Playwright
7327

74-
No new Playwright test was added. This PR is a file split and class ownership cleanup for Preview Generator V2 only; existing behavior is intended to remain unchanged. `npm run test:workspace-v2` is attempted as the standard command if available.
28+
Playwright validates that Preview Generator V2 launches, the main shell/menu/status controls render, Generate Preview and Stop start disabled, Games is the default target source, and a working accordion collapses/reopens without page errors.
29+
30+
Expected pass behavior: the targeted Playwright test passes with one launched tool page.
31+
32+
Expected fail behavior: the test fails if the tool cannot load, controls are missing, the default target source changes unexpectedly, accordion behavior is broken, or page errors are emitted.
7533

7634
## Test Notes
7735

7836
`npm run test:workspace-v2` is not defined in the current `package.json`.
7937

8038
## Manual Test
8139

82-
Open Preview Generator V2 and confirm the page loads with the same layout and controls. Pick a repo, verify Generate Preview gating, run a small known path, use Stop/Clear, and confirm Last Generated Image and Output Summary update as before.
40+
Open `tools/preview-generator-v2/index.html`, confirm the tool shell loads, toggle Repo Destination, confirm Generate Preview is visible but disabled before required fields are complete, and verify Status/Clear remain visible.
41+
42+
Full samples smoke test was skipped because this PR does not modify samples or shared sample loading.

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Split Preview Generator V2 files and add per-section control classes - PR_26126_035-preview-generator-v2-file-split-and-control-classes
1+
Audit Preview Generator V2 dependencies and add launch baseline - PR_26126_036-preview-generator-v2-shared-dependency-and-style-audit
Lines changed: 22 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,26 @@
1-
# Full git status --short
1+
# git status --short
22
M docs/dev/codex_commands.md
33
M docs/dev/commit_comment.txt
44
M docs/dev/reports/codex_changed_files.txt
55
M docs/dev/reports/codex_review.diff
6-
M docs/dev/reports/preview_generator_v2_class_responsibilities.md
7-
M tools/preview-generator-v2/index.html
8-
D tools/preview-generator-v2/previewGeneratorV2.js
9-
?? tools/preview-generator-v2/PreviewGeneratorV2App.js
10-
?? tools/preview-generator-v2/PreviewGeneratorV2Capture.js
11-
?? tools/preview-generator-v2/PreviewGeneratorV2Logger.js
12-
?? tools/preview-generator-v2/PreviewGeneratorV2RepoAccess.js
13-
?? tools/preview-generator-v2/PreviewGeneratorV2ShellControl.js
14-
?? tools/preview-generator-v2/PreviewGeneratorV2Ui.js
15-
?? tools/preview-generator-v2/controls/
16-
?? tools/preview-generator-v2/previewGeneratorV2.bootstrap.js
17-
?? tools/preview-generator-v2/previewGeneratorV2.css
18-
19-
# PR scoped git diff --stat
20-
docs/dev/codex_commands.md | 76 +-
21-
docs/dev/commit_comment.txt | 2 +-
22-
.../preview_generator_v2_class_responsibilities.md | 35 +-
23-
tools/preview-generator-v2/index.html | 476 +------
24-
tools/preview-generator-v2/previewGeneratorV2.js | 1317 --------------------
25-
5 files changed, 85 insertions(+), 1821 deletions(-)
26-
27-
# New file diff stat: tools/preview-generator-v2/previewGeneratorV2.css
28-
.../preview-generator-v2/previewGeneratorV2.css | 338 +++++++++++++++++++++
29-
1 file changed, 338 insertions(+)
30-
31-
# New file diff stat: tools/preview-generator-v2/previewGeneratorV2.bootstrap.js
32-
.../preview-generator-v2/previewGeneratorV2.bootstrap.js | 5 +++++
33-
1 file changed, 5 insertions(+)
34-
35-
# New file diff stat: tools/preview-generator-v2/PreviewGeneratorV2App.js
36-
.../preview-generator-v2/PreviewGeneratorV2App.js | 1200 ++++++++++++++++++++
37-
1 file changed, 1200 insertions(+)
38-
39-
# New file diff stat: tools/preview-generator-v2/PreviewGeneratorV2Capture.js
40-
.../PreviewGeneratorV2Capture.js | 27 ++++++++++++++++++++++
41-
1 file changed, 27 insertions(+)
42-
43-
# New file diff stat: tools/preview-generator-v2/PreviewGeneratorV2Logger.js
44-
.../PreviewGeneratorV2Logger.js | 24 ++++++++++++++++++++++
45-
1 file changed, 24 insertions(+)
46-
47-
# New file diff stat: tools/preview-generator-v2/PreviewGeneratorV2RepoAccess.js
48-
.../PreviewGeneratorV2RepoAccess.js | 25 ++++++++++++++++++++++
49-
1 file changed, 25 insertions(+)
50-
51-
# New file diff stat: tools/preview-generator-v2/PreviewGeneratorV2ShellControl.js
52-
.../PreviewGeneratorV2ShellControl.js | 136 +++++++++++++++++++++
53-
1 file changed, 136 insertions(+)
54-
55-
# New file diff stat: tools/preview-generator-v2/PreviewGeneratorV2Ui.js
56-
.../preview-generator-v2/PreviewGeneratorV2Ui.js | 84 ++++++++++++++++++++++
57-
1 file changed, 84 insertions(+)
58-
59-
# New file diff stat: tools/preview-generator-v2/controls/AssetFolderControl.js
60-
.../controls/AssetFolderControl.js | 19 +++++++++++++++++++
61-
1 file changed, 19 insertions(+)
62-
63-
# New file diff stat: tools/preview-generator-v2/controls/CaptureModeControl.js
64-
.../controls/CaptureModeControl.js | 28 ++++++++++++++++++++++
65-
1 file changed, 28 insertions(+)
66-
67-
# New file diff stat: tools/preview-generator-v2/controls/LastGeneratedImageControl.js
68-
.../controls/LastGeneratedImageControl.js | 29 ++++++++++++++++++++++
69-
1 file changed, 29 insertions(+)
70-
71-
# New file diff stat: tools/preview-generator-v2/controls/MenuSampleControl.js
72-
.../controls/MenuSampleControl.js | 25 ++++++++++++++++++++++
73-
1 file changed, 25 insertions(+)
74-
75-
# New file diff stat: tools/preview-generator-v2/controls/OutputSummaryControl.js
76-
.../controls/OutputSummaryControl.js | 16 ++++++++++++++++
77-
1 file changed, 16 insertions(+)
78-
79-
# New file diff stat: tools/preview-generator-v2/controls/PathsOrIdsControl.js
80-
.../preview-generator-v2/controls/PathsOrIdsControl.js | 15 +++++++++++++++
81-
1 file changed, 15 insertions(+)
82-
83-
# New file diff stat: tools/preview-generator-v2/controls/PreviewFrameControl.js
84-
.../preview-generator-v2/controls/PreviewFrameControl.js | 11 +++++++++++
85-
1 file changed, 11 insertions(+)
86-
87-
# New file diff stat: tools/preview-generator-v2/controls/RenderControlsControl.js
88-
.../controls/RenderControlsControl.js | 20 ++++++++++++++++++++
89-
1 file changed, 20 insertions(+)
90-
91-
# New file diff stat: tools/preview-generator-v2/controls/RepoDestinationControl.js
92-
.../controls/RepoDestinationControl.js | 17 +++++++++++++++++
93-
1 file changed, 17 insertions(+)
94-
95-
# New file diff stat: tools/preview-generator-v2/controls/StatusControl.js
96-
.../preview-generator-v2/controls/StatusControl.js | 13 +++++++++++++
97-
1 file changed, 13 insertions(+)
98-
99-
# New file diff stat: tools/preview-generator-v2/controls/TargetSourceControl.js
100-
.../controls/TargetSourceControl.js | 35 ++++++++++++++++++++++
101-
1 file changed, 35 insertions(+)
102-
103-
# Full git diff --stat
104-
docs/dev/codex_commands.md | 76 +-
105-
docs/dev/commit_comment.txt | 2 +-
106-
docs/dev/reports/codex_changed_files.txt | 128 +-
107-
docs/dev/reports/codex_review.diff | 5734 +++++++++++---------
108-
.../preview_generator_v2_class_responsibilities.md | 35 +-
109-
tools/preview-generator-v2/index.html | 476 +-
110-
tools/preview-generator-v2/previewGeneratorV2.js | 1317 -----
111-
7 files changed, 3276 insertions(+), 4492 deletions(-)
6+
?? docs/dev/reports/preview_generator_v2_common_style_candidates.txt
7+
?? docs/dev/reports/preview_generator_v2_playwright_result.txt
8+
?? docs/dev/reports/preview_generator_v2_shared_dependency_audit.txt
9+
?? tests/playwright/
10+
11+
# git diff --stat -- . excluding generated review artifact files
12+
docs/dev/codex_commands.md | 74 +++++++++++----------------------------------
13+
docs/dev/commit_comment.txt | 2 +-
14+
2 files changed, 18 insertions(+), 58 deletions(-)
15+
# New file diff stat: docs/dev/reports/preview_generator_v2_common_style_candidates.txt
16+
...review_generator_v2_common_style_candidates.txt | 96 ++++++++++++++++++++++
17+
1 file changed, 96 insertions(+)
18+
# New file diff stat: docs/dev/reports/preview_generator_v2_playwright_result.txt
19+
.../preview_generator_v2_playwright_result.txt | 38 ++++++++++++++++++++++
20+
1 file changed, 38 insertions(+)
21+
# New file diff stat: docs/dev/reports/preview_generator_v2_shared_dependency_audit.txt
22+
...review_generator_v2_shared_dependency_audit.txt | 40 ++++++++++++++++++++++
23+
1 file changed, 40 insertions(+)
24+
# New file diff stat: tests/playwright/PreviewGeneratorV2Baseline.spec.mjs
25+
.../playwright/PreviewGeneratorV2Baseline.spec.mjs | 47 ++++++++++++++++++++++
26+
1 file changed, 47 insertions(+)

0 commit comments

Comments
 (0)