feat: connect inbox confirmation workflow

This commit is contained in:
2026-07-21 18:24:15 +08:00
parent 60e5ef0a87
commit dbc8de173e
16 changed files with 1295 additions and 129 deletions

View File

@@ -7,6 +7,7 @@ const requiredFiles = [
'src/pages/workspace-home.tsx',
'src/pages/workspace-explore.tsx',
'src/pages/projects/project-overview.tsx',
'src/pages/projects/project-inbox.tsx',
'src/pages/projects/project-channel-page.tsx',
'src/pages/projects/project-tasks.tsx',
'src/pages/projects/project-ai.tsx',
@@ -33,7 +34,7 @@ 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'))) {
for (const file of requiredFiles.filter((name) => name.endsWith('.tsx') && existsSync(name))) {
if (readFileSync(file, 'utf8').includes(forbidden)) failures.push(`${file} contains forbidden copy ${forbidden}`)
}
}
@@ -42,7 +43,7 @@ if (existsSync('src/App.tsx')) {
failures.push('legacy src/App.tsx should be removed after page split')
}
for (const removed of ['src/pages/projects/project-data.tsx', 'src/pages/projects/project-inspector.tsx', 'src/pages/projects/project-inbox.tsx']) {
for (const removed of ['src/pages/projects/project-data.tsx', 'src/pages/projects/project-inspector.tsx']) {
if (existsSync(removed)) {
failures.push(`${removed} should be removed; frontend data must come from backend APIs`)
}
@@ -105,6 +106,11 @@ const inboxSource = existsSync('src/api/inbox.ts') ? readFileSync('src/api/inbox
for (const path of ['/api/v1/projects/', '/api/v1/inbox/']) {
if (inboxSource && !inboxSource.includes(path)) failures.push(`inbox API must use ${path}`)
}
if (inboxSource.includes('body: { suggestions }')) failures.push('inbox confirm must not send client-authored suggestion content')
if (!inboxSource.includes('body: { suggestionIds }')) failures.push('inbox confirm must send only saved suggestion identities')
const inboxPageSource = existsSync('src/pages/projects/project-inbox.tsx') ? readFileSync('src/pages/projects/project-inbox.tsx', 'utf8') : ''
if (inboxPageSource && !inboxPageSource.includes('确认创建')) failures.push('project inbox must expose the single confirmation action')
const html = readFileSync('index.html', 'utf8')
if (!html.includes('<html lang="zh-CN">')) failures.push('index language must be zh-CN')