Skip to content

Commit 79525fa

Browse files
committed
Balance Audio SFX right panel layout and simplify Wave Preview - PR_26144_007-audio-sfx-balanced-right-panel-layout
1 parent 29f9189 commit 79525fa

4 files changed

Lines changed: 102 additions & 42 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Audio / SFX Playground V2 Balanced Right Panel Validation
2+
3+
PR: `PR_26144_007-audio-sfx-balanced-right-panel-layout`
4+
5+
## Scope
6+
7+
- Updated only `tools/audio-sfx-playground-v2` plus required reports.
8+
- Removed visible Wave Preview metadata text:
9+
- sound name
10+
- waveform/frequency/duration/sweep summary
11+
- preview tags
12+
- Kept Wave Preview visual-only by rendering only the meter bars for valid sounds.
13+
- Replaced the initial preview fallback text with an empty visual preview shell.
14+
- Updated right-column accordion flex behavior so Wave Preview, Output Summary, and Status share height evenly.
15+
- Prevented the preview accordion from keeping the prior fixed-height bias.
16+
- Did not modify `start_of_day` folders.
17+
18+
## Static Validation
19+
20+
PASS:
21+
22+
- HTML/CSS/static preview validation:
23+
- no `<style>` blocks
24+
- no inline event handlers
25+
- no script tags without `src`
26+
- linked stylesheets resolve
27+
- CSS braces are balanced
28+
- preview renderer no longer emits metadata text
29+
- HTML preview fallback no longer contains visible fallback text
30+
- Audio / SFX Playground V2 JavaScript syntax check:
31+
- `node --check` over `tools/audio-sfx-playground-v2/js/**/*.js`
32+
- Changed runtime module import check:
33+
- `SfxPreviewControl.js`
34+
- Whitespace validation:
35+
- `git diff --check -- tools/audio-sfx-playground-v2`
36+
- JSON validation:
37+
- No JSON files changed in this PR.
38+
39+
## Playwright Impact
40+
41+
Playwright impacted: Yes.
42+
43+
Expected validation:
44+
45+
- Workspace V2 launches Audio / SFX Playground V2 with no console errors.
46+
- Wave Preview shows only the visual meter bars for a valid sound.
47+
- Wave Preview does not show sound name text.
48+
- Wave Preview does not show waveform/frequency/duration/sweep summary text.
49+
- Right-column panels for Wave Preview, Output Summary, and Status share available vertical space evenly/flexibly.
50+
- No right-column panel consumes most of the column height.
51+
- No clipping or overflow regression appears in the right column.
52+
53+
Local command results:
54+
55+
- `npm run test:workspace-v2`
56+
- FAIL: PowerShell blocked `npm.ps1` because script execution is disabled on this system.
57+
- `npm.cmd run test:workspace-v2`
58+
- FAIL: package script started, but `playwright` is not installed or not available on PATH.
59+
60+
Because Playwright is unavailable in this local environment, browser launch validation and V8 coverage could not be completed here.
61+
62+
## Coverage
63+
64+
WARN: Runtime JavaScript changed, but Playwright V8 coverage could not be generated because the local Playwright command is unavailable.
65+
66+
- `(WARN) tools/audio-sfx-playground-v2/js/controls/SfxPreviewControl.js - Playwright unavailable`
67+
68+
## Full Samples Smoke Test
69+
70+
Skipped. This PR only adjusts Audio / SFX Playground V2 layout behavior.

tools/audio-sfx-playground-v2/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ <h2 class="tools-platform-frame__eyebrow">First-Class Tools Surface V2</h2>
138138
</button>
139139
<div id="previewPanelContent" class="accordion-v2__content">
140140
<div id="previewOutput" class="tool-starter__preview audio-sfx__preview" role="img" aria-label="SFX envelope and waveform preview">
141-
<p>No preview rendered yet.</p>
141+
<div class="tool-starter__preview-card audio-sfx__preview-empty" aria-hidden="true"></div>
142142
</div>
143143
</div>
144144
</section>

tools/audio-sfx-playground-v2/js/controls/SfxPreviewControl.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,17 @@ export class SfxPreviewControl {
2020
this.output = output;
2121
}
2222

