fix(web): use dashboard icon for workspace entry
This commit is contained in:
@@ -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 (!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')
|
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')
|
const source = readFileSync(file, 'utf8')
|
||||||
if (!source.includes('/senlinai-icon.svg')) failures.push(`${file} must use the brand icon`)
|
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)')) {
|
if (!projectRailSource.includes('projectNameLabel(project.name)')) {
|
||||||
failures.push('project rail labels must derive from the 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 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')
|
const apiSource = apiFiles.map((file) => readFileSync(file, 'utf8')).join('\n')
|
||||||
|
|||||||
@@ -166,6 +166,8 @@ const collectMetrics = async () => page.evaluate(() => {
|
|||||||
workspaceActions,
|
workspaceActions,
|
||||||
dashboardButton: rect(dashboard),
|
dashboardButton: rect(dashboard),
|
||||||
dashboardButtonActive: dashboard?.classList.contains('active') ?? false,
|
dashboardButtonActive: dashboard?.classList.contains('active') ?? false,
|
||||||
|
dashboardUsesPanelIcon: Boolean(dashboard?.querySelector('.arco-icon-dashboard')),
|
||||||
|
dashboardUsesBrandImage: Boolean(dashboard?.querySelector('img')),
|
||||||
workspaceExploreButton: rect(workspaceExplore),
|
workspaceExploreButton: rect(workspaceExplore),
|
||||||
workspaceExploreButtonActive: workspaceExplore?.classList.contains('active') ?? false,
|
workspaceExploreButtonActive: workspaceExplore?.classList.contains('active') ?? false,
|
||||||
projectButton: rect(project),
|
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.workbenchMain) failures.push('missing workbench main')
|
||||||
if (!metrics.hasWorkspacePage) failures.push('expected login to land on workspace page')
|
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.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.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.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')
|
if (metrics.projectButtonActive) failures.push('expected first project button not to be active on workspace landing page')
|
||||||
|
|||||||
@@ -126,12 +126,6 @@
|
|||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rail-brand-icon {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.brand-name {
|
.brand-name {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { CSSProperties } from 'react'
|
import type { CSSProperties } from 'react'
|
||||||
import { Badge, Button, Layout, Space } from '@arco-design/web-react'
|
import { Badge, Button, Layout, Space } from '@arco-design/web-react'
|
||||||
import { IconCompass, IconPlus } from '@arco-design/web-react/icon'
|
import { IconCompass, IconDashboard, IconPlus } from '@arco-design/web-react/icon'
|
||||||
import type { Project, WorkbenchView } from './project-types'
|
import type { Project, WorkbenchView } from './project-types'
|
||||||
|
|
||||||
const { Sider } = Layout
|
const { Sider } = Layout
|
||||||
@@ -26,10 +26,10 @@ export function ProjectRail({
|
|||||||
<Sider className="project-rail" width={96}>
|
<Sider className="project-rail" width={96}>
|
||||||
<Button
|
<Button
|
||||||
className={activeView === 'workspace' ? 'dashboard-button active' : 'dashboard-button'}
|
className={activeView === 'workspace' ? 'dashboard-button active' : 'dashboard-button'}
|
||||||
icon={<img className="brand-icon rail-brand-icon" src="/senlinai-icon.svg" alt="" aria-hidden="true" />}
|
icon={<IconDashboard />}
|
||||||
onClick={onSelectWorkspace}
|
onClick={onSelectWorkspace}
|
||||||
aria-label="森林AI 工作台"
|
aria-label="工作台"
|
||||||
title="森林AI 工作台"
|
title="工作台"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
className={activeView === 'workspace-explore' ? 'dashboard-button active' : 'dashboard-button'}
|
className={activeView === 'workspace-explore' ? 'dashboard-button active' : 'dashboard-button'}
|
||||||
|
|||||||
Reference in New Issue
Block a user