feat(ai): 优化拆解重跑与结果展示

This commit is contained in:
Script Generator
2026-06-26 11:01:11 +08:00
parent 55e24442ab
commit 56e0fe562d
36 changed files with 1342 additions and 186 deletions

View File

@@ -34,8 +34,11 @@ function timeRangeText(task: DevTask): { text: string; tone: string } {
return { text: '', tone: 'text-[var(--ink-muted)]' };
}
function hoursText(estimate: number, actual: number): { text: string; tone: string } {
if (actual <= 0) return { text: `${formatWorkHours(estimate)}`, tone: 'text-[var(--ink-muted)]' };
function hoursText(task: DevTask, estimate: number, actual: number): { text: string; tone: string } {
const hasExecutorEstimate = typeof task.estimateHours === 'number' && task.estimateHours > 0;
const hasAiEstimate = typeof task.aiEstimateHours === 'number' && task.aiEstimateHours > 0;
const prefix = hasExecutorEstimate ? '执行预' : hasAiEstimate ? 'AI预' : '预';
if (actual <= 0) return { text: `${prefix} ${formatWorkHours(estimate)}`, tone: 'text-[var(--ink-muted)]' };
let tone = 'text-[var(--ink-soft)]';
if (actual > estimate) tone = 'text-red-600';
else if (actual < estimate) tone = 'text-emerald-600';
@@ -46,7 +49,7 @@ export function DevTaskRow({ task, category, onClick }: Props) {
const estimate = getEstimateHours(task);
const actual = getActualHours(task);
const range = timeRangeText(task);
const hours = hoursText(estimate, actual);
const hours = hoursText(task, estimate, actual);
return (
<div