Skip to content

Commit 4800cf0

Browse files
author
DavidQ
committed
Polish Preview Generator V2 output summary controls, target ordering, and write folder labels - PR_26126_015-preview-generator-v2-output-target-polish
1 parent 513746d commit 4800cf0

5 files changed

Lines changed: 242 additions & 592 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Codex Commands - PR_26126_014-preview-generator-v2-layout-polish
1+
# Codex Commands - PR_26126_015-preview-generator-v2-output-target-polish
22

33
```bash
4-
codex run "Create PR_26126_014-preview-generator-v2-layout-polish. Fix Preview Generator V2 UI polish only. Preserve existing generation behavior. Fix Hide Header & Details so it enters the same fullscreen/collapsed-header behavior used by Palette Manager V2. Move Pick Repo Folder above Repo Selected. Status must not use an accordion; render Status as a normal compact status block. Reduce Output Summary height so it fits content instead of stretching tall; keep Write folder sample and Write folder compact and readable. Do not modify samples. Do not add schema. Produce review artifacts."
4+
codex run "Create PR_26126_015-preview-generator-v2-output-target-polish. Fix Preview Generator V2 UI polish only. Preserve existing generation behavior. Output Summary must not show dead accordion controls such as X or underscore unless they work; remove those controls. Status must remain a normal block with no accordion and no X. Update write folder sample labels/values: \"games\\Game Name\" becomes \"games\\<gamename>\", \"tools\\Tool Name\" becomes \"tools\\<toolname>\", and any repeated game example must use \"games\\<gamename>\". In Target type, move Games above Samples and remove the \"Target type\" text label. Render \"Write folder sample\" label/value on two lines with value \"samples\\phaseXX\\XXXX\\assets\\images\". Render \"Write folder\" label/value on two lines with value \"not available yet\". Do not modify samples. Do not add schema. Produce review artifacts."
55
```
66

