Skip to content

Commit 8aa7588

Browse files
author
DavidQ
committed
Make Text to Speech V2 status log fill its accordion content - PR_26130_032-text-to-speech-v2-status-log-fill
1 parent f1581f9 commit 8aa7588

2 files changed

Lines changed: 54 additions & 2 deletions

File tree

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,50 @@ test.describe("Workspace Manager V2 bootstrap", () => {
12171217
await expect(page.locator("#text2speech-V2StopButton")).toBeDisabled();
12181218
await expect(page.locator("#text2speech-V2StatusLog")).toHaveValue(/OK Text to Speech V2 empty launch: no samplePresetPath URL JSON source, workspace payload, or imported JSON is loaded\. Use Import JSON or open a sample JSON source to load named speech items\./);
12191219
await expect(page.locator("#text2speech-V2StatusLog")).not.toHaveValue(/Text to Speech V2 default queue|Loaded 3 schema-complete/);
1220+
const statusLogLayout = await page.locator("#text2speech-V2StatusLogContent").evaluate((content) => {
1221+
const log = content.querySelector("#text2speech-V2StatusLog");
1222+
const contentRect = content.getBoundingClientRect();
1223+
const logRect = log.getBoundingClientRect();
1224+
const contentStyle = getComputedStyle(content);
1225+
const logStyle = getComputedStyle(log);
1226+
const paddingBottom = Number.parseFloat(contentStyle.paddingBottom || "0");
1227+
const paddingTop = Number.parseFloat(contentStyle.paddingTop || "0");
1228+
const innerHeight = content.clientHeight - paddingTop - paddingBottom;
1229+
return {
1230+
contentOverflowY: contentStyle.overflowY,
1231+
logFlexGrow: logStyle.flexGrow,
1232+
logHeight: Math.round(logRect.height),
1233+
logOverflowY: logStyle.overflowY,
1234+
logResize: logStyle.resize,
1235+
statusContentInnerHeight: Math.round(innerHeight),
1236+
unusedBottomSpace: Math.round(contentRect.bottom - logRect.bottom - paddingBottom)
1237+
};
1238+
});
1239+
expect(statusLogLayout).toMatchObject({
1240+
contentOverflowY: "hidden",
1241+
logFlexGrow: "1",
1242+
logOverflowY: "auto",
1243+
logResize: "none"
1244+
});
1245+
expect(statusLogLayout.logHeight).toBeGreaterThanOrEqual(statusLogLayout.statusContentInnerHeight - 2);
1246+
expect(statusLogLayout.unusedBottomSpace).toBeLessThanOrEqual(2);
1247+
const statusLogScrollState = await page.locator("#text2speech-V2StatusLog").evaluate((log) => {
1248+
const pageHadScrollbarBefore = document.documentElement.scrollHeight > document.documentElement.clientHeight;
1249+
log.value = Array.from({ length: 80 }, (_, index) => `OK Status log overflow probe ${index + 1}`).join("\n");
1250+
log.scrollTop = log.scrollHeight;
1251+
return {
1252+
internalScrollHeight: log.scrollHeight,
1253+
pageHasScrollbarAfter: document.documentElement.scrollHeight > document.documentElement.clientHeight,
1254+
pageHadScrollbarBefore,
1255+
statusHasInternalScrollbar: log.scrollHeight > log.clientHeight,
1256+
statusScrolledInternally: log.scrollTop > 0
1257+
};
1258+
});
1259+
expect(statusLogScrollState.statusHasInternalScrollbar).toBe(true);
1260+
expect(statusLogScrollState.statusScrolledInternally).toBe(true);
1261+
expect(statusLogScrollState.pageHadScrollbarBefore).toBe(false);
1262+
expect(statusLogScrollState.pageHasScrollbarAfter).toBe(false);
1263+
await page.locator("#text2speech-V2ClearStatusButton").click();
12201264
const emptySummary = JSON.parse(await page.locator("#text2speech-V2SpeechSummary").textContent());
12211265
expect(emptySummary).toEqual([]);
12221266
await page.locator("#text2speech-V2AddItemButton").click();

tools/text2speech-V2/styles/text2speech-V2.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ body.tools-platform-tool-page[data-tool-id="text2speech-V2"] > .palette-manager-
306306
overflow: auto;
307307
}
308308

309+
#text2speech-V2StatusLogContent {
310+
min-height: 0;
311+
overflow: hidden;
312+
}
313+
309314
.text2speech-V2__queue-tile {
310315
min-height: 82px;
311316
display: grid;
@@ -356,9 +361,12 @@ body.tools-platform-tool-page[data-tool-id="text2speech-V2"] > .palette-manager-
356361
}
357362

358363
#text2speech-V2StatusLog {
359-
min-height: 180px;
364+
flex: 1 1 auto;
365+
height: 100%;
366+
min-height: 0;
367+
overflow: auto;
360368
padding: 10px;
361-
resize: vertical;
369+
resize: none;
362370
}
363371

364372
.text2speech-V2__status-accordion-header {

0 commit comments

Comments
 (0)