Skip to content

Commit c78047b

Browse files
author
DavidQ
committed
Set default target source and reposition capture mode and asset folder controls in Preview Generator V2 - PR_26126_020-preview-generator-v2-target-source-and-control-placement
1 parent a56162e commit c78047b

5 files changed

Lines changed: 197 additions & 372 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Codex Commands - PR_26126_019-preview-generator-v2-accordion-status-and-generate-gate
1+
# Codex Commands - PR_26126_020-preview-generator-v2-target-source-and-control-placement
22

33
```bash
4-
codex run "Create PR_26126_019-preview-generator-v2-accordion-status-and-generate-gate. Fix Preview Generator V2 UI only. Preserve existing generation behavior. New rule: left and right columns must always use working accordion sections. Restore working accordion behavior on the left column and keep working accordion behavior on the right column. Add a Clear button on the same line as Status to empty the logging/status textarea. Hide Generate Preview until all required fields are provided; do not merely disable it. Add the missing \"Paths or IDs\" header above the input information in the left panel aside. Do not modify samples. Do not add schema. Produce review artifacts."
4+
codex run "Create PR_26126_020-preview-generator-v2-target-source-and-control-placement. Fix Preview Generator V2 UI only. Preserve existing generation behavior. Default Target Source to Games. Generate Preview must be visible but disabled/greyed out until required fields are provided; do not hide it. Move Capture mode into its own accordion/control section above Render Controls with options \"Full Screen (1600x900 HTML Page)\" and \"Canvas Only\". Move Asset folder into its own accordion/control section below Target Source with value \"assets/images\". Left and right columns must continue to use working accordion sections. Do not modify samples. Do not add schema. Produce review artifacts."
55
```
66

