Skip to content

Commit f9645da

Browse files
author
DavidQ
committed
Enforce consistent accordion behavior across all sections in Preview Generator V2 - PR_26126_047-preview-generator-v2-final-accordion-consistency
1 parent 9ae945f commit f9645da

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
PR_26126_047 Preview Generator V2 accordion consistency
2+
3+
Scope
4+
- Updated Preview Generator V2 Playwright coverage only.
5+
- No runtime tool behavior was changed.
6+
- No samples, schemas, or start_of_day files were modified.
7+
8+
Accordion ownership audit
9+
- Repo Destination uses AccordionSection through RepoDestinationControl.
10+
- Target Source uses AccordionSection through TargetSourceControl.
11+
- Asset Folder uses AccordionSection through AssetFolderControl.
12+
- Capture Mode uses AccordionSection through CaptureModeControl.
13+
- Render Controls uses AccordionSection through RenderControlsControl.
14+
- Paths or IDs uses AccordionSection through PathsOrIdsControl.
15+
- Last Generated Image uses AccordionSection through LastGeneratedImageControl.
16+
- Output Summary uses AccordionSection through OutputSummaryControl.
17+
- Status uses AccordionSection through StatusLogControl.
18+
19+
Duplicate/custom logic check
20+
- Accordion open/closed state mutation is centralized in tools/preview-generator-v2/controls/AccordionSection.js.
21+
- Search found no Preview Generator V2 use of accordionV2.js, mountAccordionV2, or setAccordionV2Open.
22+
- The remaining classList.toggle result outside AccordionSection is PreviewGeneratorV2ShellControl fullscreen/header behavior, not accordion behavior.
23+
- No inline accordion logic was added.
24+
25+
Playwright coverage added
26+
- Asserts the tool has exactly 9 accordion headers.
27+
- Asserts all 9 accordion headers have data-accordion-v2-bound="true" after Preview Generator V2 initializes.
28+
- Adds Last Generated Image to the all-sections collapse/expand coverage.
29+
- Existing coverage continues to verify:
30+
- shared icon open/closed state.
31+
- content hidden/visible state.
32+
- Paths or IDs flex/stretch behavior when expanded.
33+
- Paths or IDs header-only behavior when collapsed.
34+
- Output Summary and Status right-column accordion behavior.
35+
36+
Validation
37+
- node --check tests/playwright/PreviewGeneratorV2Baseline.spec.mjs passed.
38+
- npm run test:workspace-v2 passed.
39+
- Result: 3 passed.
40+
- Confirmed no samples, schemas, or start_of_day changes.
41+
42+
Full samples smoke test
43+
- Skipped intentionally.
44+
- Reason: this PR is a targeted Preview Generator V2 accordion consistency/test pass and does not modify sample JSON, sample launch code, or shared sample runtime behavior.
45+
46+
Manual validation
47+
- Open tools/preview-generator-v2/index.html.
48+
- Toggle Target Source, Asset Folder, Capture Mode, Render Controls, Paths or IDs, Last Generated Image, Output Summary, and Status.
49+
- Confirm each section collapses/expands with the same icon/open-state behavior.
50+
- Confirm Paths or IDs still stretches when reopened.

tests/playwright/PreviewGeneratorV2Baseline.spec.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ test.describe("Preview Generator V2 baseline", () => {
302302
expect(pathsLayout.resize).toBe("none");
303303
expect(pathsLayout.contentHeight - pathsLayout.inputHeight).toBeLessThan(40);
304304
expect(pathsLayout.contentWidth - pathsLayout.inputWidth).toBeLessThan(40);
305+
await expect(page.locator(".accordion-v2__header")).toHaveCount(9);
306+
await expect(page.locator('.accordion-v2__header[data-accordion-v2-bound="true"]')).toHaveCount(9);
305307
await expectPathsOrIdsAccordionToggles(page);
306308

307309
await page.locator("#pickRepoBtn").click();
@@ -317,6 +319,7 @@ test.describe("Preview Generator V2 baseline", () => {
317319
"assetFolderContent",
318320
"captureModeContent",
319321
"renderControlsContent",
322+
"lastGeneratedImageContent",
320323
"outputSummaryContent",
321324
"statusAccordionContent"
322325
]) {

0 commit comments

Comments
 (0)