From 8b604a2c3ce26f6650b83d078907868398ef5b2a Mon Sep 17 00:00:00 2001 From: Saul Gutierrez Date: Tue, 3 Dec 2024 17:19:15 -0800 Subject: [PATCH] show more detailed info next to progress bars Summary: Before this diff, operations that show progress bars would only show the progress bar without telling exactly how many things (and which things) were in progress. This diff changes that so that updates that provide these numbers (mainly Sapling operations at the moment) will also show up. Reviewed By: evangrayk Differential Revision: D66708037 fbshipit-source-id: dac17b0643d5f36533aa5f5063283ac83524bd4a --- addons/isl-server/src/Repository.ts | 1 + addons/isl/src/CommandHistoryAndProgress.tsx | 5 +++-- addons/isl/src/types.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/isl-server/src/Repository.ts b/addons/isl-server/src/Repository.ts index 61a72a971095f..bdd8b3f081546 100644 --- a/addons/isl-server/src/Repository.ts +++ b/addons/isl-server/src/Repository.ts @@ -692,6 +692,7 @@ export class Repository { message: msg.topic, progress: msg.position, progressTotal: msg.total, + unit: msg.unit, }); } } catch (err) { diff --git a/addons/isl/src/CommandHistoryAndProgress.tsx b/addons/isl/src/CommandHistoryAndProgress.tsx index 156dd84c914c7..87cd1ed241f45 100644 --- a/addons/isl/src/CommandHistoryAndProgress.tsx +++ b/addons/isl/src/CommandHistoryAndProgress.tsx @@ -272,11 +272,12 @@ export function CommandHistoryAndProgress() { {showLastLineOfOutput ? (
- {progress.currentProgress != null ? ( + {progress.currentProgress != null && progress.currentProgress.unit != null ? ( - {progress.currentProgress.message} + {progress.currentProgress.message + + ` - ${progress.currentProgress.progress}/${progress.currentProgress.progressTotal} ${progress.currentProgress.unit}`} ) : ( processedLines.length > 0 && {processedLines.at(-1)} diff --git a/addons/isl/src/types.ts b/addons/isl/src/types.ts index 81fe5f74438a0..b82368e6097f5 100644 --- a/addons/isl/src/types.ts +++ b/addons/isl/src/types.ts @@ -589,6 +589,7 @@ export type ProgressStep = { message: string; progress?: number; progressTotal?: number; + unit?: string; }; export type OperationCommandProgressReporter = (