将分层反馈强化版提升为正式 main,统一协作入口并移除外部构建路径

This commit is contained in:
toshiocn
2026-10-23 11:04:37 +08:00
parent 83e2e40269
commit a156e8b5c6
173 changed files with 1181 additions and 498 deletions
@@ -29,16 +29,16 @@ test('legacy saves, malformed data and full completion have valid startup target
assert.deepEqual(validResumePath(levels[0],['missing'],canAppend),[]);
for(const value of ['broken','{}','{"version":1,"levelId":"missing","path":[]}']){const ui=boot(new Map([[RESUME_KEY,value]]));assert.equal(ui.api.snapshot().screen,'play');assert.equal(ui.api.snapshot().displayOrder,1);}
});
test('chapter pages expose at most ten cards and fit phone safe areas',()=>{
test('selection pages expose fifteen cards and fit phone safe areas',()=>{
for(const [w,h]of [[320,568],[375,667],[390,844],[414,896]]){
const ui=boot(new Map(),w,h);closeRules(ui);ui.button('选关');
for(let chapter=1;chapter<=20;chapter++){
const cards=ui.api.buttons().filter(b=>/^\d+( ✓)?$/.test(b.label));assert.equal(cards.length,10);assert.equal(ui.api.snapshot().selection.chapter,chapter);
for(let chapter=1;chapter<=14;chapter++){
const cards=ui.api.buttons().filter(b=>/^\d+( ✓)?$/.test(b.label));assert.equal(cards.length,chapter===14?5:15);assert.equal(ui.api.snapshot().selection.chapter,chapter);
for(const b of cards){assert.ok(b.w>=44&&b.h>=44);assert.ok(b.x>=0&&b.x+b.w<=w&&b.y+b.h<h-34-106);}
const layout=chapterLayout(w,h,92,34);assert.ok(layout.h>=44);
if(chapter<20)ui.button('下一页');
if(chapter<14)ui.button('下一页');
}
ui.button('200');closeRules(ui);ui.button('选关');assert.equal(ui.api.snapshot().selection.chapter,20);assert.ok(ui.api.buttons().some(b=>b.label==='200'));
ui.button('200');closeRules(ui);ui.button('选关');assert.equal(ui.api.snapshot().selection.chapter,14);assert.ok(ui.api.buttons().some(b=>b.label==='200'));
}
});
test('hint-only frames reuse static UI, and player input invalidates it',()=>{