77
## Validation Commands
@@ -56,38 +56,43 @@ async function assertAccordion(selector) {
5656
const content = page.locator(`${selector} .accordion-v2__content`).first();
5757
if (await header.count() !== 1) throw new Error(`${selector} missing accordion header`);
5858
if (await content.count() !== 1) throw new Error(`${selector} missing accordion content`);
59-
if (await header.getAttribute('aria-expanded') !== 'true') throw new Error(`${selector} should start expanded`);
6059
await header.click();
6160
await page.waitForFunction((target) => document.querySelector(`${target} .accordion-v2__header`)?.getAttribute('aria-expanded') === 'false', selector);
6261
const collapsed = await content.evaluate((node) => ({ hidden: node.hidden, display: getComputedStyle(node).display, height: node.getBoundingClientRect().height }));
63-
if (!collapsed.hidden) throw new Error(`${selector} should set hidden=true when collapsed`);
64-
if (collapsed.display !== 'none') throw new Error(`${selector} collapsed display should be none, got ${collapsed.display}`);
65-
if (collapsed.height !== 0) throw new Error(`${selector} collapsed height should be 0, got ${collapsed.height}`);
62+
if (!collapsed.hidden || collapsed.display !== 'none' || collapsed.height !== 0) throw new Error(`${selector} did not collapse cleanly`);
6663
await header.click();
6764
await page.waitForFunction((target) => document.querySelector(`${target} .accordion-v2__header`)?.getAttribute('aria-expanded') === 'true', selector);
6865
}
6966
67+
const leftHeaders = await page.locator('.preview-generator-v2__left-accordion .accordion-v2__header').evaluateAll((headers) => headers.map((header) => header.textContent.trim().replace(/\s+/g, ' ')));
68+
const expectedLeftHeaders = ['Repo Destination +', 'Target Source +', 'Asset folder +', 'Capture mode +', 'Render Controls +'];
69+
if (JSON.stringify(leftHeaders) !== JSON.stringify(expectedLeftHeaders)) throw new Error(`Unexpected left accordion order: ${JSON.stringify(leftHeaders)}`);
70+
7071
for (const selector of [
7172
'.preview-generator-v2__left-accordion:nth-of-type(1)',
7273
'.preview-generator-v2__left-accordion:nth-of-type(2)',
7374
'.preview-generator-v2__left-accordion:nth-of-type(3)',
75+
'.preview-generator-v2__left-accordion:nth-of-type(4)',
76+
'.preview-generator-v2__left-accordion:nth-of-type(5)',
7477
'#outputSummary',
7578
'#statusAccordion'
7679
]) {
7780
await assertAccordion(selector);
7881
}
7982
80-
if ((await page.locator('#pathsOrIdsTitle').innerText()) !== 'Paths or IDs') throw new Error('Missing Paths or IDs heading.');
81-
if (await page.locator('#executeBtn').isVisible()) throw new Error('Generate Preview should be hidden before required fields are provided.');
83+
if (!(await page.locator('#targetTypeGames').isChecked())) throw new Error('Games should be the default Target Source.');
84+
if (await page.locator('#targetTypeSamples').isChecked()) throw new Error('Samples should not be default Target Source.');
85+
if ((await page.locator('#assetFolder').inputValue()) !== 'assets/images') throw new Error('Asset folder should remain assets/images.');
86+
if (!(await page.locator('#executeBtn').isVisible())) throw new Error('Generate Preview should be visible before required fields are provided.');
87+
if (!(await page.locator('#executeBtn').isDisabled())) throw new Error('Generate Preview should be disabled before required fields are provided.');
8288
await page.fill('#baseUrl', server.baseUrl);
8389
await page.fill('#waitMs', '3000');
8490
await page.fill('#sampleList', '0107');
8591
await page.check('#forceRewrite');
86-
if (await page.locator('#executeBtn').isVisible()) throw new Error('Generate Preview should remain hidden until repo folder is selected.');
87-
await page.click('#clearLogBtn');
88-
if ((await page.locator('#log').innerText()).trim() !== '') throw new Error('Clear should empty the status log output.');
92+
if (!(await page.locator('#executeBtn').isVisible()) || !(await page.locator('#executeBtn').isDisabled())) throw new Error('Generate Preview should remain visible and disabled until repo folder is selected.');
93+
await page.check('#targetTypeSamples');
8994
await page.click('#pickRepoBtn');
90-
await page.waitForFunction(() => !document.getElementById('executeBtn').hidden && !document.getElementById('executeBtn').disabled);
95+
await page.waitForFunction(() => !document.getElementById('executeBtn').disabled);
9196
await page.waitForFunction(() => document.getElementById('writeFolderActualValue').textContent === 'samples\\phase-01\\0107\\assets\\images');
9297
await page.click('#executeBtn');
9398
await page.waitForFunction(() => document.getElementById('log').textContent.includes('===== SUMMARY ====='), null, { timeout: 35000 });
@@ -98,13 +103,13 @@ if (!writes[0].content.includes('<svg')) throw new Error('Generated content is n
98103
if (errors.length || consoleErrors.length) throw new Error([...errors, ...consoleErrors].join(' | '));
99104
await browser.close();
100105
await server.close();
101-
console.log('preview-generator-v2 accordion status generate gate smoke valid');
106+
console.log('preview-generator-v2 target source and control placement smoke valid');
102107
'@ | node --input-type=module -
103108
```
104109

105110
## Notes
106111

107-
The targeted Playwright smoke validates left and right accordion collapse/expand behavior, hidden Generate Preview gating, Status Clear log clearing, the Paths or IDs heading, repo destination display, and preserved preview generation output.
112+
The targeted Playwright smoke validates default Games target, visible disabled Generate Preview gating, Asset folder and Capture mode section placement, working left/right accordions, and preserved preview generation after switching to Samples.
108113

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

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Restore Preview Generator V2 accordions and generate readiness gate - PR_26126_019-preview-generator-v2-accordion-status-and-generate-gate
1+
Place Preview Generator V2 target controls and keep Generate visibly gated - PR_26126_020-preview-generator-v2-target-source-and-control-placement

docs/dev/reports/codex_changed_files.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ M docs/dev/reports/codex_review.diff
66
M tools/preview-generator-v2/index.html
77

88
# git diff --stat
9-
docs/dev/codex_commands.md | 56 +++++++--------
10-
docs/dev/commit_comment.txt | 2 +-
11-
tools/preview-generator-v2/index.html | 131 ++++++++++++++++++++++++++--------
12-
3 files changed, 128 insertions(+), 61 deletions(-)
9+
docs/dev/codex_commands.md | 33 +++++++++++--------
10+
docs/dev/commit_comment.txt | 2 +-
11+
tools/preview-generator-v2/index.html | 60 ++++++++++++++++++++++-------------
12+
3 files changed, 58 insertions(+), 37 deletions(-)

0 commit comments

Comments
 (0)