Skip to content

Commit ff4c079

Browse files
author
DavidQ
committed
Fix Preview Generator V2 reskin controls, NAV, repo fields, and Palette Manager styling - PR_26126_013-preview-generator-v2-reskin-fixes
1 parent 292a699 commit ff4c079

5 files changed

Lines changed: 859 additions & 6081 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Codex Commands - PR_26126_012-preview-generator-v2-reskin-from-working-base
1+
# Codex Commands - PR_26126_013-preview-generator-v2-reskin-fixes
22

33
```bash
4-
codex run "Create PR_26126_012-preview-generator-v2-reskin-from-working-base. Using tools/preview-generator-v2/index.html (cold copy of preview.html), perform a reskin only. Do not change or break existing functionality, logic, or behavior. Do not remove existing inputs or labels; keep them and regroup them. Apply Palette Manager layout and header. Add NAV using palette-manager-v2__menu-sample with ONLY Generate Preview button. Reorganize UI: Left column groups existing controls into Repo Destination (rename Game Destination; folder selection behavior unchanged), Target Source, and Render Controls. Center column replaces visual Main Preview with a Paths or IDs input box (reuse existing input if present). Right column places Output Summary with Status under it. Do not add JSON UI. Do not create a schema. Do not modify samples. Ensure all existing preview generation still works after layout changes. Produce review artifacts."
4+
codex run "Create PR_26126_013-preview-generator-v2-reskin-fixes. Fix Preview Generator V2 reskin only. Preserve existing preview.html functionality. Remove all copied preview.html CSS and use only Palette Manager V2-style HTML/classes plus Preview Generator V2 wrapper classes where needed. Move STOP into the Palette Manager-style NAV next to Generate Preview. Fix Repo selected so it populates correctly from the selected repo destination/folder. Remove the Repo Sample control entirely. Populate the write folder sample text as \"samples\\phaseXX\\XXXX\\assets\\images\". Ensure Write folder is populated correctly. Remove the \"Paths or IDs\" label/field wrapper from the center column structure shown in preview-generator-v2__paths-field. Move the existing textarea to the top of the layout/control flow. Do not add JSON UI. Do not create schema. Do not modify samples. Update targeted tests if needed and produce review artifacts."
55
```
66

77
## Validation Commands
88

