Skip to content

Commit 6013519

Browse files
author
DavidQ
committed
Reorder examples so Games appears above Samples in Preview Generator V2 - PR_26126_024-preview-generator-v2-examples-order
1 parent 9186352 commit 6013519

4 files changed

Lines changed: 100 additions & 209 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Codex Commands - PR_26126_023-preview-generator-v2-label-consistency
1+
# Codex Commands - PR_26126_024-preview-generator-v2-examples-order
22

33
```bash
4-
codex run "Create PR_26126_023-preview-generator-v2-label-consistency. Fix Preview Generator V2 UI labels only. Preserve existing generation behavior. Make the header/title consistent: replace \"Preview SVG Generator > Preview Generator V2\" with \"Preview Generator V2\" and keep \"First-Class Tools Surface\" as the subtitle/context line. Remove duplicate labels inside the Asset folder section so \"Asset folder\" appears only once with value \"assets/images\". Remove duplicate labels inside Capture mode so \"Capture mode\" appears only once. Move \"Canvas Only\" above \"Full Screen (1600x900 HTML Page)\". Do not modify samples. Do not add schema. Produce review artifacts."
4+
codex run "Create PR_26126_024-preview-generator-v2-examples-order. Fix Preview Generator V2 UI text ordering only. Preserve existing generation behavior. Move the \"Games examples\" section (games\\<gamename>\\index.html and <gamename>) so it appears above the \"Samples examples\" section (samples/phase-01/0102/index.html). Do not modify samples. Do not add schema. Produce review artifacts."
55
```
66

77
## Validation Commands
@@ -31,47 +31,28 @@ await page.route('https://cdn.jsdelivr.net/**', async (route) => {
3131
await route.fulfill({ status: 200, contentType: 'text/javascript', body: 'window.html2canvas = window.html2canvas || undefined;' });
3232
});
3333
await page.goto(`${server.baseUrl}/tools/preview-generator-v2/index.html`, { waitUntil: 'domcontentloaded' });
34-
await page.waitForSelector('#shared-theme-header');
35-
await page.waitForFunction(() => Array.from(document.querySelectorAll('.preview-generator-v2 .accordion-v2__header')).every((header) => header.dataset.accordionV2Bound === 'true'));
36-
37-
const title = await page.title();
38-
if (title !== 'Preview Generator V2') throw new Error(`Unexpected title: ${title}`);
39-
const h1 = await page.locator('.tools-platform-frame__title[data-tool-id="preview-generator-v2"]').innerText();
40-
if (h1.trim() !== 'Preview Generator V2') throw new Error(`Unexpected h1: ${h1}`);
41-
const eyebrow = await page.locator('.tools-platform-frame__eyebrow').innerText();
42-
if (eyebrow.trim() !== 'First-Class Tools Surface') throw new Error(`Unexpected context line: ${eyebrow}`);
43-
const bodyText = await page.locator('body').innerText();
44-
if (bodyText.includes('Preview SVG Generator')) throw new Error('Old Preview SVG Generator label is still visible.');
45-
46-
const assetLabelCount = await page.evaluate(() => (document.body.innerText.match(/Asset folder/g) || []).length);
47-
if (assetLabelCount !== 1) throw new Error(`Expected one visible Asset folder label, got ${assetLabelCount}`);
48-
const assetFolderValue = await page.locator('#assetFolder').inputValue();
49-
if (assetFolderValue !== 'assets/images') throw new Error(`Unexpected asset folder value: ${assetFolderValue}`);
50-
const assetAria = await page.locator('#assetFolder').getAttribute('aria-label');
51-
if (assetAria !== 'Asset folder') throw new Error(`Expected Asset folder aria label, got ${assetAria}`);
52-
53-
const captureLabelCount = await page.evaluate(() => (document.body.innerText.match(/Capture mode/g) || []).length);
54-
if (captureLabelCount !== 1) throw new Error(`Expected one visible Capture mode label, got ${captureLabelCount}`);
55-
const captureTexts = await page.locator('#captureModeContent .preview-generator-v2__radio-option span').evaluateAll((nodes) => nodes.map((node) => node.textContent.trim()));
56-
const expectedCaptureTexts = ['Canvas Only', 'Full Screen (1600x900 HTML Page)'];
57-
if (JSON.stringify(captureTexts) !== JSON.stringify(expectedCaptureTexts)) throw new Error(`Unexpected capture order: ${captureTexts.join(' | ')}`);
58-
if (!(await page.locator('#captureModeCanvasOnly').isChecked())) throw new Error('Canvas Only should remain selected by default.');
59-
if (await page.locator('legend', { hasText: 'Capture mode' }).count()) throw new Error('Capture mode legend should not render as duplicate label.');
60-
61-
const generateButton = page.locator('#executeBtn');
62-
if (!(await generateButton.isVisible())) throw new Error('Generate Preview button should remain visible.');
63-
if (!(await generateButton.isDisabled())) throw new Error('Generate Preview should remain disabled until required fields are provided.');
34+
await page.waitForSelector('#sampleList');
35+
const placeholder = await page.locator('#sampleList').getAttribute('placeholder');
36+
if (!placeholder) throw new Error('Paths or IDs placeholder is missing.');
37+
const gamesIndex = placeholder.indexOf('Games examples:');
38+
const samplesIndex = placeholder.indexOf('Samples examples:');
39+
const toolsIndex = placeholder.indexOf('Tools examples:');
40+
if (gamesIndex !== 0) throw new Error(`Games examples should be first, got index ${gamesIndex}.`);
41+
if (samplesIndex <= gamesIndex) throw new Error('Samples examples should appear after Games examples.');
42+
if (toolsIndex <= samplesIndex) throw new Error('Tools examples should remain after Samples examples.');
43+
if (!placeholder.includes('games\\<gamename>\\index.html')) throw new Error('Games path example is missing.');
44+
if (!placeholder.includes('samples/phase-01/0102/index.html')) throw new Error('Samples path example is missing.');
6445
if (errors.length || consoleErrors.length) throw new Error([...errors, ...consoleErrors].join(' | '));
6546
await browser.close();
6647
await server.close();
67-
console.log('preview-generator-v2 label consistency smoke valid');
48+
console.log('preview-generator-v2 examples order smoke valid');
6849
'@ | node --input-type=module -
6950
```
7051

7152
## Notes
7253

73-
The targeted Playwright smoke validates the updated title/header labels, confirms the old `Preview SVG Generator` label is not visible, verifies Asset folder and Capture mode each render one visible label, confirms `Canvas Only` is listed before `Full Screen (1600x900 HTML Page)`, and checks the Generate Preview gate remains visible/disabled before required fields are provided.
54+
The targeted Playwright smoke validates that the `Paths or IDs` placeholder now renders `Games examples` first, then `Samples examples`, then `Tools examples`, while preserving the expected games and samples example text.
7455

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

77-
Full samples smoke test was skipped because this PR is scoped to Preview Generator V2 labels only.
58+
Full samples smoke test was skipped because this PR is scoped to Preview Generator V2 UI text ordering only.

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Normalize Preview Generator V2 labels - PR_26126_023-preview-generator-v2-label-consistency
1+
Reorder Preview Generator V2 examples - PR_26126_024-preview-generator-v2-examples-order

0 commit comments

Comments
 (0)