Skip to content

Commit b62ad42

Browse files
committed
Move MIDI Studio V2 status and accordion actions into headers - PR_26146_006-midi-studio-v2-header-actions-layout
1 parent 37aa63a commit b62ad42

3 files changed

Lines changed: 78 additions & 3 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# PR_26146_006-midi-studio-v2-header-actions-layout Validation
2+
3+
## Scope
4+
5+
- Continued from PR_26146_005.
6+
- Updated MIDI Studio V2 Status section markup so the Clear button lives inside the Status header without nesting a button inside another button.
7+
- Preserved existing accordion behavior and status logging behavior.
8+
- Preserved MIDI parsing, playback contract, source inspection behavior, and manifest schema.
9+
10+
## Layout Contract
11+
12+
- Status Clear is inside the Status header.
13+
- Accordion expand/collapse icons are inside their section headers.
14+
- Close/X controls are validated to be header-scoped where present; MIDI Studio V2 currently has no separate close/X panel controls.
15+
- No duplicated or floating Status Clear action rows exist under the Status content.
16+
- Left panel remains setup/input, center remains primary work surface, and right panel remains output/status/logging/diagnostics.
17+
18+
## Validation
19+
20+
- PASS: `node --check tests/playwright/tools/MidiStudioV2.spec.mjs`
21+
- PASS: MIDI Studio V2 HTML inline scan found no inline `<script>`, `<style>`, or inline event handlers.
22+
- PASS: `npx.cmd playwright test tests/playwright/tools/MidiStudioV2.spec.mjs --project=playwright --workers=1 --reporter=line`
23+
- PASS: `git diff --check`
24+
25+
## Playwright Coverage
26+
27+
- PASS: Status Clear is located inside the Status header.
28+
- PASS: Status Clear is not duplicated under the Status content panel.
29+
- PASS: accordion +/- controls are located inside section headers.
30+
- PASS: close/X placement is validated where such controls exist.
31+
- PASS: Clear still clears status/log content and does not collapse the Status accordion.
32+
- PASS: Status and Source accordions still open and close correctly.
33+
- PASS: existing MIDI source inspection tests still pass.
34+
35+
## Explicit Skips
36+
37+
- SKIP: Workspace Manager V2 registration/handoff test because Workspace Manager files were not touched.
38+
- SKIP: full samples smoke test because sample JSON alignment is out of scope.

tests/playwright/tools/MidiStudioV2.spec.mjs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,50 @@ test.describe("MIDI Studio V2", () => {
281281
}
282282
});
283283

284-
test("keeps the Status Clear action aligned with MIDI Studio status layout", async ({ page }) => {
284+
test("keeps header actions inside section headers", async ({ page }) => {
285285
const server = await openMidiStudio(page);
286286
try {
287287
const clearButton = page.locator("#clearStatusButton");
288+
await expect(clearButton.locator("xpath=ancestor::*[contains(concat(' ', normalize-space(@class), ' '), ' accordion-v2__header ')][1]")).toHaveAttribute("aria-controls", "statusLogContent");
289+
await expect(page.locator("#statusLogContent #clearStatusButton")).toHaveCount(0);
290+
await expect(page.locator(".accordion-v2__header #clearStatusButton")).toHaveCount(1);
288291
await expect(clearButton).toHaveClass(/midi-studio-v2__status-clear-button/);
289292
await expect(clearButton).toHaveCSS("padding-left", "0px");
290293
await expect(clearButton).toHaveCSS("padding-right", "0px");
294+
expect(await page.locator(".accordion-v2").evaluateAll((sections) => sections.every((section) => {
295+
const header = section.querySelector(".accordion-v2__header");
296+
const icon = section.querySelector(".accordion-v2__icon");
297+
return Boolean(header && icon && header.contains(icon));
298+
}))).toBe(true);
299+
expect(await page.locator("body").evaluate((body) => Array.from(body.querySelectorAll('[aria-label*="close" i], [title*="close" i], [data-close], .tool-starter__close-button')).every((control) => Boolean(control.closest(".accordion-v2__header, .tools-platform-frame__accordion-summary, .is-collapsible__summary"))))).toBe(true);
300+
} finally {
301+
await workspaceV2CoverageReporter.stop(page);
302+
await server.close();
303+
}
304+
});
305+
306+
test("clears status content and preserves accordion open close behavior", async ({ page }) => {
307+
const server = await openMidiStudio(page);
308+
try {
309+
const statusHeader = page.locator('.accordion-v2__header[aria-controls="statusLogContent"]');
310+
await expect(page.locator("#statusLog")).toHaveValue(/OK Loaded 3 MIDI songs/);
311+
await page.locator("#clearStatusButton").click();
312+
await expect(page.locator("#statusLog")).toHaveValue("");
313+
await expect(statusHeader).toHaveAttribute("aria-expanded", "true");
314+
await expect(page.locator("#statusLogContent")).toBeVisible();
315+
await statusHeader.click();
316+
await expect(statusHeader).toHaveAttribute("aria-expanded", "false");
317+
await expect(page.locator("#statusLogContent")).toBeHidden();
318+
await statusHeader.click();
319+
await expect(statusHeader).toHaveAttribute("aria-expanded", "true");
320+
await expect(page.locator("#statusLogContent")).toBeVisible();
321+
const sourceHeader = page.locator('.accordion-v2__header[aria-controls="songSourceContent"]');
322+
await sourceHeader.click();
323+
await expect(sourceHeader).toHaveAttribute("aria-expanded", "false");
324+
await expect(page.locator("#songSourceContent")).toBeHidden();
325+
await sourceHeader.click();
326+
await expect(sourceHeader).toHaveAttribute("aria-expanded", "true");
327+
await expect(page.locator("#songSourceContent")).toBeVisible();
291328
} finally {
292329
await workspaceV2CoverageReporter.stop(page);
293330
await server.close();

tools/midi-studio-v2/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ <h2 class="tools-platform-frame__eyebrow">First-Class Tools Surface V2</h2>
154154
</section>
155155

156156
<section class="accordion-v2 tool-starter__accordion is-open" data-accordion-v2-open="true">
157-
<button class="accordion-v2__header tool-starter__status-accordion-header" type="button" aria-expanded="true" aria-controls="statusLogContent">
157+
<div class="accordion-v2__header tool-starter__status-accordion-header" aria-expanded="true" aria-controls="statusLogContent">
158158
<span>Status</span>
159159
<div class="tool-starter__status-header-actions">
160160
<button id="clearStatusButton" class="tool-starter__status-clear-button midi-studio-v2__status-clear-button" type="button">Clear</button>
161161
<span class="accordion-v2__icon" aria-hidden="true">+</span>
162162
</div>
163-
</button>
163+
</div>
164164
<div id="statusLogContent" class="accordion-v2__content">
165165
<textarea id="statusLog" readonly rows="10" aria-label="MIDI Studio V2 status log"></textarea>
166166
</div>

0 commit comments

Comments
 (0)