fix: bound the bottom dock so the expanded default workspace cannot leak

The dock was an unbounded flex item: a long default-workspace session list
grew past the sidebar, got clipped by the root, and a partial row showed
through at the edge. The dock is now a capped, opaque, self-clipping panel
with its expanded session list in its own scroll area, so the workspace row
stays put and every row is either fully shown or scrolled.
This commit is contained in:
qyh15 2026-10-28 20:38:25 +08:00
parent 5544f82ccd
commit a97644d08c
6 changed files with 78 additions and 46 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1651,23 +1651,25 @@ export function GroupsBrowser({
: {})}
onManageFolders={() => { setFoldersTarget(defaultBarNode.workspaceId) }}
/>
<WorkspaceSubtree
workspace={defaultBarNode}
current={current}
now={now}
t={t}
animate={dragging === null}
onOpen={open}
onSessionRename={onSessionRename}
onSessionArchive={onSessionArchive}
onFork={forkSession}
onToggleFolder={toggleFolder}
onFolderNewSession={startSessionInFolder}
onFolderSetRoot={setFolderRoot}
onFolderRemove={removeFolderFrom}
onOpenFolderPath={openFolderPath}
creatingFolderKey={creatingSessionIn}
/>
<div className="wgDockSessions">
<WorkspaceSubtree
workspace={defaultBarNode}
current={current}
now={now}
t={t}
animate={dragging === null}
onOpen={open}
onSessionRename={onSessionRename}
onSessionArchive={onSessionArchive}
onFork={forkSession}
onToggleFolder={toggleFolder}
onFolderNewSession={startSessionInFolder}
onFolderSetRoot={setFolderRoot}
onFolderRemove={removeFolderFrom}
onOpenFolderPath={openFolderPath}
creatingFolderKey={creatingSessionIn}
/>
</div>
</div>
)}
</div>

View File

@ -88,26 +88,32 @@
overflow-y:auto;
}
/* Pinned default workspace: a sibling of the tree's scroll area, never inside
it — a long session list scrolls above this bar and can neither push it away
nor scroll it out. The divider separates the two zones. */
/* Bottom dock: the "not classified yet" bucket and the Host default workspace
sit outside the tree's scroll area, so a long session list can never push
them away. The dock owns the divider against the tree; the default-workspace
bar adds a second one only when the bucket sits above it. */
bar adds a second one only when the bucket sits above it.
The dock is a bounded, opaque panel: it may shrink (never grow past its cap),
clips its own overflow, and scrolls its expanded session list internally — so
an expanded default workspace can never be cut off mid-row by the sidebar's
bottom edge, and nothing from the tree ever shows through it. */
.wgDock {
flex:none;
flex:0 1 auto;
min-width:0;
min-height:0;
max-height:min(62vh,560px);
display:flex;
flex-direction:column;
overflow:hidden;
border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f47);
background:var(--dsw-bg-1,transparent);
}
/* The docked bucket scrolls on its own and never grows past a fixed share of
the sidebar: a big "not classified yet" pile must not swallow the tree. */
.wgDockBucket {
flex:none;
flex:0 1 auto;
min-width:0;
min-height:0;
max-height:min(240px,38vh);
padding:4px 8px 0;
overflow-x:hidden;
@ -123,12 +129,25 @@
}
.wgDefaultWorkspaceBar {
flex:none;
flex:1 1 auto;
min-width:0;
min-height:0;
display:flex;
flex-direction:column;
padding:6px 8px 8px;
}
/* The workspace row stays put; its expanded sessions scroll under it. */
.wgDockSessions {
flex:1 1 auto;
min-width:0;
min-height:0;
overflow-x:hidden;
overflow-y:auto;
}
.wgDefaultWorkspaceBar .wgProjectRow {
flex:none;
margin-bottom:2px;
}

View File

@ -59,11 +59,16 @@ const block = (selector) => {
return css.slice(start, css.indexOf('}', start))
}
assert.match(block('.wgDock'), /border-top:1px solid/, 'the dock draws the divider against the tree')
assert.match(block('.wgDock'), /flex:none/, 'the dock never scrolls with the tree')
assert.match(block('.wgDock'), /max-height:min\(62vh,560px\)/, 'the dock is capped so the tree always keeps room')
assert.match(block('.wgDock'), /overflow:hidden/, 'the dock clips its own overflow instead of painting over the tree')
assert.match(block('.wgDock'), /background:var\(--dsw-bg-1,transparent\)/, 'the dock paints an opaque surface so nothing shows through')
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('.wgDockSessions'), /overflow-y:auto/, 'an expanded default workspace scrolls inside the dock')
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')
assert.doesNotMatch(block('.wgDefaultWorkspaceBar'), /border-top/, 'the bar itself no longer draws a duplicate divider')
assert.match(browser, /className="wgDockSessions"/, 'the expanded sessions are wrapped in the dock scroll area')
console.log('Dock contracts passed: bucket predicate, render wiring and stylesheet.')

View File

@ -61,13 +61,16 @@ assert.ok(!rule('.wgIconGrid').includes('max-height:'), 'the scroll box moved fr
// D. The bottom dock (not-classified bucket + pinned default workspace) is a
// sibling of the scrolling tree, so a long session list can never scroll it
// away. The dock owns the divider; the bucket scrolls inside a capped box.
// away. The dock is bounded and clips its own overflow; the bucket and the
// expanded default-workspace list scroll inside it.
const dock = rule('.wgDock')
assert.ok(dock.includes('border-top:'), 'the dock is separated from the tree')
assert.ok(dock.includes('flex:none;'), 'the dock must not be squeezed by the tree')
assert.ok(dock.includes('max-height:') && dock.includes('overflow:hidden;'), 'the dock is capped and clips its own overflow')
assert.ok(dock.includes('background:'), 'the dock paints an opaque surface')
const bucket = rule('.wgDockBucket')
assert.ok(bucket.includes('overflow-y:auto;') && bucket.includes('max-height:'), 'a long bucket scrolls on its own')
assert.ok(rule('.wgDefaultWorkspaceBar').includes('flex:none;'), 'the default-workspace row must not be squeezed by the tree')
assert.ok(rule('.wgDockSessions').includes('overflow-y:auto;'), 'an expanded default workspace scrolls inside the dock')
assert.ok(rule('.wgDefaultWorkspaceBar .wgProjectRow').includes('flex:none;'), 'the default-workspace row itself never shrinks or scrolls')
// E. The markup backs the CSS: every row hands its rest-state label (member
// count or session time) AND its buttons to the one trailing slot, so both right