refactor(web): unify tokens and product copy

This commit is contained in:
2026-07-21 12:51:16 +08:00
parent 48709ea7c4
commit 907caed363
10 changed files with 239 additions and 228 deletions

View File

@@ -25,6 +25,16 @@ const requiredFiles = [
const failures = requiredFiles.filter((file) => !existsSync(file)).map((file) => `missing ${file}`) const failures = requiredFiles.filter((file) => !existsSync(file)).map((file) => `missing ${file}`)
const tokenSource = existsSync('src/styles/tokens.css') ? readFileSync('src/styles/tokens.css', 'utf8') : ''
for (const token of ['--color-primary: #165dff', '--font-sans', '--space-4: 16px']) {
if (!tokenSource.toLowerCase().includes(token)) failures.push(`missing token ${token}`)
}
for (const forbidden of ['森林Agent', 'AI智能体', '实时接口', '进度 60%']) {
for (const file of requiredFiles.filter((name) => name.endsWith('.tsx'))) {
if (readFileSync(file, 'utf8').includes(forbidden)) failures.push(`${file} contains forbidden copy ${forbidden}`)
}
}
if (existsSync('src/App.tsx')) { if (existsSync('src/App.tsx')) {
failures.push('legacy src/App.tsx should be removed after page split') failures.push('legacy src/App.tsx should be removed after page split')
} }

File diff suppressed because it is too large Load Diff

View File

@@ -95,7 +95,7 @@ function channelLabel(channel: BackendChannel) {
case 'tasks': case 'tasks':
return '工作计划' return '工作计划'
case 'ai_sessions': case 'ai_sessions':
return 'AI智能体' return 'AI 助手'
case 'notes_sources': case 'notes_sources':
return '笔记资料' return '笔记资料'
case 'cron': case 'cron':

View File

@@ -12,15 +12,9 @@ body,
} }
body { body {
font-family: font-family: var(--font-sans);
Inter, background: var(--color-bg);
ui-sans-serif, color: var(--color-text);
system-ui,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
sans-serif;
background: #f7f8fa;
} }
button, button,

View File

@@ -1,5 +1,6 @@
import { StrictMode } from 'react' import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client' import { createRoot } from 'react-dom/client'
import './styles/tokens.css'
import './index.css' import './index.css'
import App from './app/App.tsx' import App from './app/App.tsx'

View File

@@ -54,7 +54,7 @@ export function ProjectNewChannel({ activeWorkspace }: { activeWorkspace: Projec
<Tag color="arcoblue"></Tag> <Tag color="arcoblue"></Tag>
<Tag color="green"></Tag> <Tag color="green"></Tag>
<Tag color="orange">RSS/</Tag> <Tag color="orange">RSS/</Tag>
<Tag color="purple">AI智能体上下</Tag> <Tag color="purple">AI </Tag>
</Space> </Space>
</Card> </Card>
</div> </div>

View File

@@ -54,7 +54,7 @@ export function ProjectOverview({
<div> <div>
<Text type="secondary">{metric.title}</Text> <Text type="secondary">{metric.title}</Text>
<Title heading={3}>{metric.value}</Title> <Title heading={3}>{metric.value}</Title>
<Text className="metric-delta"></Text> <Text className="metric-delta"></Text>
</div> </div>
</Space> </Space>
</Card> </Card>

View File

@@ -26,7 +26,7 @@ export function ProjectStatusbar() {
<> <>
<Footer className="statusbar"> <Footer className="statusbar">
<button className="status-user" type="button" onClick={() => setProfileOpen(true)}> <button className="status-user" type="button" onClick={() => setProfileOpen(true)}>
<Avatar size={24} style={{ backgroundColor: '#165DFF' }}></Avatar> <Avatar size={24} style={{ backgroundColor: 'var(--color-primary)' }}></Avatar>
<span className="status-identity"> <span className="status-identity">
<Text className="status-name"></Text> <Text className="status-name"></Text>
<span className="status-online-dot" aria-label="在线" title="在线" /> <span className="status-online-dot" aria-label="在线" title="在线" />
@@ -57,7 +57,7 @@ export function ProjectStatusbar() {
<Form layout="vertical" className="status-modal-form"> <Form layout="vertical" className="status-modal-form">
<Form.Item label="头像"> <Form.Item label="头像">
<Space> <Space>
<Avatar size={42} style={{ backgroundColor: '#165DFF' }}></Avatar> <Avatar size={42} style={{ backgroundColor: 'var(--color-primary)' }}></Avatar>
<Button icon={<IconUser />}></Button> <Button icon={<IconUser />}></Button>
</Space> </Space>
</Form.Item> </Form.Item>

View File

@@ -80,7 +80,7 @@ export function WorkspacePage({
const workspaceMetrics = [ const workspaceMetrics = [
{ title: '项目总数', value: projects.length, delta: `${urgentProjects} 个高优先级`, icon: <IconDashboard />, color: 'arcoblue' }, { title: '项目总数', value: projects.length, delta: `${urgentProjects} 个高优先级`, icon: <IconDashboard />, color: 'arcoblue' },
{ title: '未完成计划', value: unfinishedTasks.length, delta: '跨项目聚合', icon: <IconCheckCircleFill />, color: 'green' }, { title: '未完成计划', value: unfinishedTasks.length, delta: '跨项目聚合', icon: <IconCheckCircleFill />, color: 'green' },
{ title: 'AI智能体', value: aiSessions.length, delta: '项目内上下文', icon: <IconRobot />, color: 'purple' }, { title: 'AI 助手', value: aiSessions.length, delta: '项目内上下文', icon: <IconRobot />, color: 'purple' },
{ title: '知识资料', value: notes.length, delta: '笔记与资料合计', icon: <IconFile />, color: 'cyan' }, { title: '知识资料', value: notes.length, delta: '笔记与资料合计', icon: <IconFile />, color: 'cyan' },
] ]
@@ -89,7 +89,7 @@ export function WorkspacePage({
<div className="overview-head"> <div className="overview-head">
<div> <div>
<Title heading={4}></Title> <Title heading={4}></Title>
<Text type="secondary">AI智能体和知识资</Text> <Text type="secondary">AI </Text>
</div> </div>
</div> </div>

View File

@@ -0,0 +1,17 @@
:root {
--color-primary: #165dff;
--color-bg: #f7f8fa;
--color-panel: #ffffff;
--color-border: #e5e6eb;
--color-text: #1d2129;
--color-muted: #6b7785;
--color-soft-blue: #e8f3ff;
--color-status: #142033;
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-6: 24px;
--radius-control: 8px;
}