Refine project column scrolling

This commit is contained in:
2026-07-20 12:04:36 +08:00
parent 443a9feaac
commit fd8d188f29
2 changed files with 16 additions and 2 deletions

View File

@@ -89,6 +89,9 @@ const collectMetrics = async () => page.evaluate(() => {
verticalGaps, verticalGaps,
projectRailOverflow: overflowState(rail), projectRailOverflow: overflowState(rail),
projectRailChildrenOverflow: overflowState(railChildren), projectRailChildrenOverflow: overflowState(railChildren),
channelSidebarOverflow: overflowState(sidebar),
stageOverflow: overflowState(stage),
inspectorOverflow: overflowState(inspector),
overflowX: document.documentElement.scrollWidth > document.documentElement.clientWidth, overflowX: document.documentElement.scrollWidth > document.documentElement.clientWidth,
viewportWidth: window.innerWidth, viewportWidth: window.innerWidth,
} }
@@ -213,6 +216,15 @@ if (!projectMetrics.projectRail || !projectMetrics.channelSidebar || !projectMet
failures.push(`expected inspector to end at viewport right edge, got inspector.right=${projectMetrics.inspector.right}, viewport=${projectMetrics.viewportWidth}`) failures.push(`expected inspector to end at viewport right edge, got inspector.right=${projectMetrics.inspector.right}, viewport=${projectMetrics.viewportWidth}`)
} }
} }
for (const [name, overflow] of [
['channel sidebar', projectMetrics.channelSidebarOverflow],
['stage', projectMetrics.stageOverflow],
['inspector', projectMetrics.inspectorOverflow],
]) {
if (!overflow || overflow.overflowX !== 'hidden' || overflow.overflowY !== 'auto') {
failures.push(`expected ${name} to hide horizontal scrollbars and show vertical scrollbars only when needed, got ${JSON.stringify(overflow)}`)
}
}
if (failures.length) { if (failures.length) {
throw new Error(failures.join('\n')) throw new Error(failures.join('\n'))

View File

@@ -350,7 +350,8 @@
.channel-sidebar { .channel-sidebar {
min-height: 0; min-height: 0;
overflow: auto; overflow-x: hidden;
overflow-y: auto;
padding: 16px; padding: 16px;
border-right: 1px solid var(--senlin-border); border-right: 1px solid var(--senlin-border);
background: var(--senlin-panel); background: var(--senlin-panel);
@@ -549,7 +550,8 @@
.inspector { .inspector {
min-height: 0; min-height: 0;
overflow: auto; overflow-x: hidden;
overflow-y: auto;
padding: 0 16px 16px; padding: 0 16px 16px;
border-left: 1px solid var(--senlin-border); border-left: 1px solid var(--senlin-border);
background: var(--senlin-panel); background: var(--senlin-panel);