77
## Validation Commands
@@ -25,9 +25,7 @@ const errors = [];
2525
const consoleErrors = [];
2626
page.on('pageerror', (error) => errors.push(error.message));
2727
page.on('console', (message) => {
28-
if (message.type() === 'error') {
29-
consoleErrors.push(message.text());
30-
}
28+
if (message.type() === 'error') consoleErrors.push(message.text());
3129
});
3230
await page.route('https://cdn.jsdelivr.net/**', async (route) => {
3331
await route.fulfill({ status: 200, contentType: 'text/javascript', body: 'window.html2canvas = window.html2canvas || undefined;' });
@@ -43,33 +41,47 @@ await page.addInitScript(() => {
4341
class FakeDirectoryHandle {
4442
constructor(name = 'SelectedRepoFolder', path = '') { this.kind = 'directory'; this.name = name; this.path = path; this.children = new Map(); }
4543
async getDirectoryHandle(name) { const key = `dir:${name}`; if (!this.children.has(key)) { const nextPath = this.path ? `${this.path}/${name}` : name; this.children.set(key, new FakeDirectoryHandle(name, nextPath)); } return this.children.get(key); }
46-
async getFileHandle(name, options = {}) { const key = `file:${name}`; if (!this.children.has(key)) { if (!options.create) { throw new DOMException('Not found', 'NotFoundError'); } const nextPath = this.path ? `${this.path}/${name}` : name; this.children.set(key, new FakeFileHandle(nextPath)); } return this.children.get(key); }
44+
async getFileHandle(name, options = {}) { const key = `file:${name}`; if (!this.children.has(key)) { if (!options.create) throw new DOMException('Not found', 'NotFoundError'); const nextPath = this.path ? `${this.path}/${name}` : name; this.children.set(key, new FakeFileHandle(nextPath)); } return this.children.get(key); }
4745
}
4846
window.__previewGeneratorV2Writes = writes;
4947
window.showDirectoryPicker = async () => new FakeDirectoryHandle();
5048
});
5149
5250
await page.goto(`${server.baseUrl}/tools/preview-generator-v2/index.html`, { waitUntil: 'domcontentloaded' });
5351
await page.waitForSelector('#shared-theme-header');
54-
await page.waitForFunction(() => document.querySelector('[data-preview-generator-v2-summary]')?.dataset.toolsPlatformSummaryActive === '1');
5552
56-
const repoOrder = await page.locator('#repoDestinationAccordionContent > *').evaluateAll((nodes) => nodes.map((node) => node.textContent.trim().replace(/\s+/g, ' ')));
57-
if (!repoOrder[0].includes('Pick Repo Folder') || !repoOrder[1].includes('Repo selected')) throw new Error(`Repo destination order is wrong: ${JSON.stringify(repoOrder)}`);
53+
if (await page.locator('#outputSummary .accordion-v2__icon').count() !== 0) throw new Error('Output Summary still has accordion icon controls.');
54+
if (await page.locator('#outputSummary .accordion-v2__header').count() !== 0) throw new Error('Output Summary still has accordion header controls.');
5855
if (await page.locator('#statusAccordionContent').count() !== 0) throw new Error('Status accordion content still exists.');
59-
if (await page.locator('.accordion-v2__header span:text-is("Status")').count() !== 0) throw new Error('Status is still rendered as an accordion header.');
60-
if (await page.locator('.preview-generator-v2__status-block #status').count() !== 1) throw new Error('Status block does not contain status text.');
56+
if (await page.locator('.preview-generator-v2__status-block .accordion-v2__icon').count() !== 0) throw new Error('Status block still has accordion icon controls.');
57+
58+
const targetLabels = await page.locator('#targetSourceAccordionContent .preview-generator-v2__radio-option span').evaluateAll((items) => items.map((item) => item.textContent.trim()));
59+
if (JSON.stringify(targetLabels) !== JSON.stringify(['Games', 'Samples', 'Tools'])) throw new Error(`Unexpected target order: ${JSON.stringify(targetLabels)}`);
60+
if ((await page.locator('#targetSourceAccordionContent').innerText()).includes('Target type')) throw new Error('Target type text label still visible.');
6161
62-
const outputFlex = await page.locator('.preview-generator-v2__output-summary').evaluate((node) => getComputedStyle(node).flexGrow);
63-
if (outputFlex !== '0') throw new Error(`Output Summary should not flex-grow; got ${outputFlex}`);
6462
const initialSampleText = await page.locator('#writeFolderSampleValue').innerText();
65-
if (initialSampleText !== 'samples\\phaseXX\\XXXX\\assets\\images') throw new Error(`Unexpected write-folder sample text: ${initialSampleText}`);
63+
if (initialSampleText !== 'samples\\phaseXX\\XXXX\\assets\\images') throw new Error(`Unexpected initial sample text: ${initialSampleText}`);
64+
const initialWriteText = await page.locator('#writeFolderActualValue').innerText();
65+
if (initialWriteText !== 'not available yet') throw new Error(`Unexpected initial write folder text: ${initialWriteText}`);
66+
67+
const summaryFields = await page.locator('#outputSummaryContent .preview-generator-v2__summary-field').evaluateAll((fields) => fields.map((field) => {
68+
const children = Array.from(field.children);
69+
return children.map((child) => ({ text: child.textContent.trim(), top: Math.round(child.getBoundingClientRect().top) }));
70+
}));
71+
for (const field of summaryFields) {
72+
if (field.length !== 2 || field[0].top >= field[1].top) throw new Error(`Summary field is not two-line label/value: ${JSON.stringify(field)}`);
73+
}
74+
75+
const placeholder = await page.locator('#sampleList').getAttribute('placeholder');
76+
if (!placeholder.includes('games\\<gamename>\\index.html')) throw new Error(`Game placeholder not normalized: ${placeholder}`);
77+
if (!placeholder.includes('tools\\<toolname>\\index.html')) throw new Error(`Tool placeholder not normalized: ${placeholder}`);
6678
67-
const summary = page.locator('[data-preview-generator-v2-summary]');
68-
await summary.click();
69-
await page.waitForFunction(() => document.querySelector('.is-collapsible')?.open === false);
70-
await page.waitForFunction(() => document.querySelector('[data-preview-generator-v2-summary]')?.dataset.toolsPlatformSummaryState === 'collapsed');
71-
await summary.click();
72-
await page.waitForFunction(() => document.querySelector('.is-collapsible')?.open === true);
79+
await page.check('#targetTypeGames');
80+
await page.waitForFunction(() => document.getElementById('writeFolderSampleValue').textContent === 'games\\<gamename>\\assets\\images');
81+
await page.check('#targetTypeTools');
82+
await page.waitForFunction(() => document.getElementById('writeFolderSampleValue').textContent === 'tools\\<toolname>\\assets\\images');
83+
await page.check('#targetTypeSamples');
84+
await page.waitForFunction(() => document.getElementById('writeFolderSampleValue').textContent === 'samples\\phaseXX\\XXXX\\assets\\images');
7385
7486
await page.fill('#baseUrl', server.baseUrl);
7587
await page.fill('#waitMs', '3000');
@@ -87,13 +99,13 @@ if (!writes[0].content.includes('<svg')) throw new Error('Generated content is n
8799
if (errors.length || consoleErrors.length) throw new Error([...errors, ...consoleErrors].join(' | '));
88100
await browser.close();
89101
await server.close();
90-
console.log('preview-generator-v2 layout polish browser smoke valid');
102+
console.log('preview-generator-v2 output target polish browser smoke valid');
91103
'@ | node --input-type=module -
92104
```
93105

94106
## Notes
95107

96-
The targeted Playwright smoke validates the Preview Generator V2 layout polish, including Palette Manager-style collapsed header behavior, Pick Repo order, normal Status block, compact Output Summary sizing, and the existing preview generation write path.
108+
The targeted Playwright smoke validates that Output Summary and Status have no dead accordion controls, target radios display Games/Samples/Tools, placeholder and write-folder sample text uses `<gamename>`/`<toolname>`, summary fields render as label/value rows, and the existing preview generation path still writes `preview.svg`.
97109

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

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Polish Preview Generator V2 layout and collapsed header behavior - PR_26126_014-preview-generator-v2-layout-polish
1+
Polish Preview Generator V2 output targets and summary controls - PR_26126_015-preview-generator-v2-output-target-polish

docs/dev/reports/codex_changed_files.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ M docs/dev/codex_commands.md
44
M tools/preview-generator-v2/index.html
55

66
# git diff --stat
7-
docs/dev/codex_commands.md | 186 ++++-------------------
8-
docs/dev/commit_comment.txt | 2 +-
9-
tools/preview-generator-v2/index.html | 271 ++++++++++++++++++++++++++++++----
10-
3 files changed, 279 insertions(+), 180 deletions(-)
7+
docs/dev/codex_commands.md | 56 +++++++++++++++++------------
8+
docs/dev/commit_comment.txt | 2 +-
9+
tools/preview-generator-v2/index.html | 66 ++++++++++++++++-------------------
10+
3 files changed, 66 insertions(+), 58 deletions(-)

0 commit comments

Comments
 (0)