fix(web): use dashboard icon for workspace entry

This commit is contained in:
2026-07-22 15:50:16 +08:00
parent e391d9dc2f
commit 74775ed64f
4 changed files with 11 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ if (!html.includes('<title>森林AI</title>')) failures.push('document title mus
if (!html.includes('href="/senlinai-icon.svg"')) failures.push('favicon must use /senlinai-icon.svg')
if (!existsSync('public/senlinai-icon.svg')) failures.push('missing public/senlinai-icon.svg')
for (const file of ['src/pages/login.tsx', 'src/pages/projects/project-topbar.tsx', 'src/pages/projects/project-rail.tsx']) {
for (const file of ['src/pages/login.tsx', 'src/pages/projects/project-topbar.tsx']) {
const source = readFileSync(file, 'utf8')
if (!source.includes('/senlinai-icon.svg')) failures.push(`${file} must use the brand icon`)
}
@@ -51,6 +51,9 @@ const projectRailSource = readFileSync('src/pages/projects/project-rail.tsx', 'u
if (!projectRailSource.includes('projectNameLabel(project.name)')) {
failures.push('project rail labels must derive from the project name')
}
if (!projectRailSource.includes('icon={<IconDashboard />}') || projectRailSource.includes('rail-brand-icon')) {
failures.push('workspace rail entry must use the dashboard icon instead of the brand logo')
}
const apiFiles = ['client.ts', 'projects.ts', 'mappers.tsx', 'search.ts', 'inbox.ts', 'ai.ts'].map((name) => `src/api/${name}`)
const apiSource = apiFiles.map((file) => readFileSync(file, 'utf8')).join('\n')

View File

@@ -166,6 +166,8 @@ const collectMetrics = async () => page.evaluate(() => {
workspaceActions,
dashboardButton: rect(dashboard),
dashboardButtonActive: dashboard?.classList.contains('active') ?? false,
dashboardUsesPanelIcon: Boolean(dashboard?.querySelector('.arco-icon-dashboard')),
dashboardUsesBrandImage: Boolean(dashboard?.querySelector('img')),
workspaceExploreButton: rect(workspaceExplore),
workspaceExploreButtonActive: workspaceExplore?.classList.contains('active') ?? false,
projectButton: rect(project),
@@ -267,6 +269,7 @@ if (metrics.overflowX) failures.push('expected no horizontal overflow')
if (!metrics.workbenchMain) failures.push('missing workbench main')
if (!metrics.hasWorkspacePage) failures.push('expected login to land on workspace page')
if (!metrics.dashboardButtonActive) failures.push('expected dashboard button to be active after login')
if (!metrics.dashboardUsesPanelIcon || metrics.dashboardUsesBrandImage) failures.push('expected workspace entry to use the panel icon instead of the brand logo')
if (!metrics.workspaceExploreButton) failures.push('expected fixed workspace explore button to render in project rail')
if (metrics.workspaceExploreButtonActive) failures.push('expected fixed workspace explore button not to be active after login')
if (metrics.projectButtonActive) failures.push('expected first project button not to be active on workspace landing page')