Keep Glass Stage section navigation and panel content clear of playback chrome

This commit is contained in:
Jonathan Sykes
2026-10-03 21:45:34 +08:00
parent d3f5133572
commit 3c0adb2577
7 changed files with 166 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
const { test } = require('node:test');
const assert = require('node:assert/strict');
const { bottomClearance } = require('./glass-panel-layout.js');
test('clearance covers stacked floating chrome and includes its viewport inset once', () => {
assert.equal(bottomClearance(844, [{ fixed: true, top: 740, bottom: 844, height: 104 }, { fixed: true, top: 668, bottom: 732, height: 64 }]), 192);
assert.equal(bottomClearance(844, [{ fixed: true, top: 740, bottom: 844, height: 104 }]), 120);
});
test('hidden, nonfixed and offscreen elements do not reserve chrome space', () => {
assert.equal(bottomClearance(844, [{ fixed: true, top: 740, bottom: 844, height: 0 }, { fixed: false, top: 668, bottom: 732, height: 64 }, { fixed: true, top: 900, bottom: 964, height: 64 }]), 0);
});