From 60d7bd67d1a4cbbc0a340ba963843e4e3cf227ff Mon Sep 17 00:00:00 2001 From: dal Date: Thu, 21 Aug 2025 21:53:13 -0600 Subject: [PATCH] Update modify-reports-transform-helper to display elapsed time only when all edits are complete, ensuring accurate reporting during the editing process. --- .../helpers/modify-reports-transform-helper.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/ai/src/tools/visualization-tools/reports/modify-reports-tool/helpers/modify-reports-transform-helper.ts b/packages/ai/src/tools/visualization-tools/reports/modify-reports-tool/helpers/modify-reports-transform-helper.ts index 9ff3b07b3..2bcea1b22 100644 --- a/packages/ai/src/tools/visualization-tools/reports/modify-reports-tool/helpers/modify-reports-transform-helper.ts +++ b/packages/ai/src/tools/visualization-tools/reports/modify-reports-tool/helpers/modify-reports-transform-helper.ts @@ -66,8 +66,15 @@ export function createModifyReportsReasoningEntry( } } - // Calculate elapsed time when complete - secondaryTitle = formatElapsedTime(state.startTime); + // Only show elapsed time when all edits are complete (not during streaming) + // Check if all edits have a final status (completed or failed), not just 'loading' + const allEditsComplete = state.edits?.every( + (edit) => edit.status === 'completed' || edit.status === 'failed' + ) ?? false; + + if (allEditsComplete) { + secondaryTitle = formatElapsedTime(state.startTime); + } } return {