refactor(web): unify tokens and product copy
This commit is contained in:
@@ -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
@@ -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':
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
17
apps/web_v1/src/styles/tokens.css
Normal file
17
apps/web_v1/src/styles/tokens.css
Normal 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user