Hide React prototype project rail scrollbars
This commit is contained in:
@@ -34,6 +34,7 @@ const metrics = await page.evaluate(() => {
|
|||||||
const statusbar = document.querySelector('.statusbar')
|
const statusbar = document.querySelector('.statusbar')
|
||||||
const search = document.querySelector('.global-search')
|
const search = document.querySelector('.global-search')
|
||||||
const rail = document.querySelector('.project-rail')
|
const rail = document.querySelector('.project-rail')
|
||||||
|
const railChildren = rail?.querySelector('.arco-layout-sider-children')
|
||||||
const dashboard = document.querySelector('.dashboard-button')
|
const dashboard = document.querySelector('.dashboard-button')
|
||||||
const project = document.querySelector('.project-button')
|
const project = document.querySelector('.project-button')
|
||||||
const create = document.querySelector('.create-project')
|
const create = document.querySelector('.create-project')
|
||||||
@@ -52,6 +53,16 @@ const metrics = await page.evaluate(() => {
|
|||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
const verticalGaps = itemRects.slice(1).map((item, index) => item.top - (itemRects[index].top + itemRects[index].height))
|
const verticalGaps = itemRects.slice(1).map((item, index) => item.top - (itemRects[index].top + itemRects[index].height))
|
||||||
|
const overflowState = (node) => node
|
||||||
|
? {
|
||||||
|
clientWidth: node.clientWidth,
|
||||||
|
scrollWidth: node.scrollWidth,
|
||||||
|
clientHeight: node.clientHeight,
|
||||||
|
scrollHeight: node.scrollHeight,
|
||||||
|
overflowX: getComputedStyle(node).overflowX,
|
||||||
|
overflowY: getComputedStyle(node).overflowY,
|
||||||
|
}
|
||||||
|
: null
|
||||||
|
|
||||||
return {
|
return {
|
||||||
statusbarHeight: statusbar?.getBoundingClientRect().height,
|
statusbarHeight: statusbar?.getBoundingClientRect().height,
|
||||||
@@ -63,6 +74,8 @@ const metrics = await page.evaluate(() => {
|
|||||||
firstProjectBadge: rect(firstBadge),
|
firstProjectBadge: rect(firstBadge),
|
||||||
horizontalInsets,
|
horizontalInsets,
|
||||||
verticalGaps,
|
verticalGaps,
|
||||||
|
projectRailOverflow: overflowState(rail),
|
||||||
|
projectRailChildrenOverflow: overflowState(railChildren),
|
||||||
overflowX: document.documentElement.scrollWidth > document.documentElement.clientWidth,
|
overflowX: document.documentElement.scrollWidth > document.documentElement.clientWidth,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -87,6 +100,18 @@ if (!metrics.horizontalInsets || Math.abs(metrics.horizontalInsets.left - metric
|
|||||||
if (metrics.verticalGaps.some((gap) => gap !== 12)) {
|
if (metrics.verticalGaps.some((gap) => gap !== 12)) {
|
||||||
failures.push(`expected all project rail vertical gaps to be 12px, got ${JSON.stringify(metrics.verticalGaps)}`)
|
failures.push(`expected all project rail vertical gaps to be 12px, got ${JSON.stringify(metrics.verticalGaps)}`)
|
||||||
}
|
}
|
||||||
|
for (const [name, overflow] of [
|
||||||
|
['project rail', metrics.projectRailOverflow],
|
||||||
|
['project rail children', metrics.projectRailChildrenOverflow],
|
||||||
|
]) {
|
||||||
|
if (
|
||||||
|
!overflow ||
|
||||||
|
overflow.overflowX !== 'hidden' ||
|
||||||
|
overflow.overflowY !== 'hidden'
|
||||||
|
) {
|
||||||
|
failures.push(`expected ${name} scrollbars to be hidden with no overflow, got ${JSON.stringify(overflow)}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
!metrics.firstProjectBadge ||
|
!metrics.firstProjectBadge ||
|
||||||
metrics.firstProjectBadge.right > metrics.projectRailWidth ||
|
metrics.firstProjectBadge.right > metrics.projectRailWidth ||
|
||||||
|
|||||||
@@ -281,17 +281,21 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
padding: 14px 24px;
|
overflow: hidden;
|
||||||
border-right: 1px solid var(--senlin-border);
|
border-right: 1px solid var(--senlin-border);
|
||||||
background: var(--senlin-panel);
|
background: var(--senlin-panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-rail .arco-layout-sider-children {
|
.project-rail .arco-layout-sider-children {
|
||||||
width: 100%;
|
width: calc(100% - 1px);
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
overflow: hidden !important;
|
||||||
|
padding: 14px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-stack,
|
.project-stack,
|
||||||
|
|||||||
Reference in New Issue
Block a user