feat(ai): 优化拆解重跑与结果展示
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user