From 7486ec79ac424f5680739509e27a54eaadb5f055 Mon Sep 17 00:00:00 2001 From: sudacode Date: Sat, 22 Aug 2026 16:10:19 -0700 Subject: [PATCH] fix(overlay): show all secondary subtitle lines - Remove the secondary subtitle height and overflow clipping - Update coverage to allow long subtitle stacks --- changes/remove-secondary-subtitle-display-limit.md | 4 ++++ src/renderer/style.css | 4 ---- src/renderer/subtitle-render.test.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 changes/remove-secondary-subtitle-display-limit.md diff --git a/changes/remove-secondary-subtitle-display-limit.md b/changes/remove-secondary-subtitle-display-limit.md new file mode 100644 index 00000000..38d8c7f8 --- /dev/null +++ b/changes/remove-secondary-subtitle-display-limit.md @@ -0,0 +1,4 @@ +type: fixed +area: overlay + +- Secondary subtitle overlays now show every rendered line instead of clipping text after roughly four lines. diff --git a/src/renderer/style.css b/src/renderer/style.css index f1aa7704..e4977cdc 100644 --- a/src/renderer/style.css +++ b/src/renderer/style.css @@ -1928,10 +1928,6 @@ body.layer-modal #overlay { text-align: center; font-size: 24px; line-height: 1.5; - /* Backstop: pathological tracks (karaoke typesetting, sign spam) must never grow - the hover-pause band beyond a top strip. ~4 lines at line-height 1.5. */ - max-height: 6em; - overflow: hidden; color: #ffffff; -webkit-text-stroke: 0.45px rgba(0, 0, 0, 0.7); paint-order: stroke fill; diff --git a/src/renderer/subtitle-render.test.ts b/src/renderer/subtitle-render.test.ts index 64a645e8..375e4b8f 100644 --- a/src/renderer/subtitle-render.test.ts +++ b/src/renderer/subtitle-render.test.ts @@ -1490,13 +1490,13 @@ test('prepareSecondarySubtitleLines strips ASS override tags and handles empty i assert.deepEqual(prepareSecondarySubtitleLines('{\\an8}'), []); }); -test('secondary subtitle root CSS caps height so hover-pause band stays a top strip', () => { +test('secondary subtitle root CSS does not clip long subtitle stacks', () => { const srcCssPath = path.join(process.cwd(), 'src', 'renderer', 'style.css'); const cssText = fs.readFileSync(srcCssPath, 'utf-8'); const secondaryRootBlock = extractClassBlock(cssText, '#secondarySubRoot'); - assert.match(secondaryRootBlock, /max-height:\s*6em;/); - assert.match(secondaryRootBlock, /overflow:\s*hidden;/); + assert.doesNotMatch(secondaryRootBlock, /max-height\s*:/); + assert.doesNotMatch(secondaryRootBlock, /overflow\s*:\s*hidden/); }); test('applySubtitleStyle sets known-word maturity color variables', () => {