feat(web): restore legacy status bar
This commit is contained in:
@@ -99,6 +99,8 @@ const collectMetrics = async () => page.evaluate(() => {
|
||||
const statusbar = document.querySelector('.statusbar')
|
||||
const statusName = document.querySelector('.status-name')
|
||||
const statusOnlineDot = document.querySelector('.status-online-dot')
|
||||
const statusUpgrade = document.querySelector('.status-upgrade')
|
||||
const statusSystem = document.querySelector('.status-system')
|
||||
const search = document.querySelector('.global-search')
|
||||
const main = document.querySelector('.workbench-main')
|
||||
const workspacePage = document.querySelector('.workspace-page')
|
||||
@@ -146,6 +148,8 @@ const collectMetrics = async () => page.evaluate(() => {
|
||||
statusbarHeight: statusbar?.getBoundingClientRect().height,
|
||||
statusName: rect(statusName),
|
||||
statusOnlineDot: rect(statusOnlineDot),
|
||||
statusUpgrade: rect(statusUpgrade),
|
||||
statusSystemText: statusSystem?.textContent?.replace(/\s+/g, ' ').trim() ?? '',
|
||||
searchHeight: search?.getBoundingClientRect().height,
|
||||
workbenchMain: rect(main),
|
||||
hasWorkspacePage: Boolean(workspacePage),
|
||||
@@ -249,6 +253,11 @@ const metrics = workspaceMetrics
|
||||
if (errors.length) failures.push(`console errors: ${errors.join('; ')}`)
|
||||
if (metrics.statusbarHeight !== 32) failures.push(`expected statusbar height 32, got ${metrics.statusbarHeight}`)
|
||||
if (!metrics.statusName) failures.push('expected authenticated status label')
|
||||
if (!metrics.statusOnlineDot) failures.push('expected legacy online status dot')
|
||||
if (!metrics.statusUpgrade) failures.push('expected legacy upgrade action')
|
||||
if (!metrics.statusSystemText.includes('3 个计划进行中') || !metrics.statusSystemText.includes('AI 空闲') || !metrics.statusSystemText.includes('152GB 可用')) {
|
||||
failures.push(`expected legacy system status summary, got ${JSON.stringify(metrics.statusSystemText)}`)
|
||||
}
|
||||
if (metrics.searchHeight !== 42) failures.push(`expected search height 42, got ${metrics.searchHeight}`)
|
||||
if (metrics.overflowX) failures.push('expected no horizontal overflow')
|
||||
if (!metrics.workbenchMain) failures.push('missing workbench main')
|
||||
|
||||
Reference in New Issue
Block a user