Show online status as inline dot

This commit is contained in:
2026-07-20 11:43:02 +08:00
parent da76abf2d0
commit 22128f0171
3 changed files with 54 additions and 10 deletions

View File

@@ -32,6 +32,8 @@ await page.screenshot({ path: 'test-results/workbench-react-acro-dark.png', full
const metrics = await page.evaluate(() => {
const statusbar = document.querySelector('.statusbar')
const statusName = document.querySelector('.status-name')
const statusOnlineDot = document.querySelector('.status-online-dot')
const search = document.querySelector('.global-search')
const main = document.querySelector('.workbench-main')
const workspacePage = document.querySelector('.workspace-page')
@@ -73,6 +75,8 @@ const metrics = await page.evaluate(() => {
return {
statusbarHeight: statusbar?.getBoundingClientRect().height,
statusName: rect(statusName),
statusOnlineDot: rect(statusOnlineDot),
searchHeight: search?.getBoundingClientRect().height,
workbenchMain: rect(main),
hasWorkspacePage: Boolean(workspacePage),
@@ -106,6 +110,10 @@ console.log(JSON.stringify({ metrics, errors }, null, 2))
const failures = []
if (errors.length) failures.push(`console errors: ${errors.join('; ')}`)
if (metrics.statusbarHeight !== 32) failures.push(`expected statusbar height 32, got ${metrics.statusbarHeight}`)
if (!metrics.statusOnlineDot) failures.push('expected online status to render as an icon dot')
if (metrics.statusName && metrics.statusOnlineDot && Math.abs(metrics.statusName.top - metrics.statusOnlineDot.top) > 6) {
failures.push(`expected online dot to sit beside username, got name=${JSON.stringify(metrics.statusName)}, dot=${JSON.stringify(metrics.statusOnlineDot)}`)
}
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')

View File

@@ -661,17 +661,25 @@
}
.status-name {
display: block;
display: inline-flex;
font-size: 12px;
font-weight: 700;
line-height: 1;
}
.status-online {
display: block;
color: #7be188 !important;
font-size: 11px;
line-height: 1;
.status-identity {
display: inline-flex;
align-items: center;
gap: 5px;
}
.status-online-dot {
width: 7px;
height: 7px;
display: inline-block;
border-radius: 50%;
background: #7be188;
box-shadow: 0 0 0 2px rgba(123, 225, 136, 0.16);
}
.status-system b {

View File

@@ -1,5 +1,15 @@
import { Avatar, Button, Layout, Space, Typography } from '@arco-design/web-react'
import { IconApps, IconCalendar, IconCheckCircleFill, IconMessage, IconRobot, IconSettings, IconStorage, IconThunderbolt, IconUserGroup } from '@arco-design/web-react/icon'
import {
IconApps,
IconCalendar,
IconCheckCircleFill,
IconMessage,
IconRobot,
IconSettings,
IconStorage,
IconThunderbolt,
IconUserGroup,
} from '@arco-design/web-react/icon'
const { Footer } = Layout
const { Text } = Typography
@@ -7,9 +17,27 @@ const { Text } = Typography
export function ProjectStatusbar() {
return (
<Footer className="statusbar">
<div className="status-user"><Avatar size={26} style={{ backgroundColor: '#165DFF' }}></Avatar><div><Text className="status-name"></Text><Text className="status-online">线</Text></div><Button type="text" icon={<IconUserGroup />}></Button><Button type="text" icon={<IconMessage />}></Button><Button type="text" icon={<IconSettings />}></Button></div>
<Space className="status-tasks" size={28}><span><IconCheckCircleFill /> </span><span><IconInteractionFallback /> 3 </span><span><IconRobot /> AI </span><span><IconThunderbolt /> 稿</span></Space>
<Space className="status-system" size={24}><span><IconStorage /> 152GB </span><span> <b></b></span><IconApps /></Space>
<div className="status-user">
<Avatar size={26} style={{ backgroundColor: '#165DFF' }}></Avatar>
<div className="status-identity">
<Text className="status-name"></Text>
<span className="status-online-dot" aria-label="在线" title="在线" />
</div>
<Button type="text" icon={<IconUserGroup />}></Button>
<Button type="text" icon={<IconMessage />}></Button>
<Button type="text" icon={<IconSettings />}></Button>
</div>
<Space className="status-tasks" size={28}>
<span><IconCheckCircleFill /> </span>
<span><IconInteractionFallback /> 3 </span>
<span><IconRobot /> AI </span>
<span><IconThunderbolt /> 稿</span>
</Space>
<Space className="status-system" size={24}>
<span><IconStorage /> 152GB </span>
<span> <b></b></span>
<IconApps />
</Space>
</Footer>
)
}