Round only exterior corners of docked editor panes

This commit is contained in:
Codex
2026-11-14 22:37:52 +03:00
parent 616ec9160a
commit 9a00d0bb06
7 changed files with 38 additions and 3 deletions
+18
View File
@@ -54,3 +54,21 @@ test('repeated dock and float transitions retain unique tools and tile the full
const free=dockEditorTool(state,'viewport',null,id,rect);assert.ok(!dockIds(free.tree).includes(id));assert.deepEqual(free.floating[id],rect);
}
});
import {editorDockCorners} from '../packages/ui-react/dist/editorDockCorners.js';
test('left stacked panels round only the outer top and bottom; close restores both corners',()=>{
const tree={axis:'x',ratio:25,first:{axis:'y',ratio:50,first:{id:'a'},second:{id:'b'}},second:{id:'viewport'}};
const r=dockRects(tree,bounds);
assert.equal(editorDockCorners(r.a,bounds),'top-left');assert.equal(editorDockCorners(r.b,bounds),'bottom-left');
assert.equal(editorDockCorners(r.viewport,bounds),'top-right bottom-right');
const remaining=dockRects(pruneDockTree(tree,['a','viewport']),bounds);
assert.equal(editorDockCorners(remaining.a,bounds),'top-left bottom-left');
});
test('top and bottom rows retain square seams at every size and canvas origin',()=>{
for(const position of ['top','bottom'])for(const area of [bounds,{left:80,top:45,width:713.5,height:528.3}]){
const first=dockEditorTool(start,'viewport',{activeId:'a',overId:'viewport',position,scope:'workspace'},'a',rect);
const split=dockEditorTool(first,'viewport',{activeId:'b',overId:'a',position:'right',scope:'panel'},'b',rect);
const r=dockRects(split.tree,area);
assert.equal(editorDockCorners(r.a,area),position+'-left');assert.equal(editorDockCorners(r.b,area),position+'-right');
}
});