99
```bash
10-
git diff --check -- tools/preview-generator-v2/index.html tools/toolRegistry.js docs/dev/codex_commands.md docs/dev/commit_comment.txt
10+
git diff --check -- tools/preview-generator-v2/index.html docs/dev/codex_commands.md docs/dev/commit_comment.txt
1111
git diff --name-only -- samples games start_of_day tools/shared tools/schemas
1212
npm run test:workspace-v2
1313
npm run codex:review-artifacts
@@ -63,7 +63,7 @@ await page.addInitScript(() => {
6363
}
6464
}
6565
class FakeDirectoryHandle {
66-
constructor(name = 'HTML-JavaScript-Gaming', path = '') {
66+
constructor(name = 'SelectedRepoFolder', path = '') {
6767
this.kind = 'directory';
6868
this.name = name;
6969
this.path = path;
@@ -99,8 +99,8 @@ await page.waitForSelector('#shared-theme-header');
9999
const requiredSelectors = [
100100
'.palette-manager-v2__menu-sample',
101101
'#executeBtn',
102-
'#pickRepoBtn',
103102
'#stopBtn',
103+
'#pickRepoBtn',
104104
'#targetTypeSamples',
105105
'#targetTypeGames',
106106
'#targetTypeTools',
@@ -127,10 +127,27 @@ for (const selector of requiredSelectors) {
127127
}
128128
129129
const menuButtons = await page.locator('.palette-manager-v2__menu-sample button').evaluateAll((buttons) => buttons.map((button) => button.textContent.trim()));
130-
if (JSON.stringify(menuButtons) !== JSON.stringify(['Generate Preview'])) {
130+
if (JSON.stringify(menuButtons) !== JSON.stringify(['Generate Preview', 'Stop'])) {
131131
throw new Error(`Unexpected menu buttons: ${JSON.stringify(menuButtons)}`);
132132
}
133133
134+
const hasCopiedPreviewCss = await page.locator('link[href*="shared/preview/preview-pages.css"]').count();
135+
if (hasCopiedPreviewCss !== 0) {
136+
throw new Error('Copied preview stylesheet is still loaded.');
137+
}
138+
const copiedClassCounts = await page.evaluate(() => ({
139+
row: document.querySelectorAll('.row').length,
140+
inline: document.querySelectorAll('.inline').length,
141+
inlineLabel: document.querySelectorAll('.inline-label').length,
142+
valueBox: document.querySelectorAll('.value-box').length,
143+
pathsField: document.querySelectorAll('.preview-generator-v2__paths-field').length
144+
}));
145+
for (const [name, count] of Object.entries(copiedClassCounts)) {
146+
if (count !== 0) {
147+
throw new Error(`Copied preview class still present: ${name}=${count}`);
148+
}
149+
}
150+
134151
const forbiddenSelectors = [
135152
'#applyToGameButton',
136153
'#exportImageButton',
@@ -146,18 +163,35 @@ for (const selector of forbiddenSelectors) {
146163
}
147164
148165
const sectionNames = await page.locator('.accordion-v2__header span:first-child').evaluateAll((items) => items.map((item) => item.textContent.trim()));
149-
for (const expected of ['Repo Destination', 'Target Source', 'Render Controls', 'Paths or IDs', 'Output Summary', 'Status']) {
166+
for (const expected of ['Repo Destination', 'Target Source', 'Render Controls', 'Output Summary', 'Status']) {
150167
if (!sectionNames.includes(expected)) {
151168
throw new Error(`Missing section: ${expected}`);
152169
}
153170
}
171+
if (sectionNames.includes('Paths or IDs')) {
172+
throw new Error('Paths or IDs accordion header should not exist.');
173+
}
174+
175+
if (await page.locator('label[for="sampleList"]').count() !== 0) {
176+
throw new Error('Paths or IDs field label wrapper should not exist.');
177+
}
178+
179+
const initialSampleText = await page.locator('#writeFolderSampleValue').innerText();
180+
if (initialSampleText !== 'samples\\phaseXX\\XXXX\\assets\\images') {
181+
throw new Error(`Unexpected write-folder sample text: ${initialSampleText}`);
182+
}
154183
155184
await page.fill('#baseUrl', server.baseUrl);
156185
await page.fill('#waitMs', '3000');
157186
await page.fill('#sampleList', '0107');
158187
await page.check('#forceRewrite');
159188
await page.click('#pickRepoBtn');
160189
await page.waitForFunction(() => !document.getElementById('executeBtn').disabled);
190+
const repoSelected = await page.locator('#repoSelectedValue').innerText();
191+
if (repoSelected !== 'SelectedRepoFolder') {
192+
throw new Error(`Repo selected did not populate from folder handle: ${repoSelected}`);
193+
}
194+
await page.waitForFunction(() => document.getElementById('writeFolderActualValue').textContent === 'samples\\phase-01\\0107\\assets\\images');
161195
await page.click('#executeBtn');
162196
await page.waitForFunction(() => document.getElementById('log').textContent.includes('===== SUMMARY ====='), null, { timeout: 35000 });
163197
const writes = await page.evaluate(() => window.__previewGeneratorV2Writes || []);
@@ -175,17 +209,13 @@ if (errors.length || consoleErrors.length) {
175209
}
176210
await browser.close();
177211
await server.close();
178-
console.log('preview-generator-v2 reskin browser smoke valid');
212+
console.log('preview-generator-v2 reskin fixes browser smoke valid');
179213
'@ | node --input-type=module -
180214
```
181215

182216
## Notes
183217

184-
`tools/preview-generator-v2/index.html` remains the cold-copy working generator base with the existing inline generator script and functional element IDs preserved.
185-
186-
The reskin only regroups the existing controls into Palette Manager-style header, menu, panels, and accordion sections. The nav contains only `Generate Preview`, using the existing `executeBtn` behavior.
187-
188-
The targeted Playwright smoke verifies the reskinned layout, absence of JSON/schema UI controls, and the existing generator path by writing a fake `preview.svg` through the File System Access API shim.
218+
The targeted browser smoke validates the Palette Manager-style reskin fixes, confirms Stop is in the nav, verifies the old copied preview CSS/classes are gone, checks the write-folder text behavior, and exercises the existing preview generation write path.
189219

190220
`npm run test:workspace-v2` was attempted, but the script is not defined in this checkout.
191221

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Reskin Preview Generator V2 from working base without behavior changes - PR_26126_012-preview-generator-v2-reskin-from-working-base
1+
Fix Preview Generator V2 reskin without changing generator behavior - PR_26126_013-preview-generator-v2-reskin-fixes
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# git status --short
22
M docs/dev/codex_commands.md
33
M docs/dev/commit_comment.txt
4-
M docs/dev/reports/codex_changed_files.txt
5-
M docs/dev/reports/codex_review.diff
64
M tools/preview-generator-v2/index.html
75

86
# git diff --stat
9-
docs/dev/codex_commands.md | 182 +-
10-
docs/dev/commit_comment.txt | 2 +-
11-
docs/dev/reports/codex_changed_files.txt | 26 +-
12-
docs/dev/reports/codex_review.diff | 5017 ++++--------------------------
13-
tools/preview-generator-v2/index.html | 485 ++-
14-
5 files changed, 1222 insertions(+), 4490 deletions(-)
7+
docs/dev/codex_commands.md | 56 +++--
8+
docs/dev/commit_comment.txt | 2 +-
9+
tools/preview-generator-v2/index.html | 420 +++++++++++++---------------------
10+
3 files changed, 209 insertions(+), 269 deletions(-)

0 commit comments

Comments
 (0)