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,
projectRailOverflow: overflowState(rail),
projectRailChildrenOverflow: overflowState(railChildren),
channelSidebarOverflow: overflowState(sidebar),
stageOverflow: overflowState(stage),
inspectorOverflow: overflowState(inspector),
overflowX: document.documentElement.scrollWidth > document.documentElement.clientWidth,
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}`)
}
}
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) {
throw new Error(failures.join('\n'))