23-
clear(message = "No preview rendered yet.") {
24-
const emptyState = document.createElement("p");
25-
emptyState.textContent = message;
23+
clear() {
24+
const emptyState = document.createElement("div");
25+
emptyState.className = "tool-starter__preview-card audio-sfx__preview-empty";
26+
emptyState.setAttribute("aria-hidden", "true");
2627
this.output.replaceChildren(emptyState);
2728
}
2829

2930
render(sound) {
3031
const card = document.createElement("article");
3132
card.className = "tool-starter__preview-card";
3233

33-
const title = document.createElement("h2");
34-
title.textContent = sound.name;
35-
36-
const summary = document.createElement("p");
37-
summary.textContent = `${sound.waveform}, ${sound.frequencyHz} Hz, ${sound.durationMs} ms, ${sound.pitchSweepCents} cents`;
38-
3934
const bars = document.createElement("div");
4035
bars.className = "tool-starter__meter-bars";
4136
bars.setAttribute("aria-hidden", "true");
@@ -45,15 +40,7 @@ export class SfxPreviewControl {
4540
bars.append(bar);
4641
}
4742

48-
const tags = document.createElement("div");
49-
tags.className = "tool-starter__preview-tags";
50-
[sound.noise ? "noise transient" : "oscillator only", `volume ${sound.volume.toFixed(2)}`].forEach((label) => {
51-
const tag = document.createElement("span");
52-
tag.textContent = label;
53-
tags.append(tag);
54-
});
55-
56-
card.append(title, summary, bars, tags);
43+
card.append(bars);
5744
this.output.replaceChildren(card);
5845
}
5946
}

tools/audio-sfx-playground-v2/styles/audioSfxLayoutDensity.css

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -142,49 +142,52 @@ body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__tile span {
142142
font-size: 0.88rem;
143143
}
144144

145-
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview-accordion {
146-
flex: 0 0 auto;
145+
body[data-tool-id="audio-sfx-playground-v2"] .tool-starter__panel--right {
146+
overflow: hidden;
147147
}
148148

149-
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview-accordion .accordion-v2__content {
150-
flex: 0 0 auto;
149+
body[data-tool-id="audio-sfx-playground-v2"] .tool-starter__panel--right > .accordion-v2 {
150+
flex: 1 1 0;
151+
min-height: 0;
152+
}
153+
154+
body[data-tool-id="audio-sfx-playground-v2"] .tool-starter__panel--right > .accordion-v2.is-open {
155+
flex: 1 1 0;
156+
}
157+
158+
body[data-tool-id="audio-sfx-playground-v2"] .tool-starter__panel--right .accordion-v2__content {
159+
flex: 1 1 auto;
160+
min-height: 0;
161+
overflow: auto;
151162
}
152163

153164
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview {
154-
min-height: 176px;
165+
height: 100%;
166+
min-height: 0;
155167
padding: 10px;
156168
}
157169

158170
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview .tool-starter__preview-card {
171+
height: 100%;
172+
min-height: 0;
159173
width: 100%;
174+
display: flex;
175+
flex-direction: column;
160176
padding: 12px;
161177
}
162178

163-
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview .tool-starter__preview-card h2 {
164-
font-size: 1rem;
165-
}
166-
167-
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview .tool-starter__preview-card p {
168-
margin-top: 5px;
169-
font-size: 0.84rem;
179+
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview .audio-sfx__preview-empty {
180+
border-style: dashed;
170181
}
171182

172183
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview .tool-starter__meter-bars {
173-
min-height: 86px;
184+
min-height: 0;
185+
flex: 1 1 auto;
174186
gap: 3px;
175-
margin-top: 8px;
187+
margin-top: 0;
176188
padding: 6px;
177189
}
178190

179191
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview .tool-starter__meter-bars span {
180192
max-height: 86px;
181193
}
182-
183-
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview .tool-starter__preview-tags {
184-
gap: 6px;
185-
margin-top: 8px;
186-
}
187-
188-
body[data-tool-id="audio-sfx-playground-v2"] .audio-sfx__preview .tool-starter__preview-tags span {
189-
padding: 3px 6px;
190-
}

0 commit comments

Comments
 (0)