remove: 去掉今日定调摘要(prompt不再生成、前端移除高亮框、空标题卡不渲染)
This commit is contained in:
@@ -46,7 +46,7 @@ function colorizeChildren(children: React.ReactNode): React.ReactNode {
|
||||
});
|
||||
}
|
||||
|
||||
/** 按 "## " 二级标题拆分报告为多张卡片;首段(# 标题 + 定调引用块)单独一张 */
|
||||
/** 按 "## " 二级标题拆分报告为多张卡片;首段(# 标题等)若无正文则不单独成卡 */
|
||||
function splitReport(content: string): { intro: string; sections: { title: string; body: string }[] } {
|
||||
const parts = content.split(/\n(?=## )/);
|
||||
const sections = parts.slice(1).map((p) => {
|
||||
@@ -55,7 +55,10 @@ function splitReport(content: string): { intro: string; sections: { title: strin
|
||||
const body = nl === -1 ? "" : p.slice(nl + 1).trim();
|
||||
return { title, body };
|
||||
});
|
||||
return { intro: parts[0].trim(), sections };
|
||||
const intro = parts[0].trim();
|
||||
// intro 只剩标题(无其他内容)时置空,避免渲染一张只有大标题的空卡片
|
||||
const introBody = intro.replace(/^#[^\n]*$/m, "").trim();
|
||||
return { intro: introBody ? intro : "", sections };
|
||||
}
|
||||
|
||||
function AiAnalysisPage() {
|
||||
@@ -142,18 +145,6 @@ function AiAnalysisPage() {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* 今日定调摘要 */}
|
||||
{report.summary && (
|
||||
<div className="mb-3 sm:mb-4 rounded-lg border border-primary/30 bg-primary/5 px-3 sm:px-4 py-3">
|
||||
<div className="flex items-start gap-2.5">
|
||||
<span className="shrink-0 mt-0.5 rounded bg-primary/10 px-1.5 py-0.5 text-[11px] font-semibold text-primary">
|
||||
今日定调
|
||||
</span>
|
||||
<p className="text-sm leading-relaxed">{report.summary}</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 报告正文:按 ## 章节分卡片渲染 */}
|
||||
{(() => {
|
||||
const { intro, sections } = splitReport(report.content);
|
||||
|
||||
Reference in New Issue
Block a user