diff --git a/apps/web_v1/scripts/structure-check.mjs b/apps/web_v1/scripts/structure-check.mjs index 66a5600..9800161 100644 --- a/apps/web_v1/scripts/structure-check.mjs +++ b/apps/web_v1/scripts/structure-check.mjs @@ -74,6 +74,11 @@ const projectsSource = readFileSync('src/api/projects.ts', 'utf8') if (!projectsSource.includes("'/api/v1/projects'")) failures.push('project API must use /api/v1/projects') if (/['"`]\/api\/(?!v1\/)/.test(apiSource)) failures.push('src/api paths must use the /api/v1 prefix') +const mappersSource = readFileSync('src/api/mappers.tsx', 'utf8') +if (!mappersSource.includes("filter((channel) => channel.type !== 'inbox')")) { + failures.push('project channels must hide the removed Inbox message stream') +} + for (const match of apiSource.matchAll(/export type (\w+DTO)\s*=\s*\{([\s\S]*?)\n\}/g)) { const [, name, body] = match if (/^\s*\w+\s*\?\s*:/m.test(body)) failures.push(`${name} fields must be required`) diff --git a/apps/web_v1/scripts/visual-check.mjs b/apps/web_v1/scripts/visual-check.mjs index bf0325f..813a32b 100644 --- a/apps/web_v1/scripts/visual-check.mjs +++ b/apps/web_v1/scripts/visual-check.mjs @@ -35,6 +35,7 @@ const visualCheckWorkspace = { }, channels: [ { id: 'overview', projectId, type: 'overview', title: '概况', icon: 'home', count: 0, url: '', sortOrder: 0 }, + { id: 'inbox', projectId, type: 'inbox', title: 'Inbox 消息流', icon: 'email', count: 2, url: '', sortOrder: 1 }, { id: 'tasks', projectId, type: 'tasks', title: '工作计划', icon: 'list', count: 0, url: '', sortOrder: 1 }, { id: 'ai', projectId, type: 'ai_sessions', title: 'AI 助手', icon: 'robot', count: 0, url: '', sortOrder: 2 }, { id: 'notes', projectId, type: 'notes_sources', title: '笔记资料', icon: 'file', count: 0, url: '', sortOrder: 3 }, @@ -156,6 +157,7 @@ const collectMetrics = async () => page.evaluate(() => { hasProjectOverview: Boolean(projectOverview), exploreSourceCardCount: document.querySelectorAll('.explore-source-card').length, hasExploreReader: Boolean(document.querySelector('.explore-reader-layout')), + hasInboxChannel: [...document.querySelectorAll('.channel-button')].some((button) => button.textContent?.includes('Inbox')), projectRailWidth: rail?.getBoundingClientRect().width, projectRail: rect(rail), channelSidebar: rect(sidebar), @@ -341,6 +343,7 @@ if (!workspaceExploreMetrics.stage || !workspaceExploreMetrics.projectRail) { } if (!projectMetrics.hasProjectOverview) failures.push('expected first project click to show project overview page') +if (projectMetrics.hasInboxChannel) failures.push('expected removed Inbox message stream to stay hidden from project channels') if (projectMetrics.hasWorkspacePage) failures.push('expected project overview mode to leave workspace page') if (!projectMetrics.projectButtonActive) failures.push('expected first project button to be active in project mode') if (projectMetrics.dashboardButtonActive) failures.push('expected dashboard button not to be active in project mode') diff --git a/apps/web_v1/src/api/mappers.tsx b/apps/web_v1/src/api/mappers.tsx index 4263d55..e81122b 100644 --- a/apps/web_v1/src/api/mappers.tsx +++ b/apps/web_v1/src/api/mappers.tsx @@ -28,7 +28,7 @@ export function mapWorkspace(payload: ProjectWorkspaceDTO, index = 0): ProjectWo return { project, - channels: payload.channels.map(mapChannel), + channels: payload.channels.filter((channel) => channel.type !== 'inbox').map(mapChannel), tags: payload.tags.map((tag) => tag.name), recentSessions: payload.recentSessions.map(mapAISession), inbox: payload.inbox.map(mapInbox),