Merge pull request 'fix(sidebar): 修正 scrollport 选择器以命中 slot 包装层' (#3) from fix/sidebar-bottom-dock-2 into main

This commit is contained in:
QQ 2026-11-12 21:43:41 +08:00
commit a9d2f88263
3 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -17,13 +17,13 @@
right after the tree instead of pinned to the sidebar bottom. Only when our right after the tree instead of pinned to the sidebar bottom. Only when our
tree is mounted, give the workspace region the remaining row; the tree body tree is mounted, give the workspace region the remaining row; the tree body
then owns the scrolling and .wgDock stays outside it. */ then owns the scrolling and .wgDock stays outside it. */
[data-sidebar-scrollport]:has(> [class*="regionArea"] > .wgRoot) { [data-sidebar-scrollport]:has([class*="regionArea"] .wgRoot) {
grid-template-rows:8px max-content 2px minmax(0, 1fr); grid-template-rows:8px max-content 2px minmax(0, 1fr);
align-content:stretch; align-content:stretch;
overflow-y:hidden; overflow-y:hidden;
} }
[data-sidebar-scrollport] > [class*="regionArea"]:has(> .wgRoot) { [data-sidebar-scrollport] > [class*="regionArea"]:has(.wgRoot) {
min-height:0; min-height:0;
overflow:hidden; overflow:hidden;
} }

View File

@ -61,7 +61,8 @@ const block = (selector) => {
assert.match(block('.wgRoot'), /height:100%/, 'the root consumes the sidebar slot height') assert.match(block('.wgRoot'), /height:100%/, 'the root consumes the sidebar slot height')
assert.match(block('.wgRoot'), /max-height:100%/, 'the root cannot grow past its slot') assert.match(block('.wgRoot'), /max-height:100%/, 'the root cannot grow past its slot')
assert.match(block('.wgRoot'), /overflow:hidden/, 'the root clips instead of scrolling the whole sidebar') assert.match(block('.wgRoot'), /overflow:hidden/, 'the root clips instead of scrolling the whole sidebar')
assert.match(css, /\[data-sidebar-scrollport\]:has\(> \[class\*="regionArea"\] > \.wgRoot\)/, 'the host scrollport is claimed only when the tree is mounted') assert.match(css, /\[data-sidebar-scrollport\]:has\(\[class\*="regionArea"\] \.wgRoot\)/, 'the host scrollport is claimed only when the tree is mounted')
assert.match(css, /\[data-sidebar-scrollport\] > \[class\*="regionArea"\]:has\(\.wgRoot\)/, 'the workspace region is allowed to shrink below its content')
assert.match(css, /grid-template-rows:8px max-content 2px minmax\(0, 1fr\)/, 'the workspace region takes the remaining row instead of max-content') assert.match(css, /grid-template-rows:8px max-content 2px minmax\(0, 1fr\)/, 'the workspace region takes the remaining row instead of max-content')
assert.match(block('.wgDock'), /border-top:1px solid/, 'the dock draws the divider against the tree') assert.match(block('.wgDock'), /border-top:1px solid/, 'the dock draws the divider against 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'), /max-height:min\(62vh,560px\)/, 'the dock is capped so the tree always keeps room')