Build the new Bento Hub shell and browsing tiles

This commit is contained in:
Jonathan Sykes
2026-10-04 03:09:15 +08:00
parent 04b620e3c7
commit 838798ca9b
13 changed files with 337 additions and 81 deletions

View File

@@ -0,0 +1,12 @@
const test=require('node:test'),assert=require('node:assert/strict');
const {chromeClearance}=require('./bento-hub');
test('clearance follows the highest visible floating control, including safe area',()=>{
assert.equal(chromeClearance(844,[{visible:true,fixed:true,top:746,height:98},{visible:true,fixed:true,top:666,height:72},{visible:true,fixed:true,top:602,height:56}]),258);
});
test('hidden and scrolling content cannot reserve fullscreen bottom space',()=>{
assert.equal(chromeClearance(844,[{visible:false,fixed:true,top:602,height:56},{visible:true,fixed:false,top:500,height:100},{visible:true,fixed:true,top:0,height:64}]),16);
});
test('desktop mini player reserves its real height and margin; no chrome is 16px',()=>{
assert.equal(chromeClearance(844,[{visible:true,fixed:true,top:760,height:72}]),100);
assert.equal(chromeClearance(844,[]),16);
});