fix: give the dock regions their own share of the sidebar

The bucket and the expanded session list now stop growing at about a
quarter of the viewport each and scroll from there, so with the tree, the
bucket and the default workspace all expanded no single region can push the
other two out of view.
This commit is contained in:
qyh15 2026-10-28 20:55:01 +08:00
parent 932e652bad
commit 362e3e13fb
3 changed files with 8 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -118,7 +118,7 @@
flex:0 0 auto;
min-width:0;
min-height:0;
max-height:min(240px,38vh);
max-height:min(26vh,200px);
padding:4px 8px 0;
overflow-x:hidden;
overflow-y:auto;
@ -147,6 +147,10 @@
flex:1 1 auto;
min-width:0;
min-height:0;
/* A share of its own, not "whatever is left": with the tree and the bucket
also expanded, the session list stops growing at about a third of the
sidebar and scrolls instead of pushing the other two out of view. */
max-height:min(26vh,400px);
overflow-x:hidden;
overflow-y:auto;
}

View File

@ -68,8 +68,9 @@ assert.match(block('.wgDefaultWorkspaceBar'), /overflow:hidden/, 'the bar clips
assert.match(block('.wgDockBucket'), /flex:0 0 auto/, 'the bucket keeps its height so it can open its own children')
assert.match(block('.wgDockSessions'), /flex:1 1 auto/, 'only the session list gives up height')
assert.match(block('.wgDockBucket'), /overflow-y:auto/, 'a long bucket scrolls on its own')
assert.match(block('.wgDockBucket'), /max-height:min\(240px,38vh\)/, 'the bucket is capped so it cannot swallow the tree')
assert.match(block('.wgDockBucket'), /max-height:min\(26vh,200px\)/, 'the bucket has its own share and scrolls past it')
assert.match(block('.wgDockSessions'), /overflow-y:auto/, 'an expanded default workspace scrolls inside the dock')
assert.match(block('.wgDockSessions'), /max-height:min\(26vh,400px\)/, 'the session list keeps its own share instead of taking what is left')
assert.match(block('.wgDockSessions'), /min-height:0/, 'the session list may shrink so nothing is cut off mid-row')
assert.match(css, /\.wgDockBucket \+ \.wgDefaultWorkspaceBar \{[^}]*border-top:1px solid/, 'a separator sits between the bucket and the default-workspace row')
assert.match(css, /\.wgRail \.wgDock \{\s*display:none;/, 'the rail never shows the dock')