feat(analysis): 添加分析查看器页面 (#122)

- 新增 AnalysisPage 页面查看 /workflow:analyze-with-file 分析结果
- 支持 Tab 分组展示:讨论记录、结论、代码探索、视角分析
- Markdown 内容富文本渲染,JSON 数据结构化卡片展示
- 添加后端 API 路由 /api/analysis
- 添加侧边栏导航入口和中英文翻译

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
AXC00
2026-02-26 14:04:41 +08:00
committed by GitHub
parent a35fb0fe8f
commit 12be252e8e
12 changed files with 982 additions and 2 deletions

View File

@@ -7132,3 +7132,38 @@ export async function triggerReindex(
}
);
}
// ========== Analysis API ==========
import type { AnalysisSessionSummary, AnalysisSessionDetail } from '../types/analysis';
/**
* Fetch list of analysis sessions
*/
export async function fetchAnalysisSessions(
projectPath?: string
): Promise<AnalysisSessionSummary[]> {
const data = await fetchApi<{ success: boolean; data: AnalysisSessionSummary[]; error?: string }>(
withPath('/api/analysis', projectPath)
);
if (!data.success) {
throw new Error(data.error || 'Failed to fetch analysis sessions');
}
return data.data;
}
/**
* Fetch analysis session detail
*/
export async function fetchAnalysisDetail(
sessionId: string,
projectPath?: string
): Promise<AnalysisSessionDetail> {
const data = await fetchApi<{ success: boolean; data: AnalysisSessionDetail; error?: string }>(
withPath(`/api/analysis/${encodeURIComponent(sessionId)}`, projectPath)
);
if (!data.success) {
throw new Error(data.error || 'Failed to fetch analysis detail');
}
return data.data;
}