Skip to content

Commit dc90da0

Browse files
committed
fix: remove silent .slice() truncation in abbreviateCount, render first spinner frame immediately
- Remove .slice(0, COL_COUNT) from abbreviateCount — the toFixed(1) to Math.round() fallback already guarantees width, and slice would silently corrupt the value if it ever activated - Call scheduleFrame() directly instead of setTimeout(scheduleFrame, ...) in both poll() and withProgress() so the first spinner frame renders immediately
1 parent 6dbdd0c commit dc90da0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/formatters/human.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ function abbreviateCount(raw: string): string {
339339
withDecimal.length <= COL_COUNT
340340
? withDecimal
341341
: `${Math.round(scaled)}${suffix}`;
342-
return abbreviated.slice(0, COL_COUNT).padStart(COL_COUNT);
342+
return abbreviated.padStart(COL_COUNT);
343343
}
344344

345345
/** Column where title starts in single-project mode (no ALIAS column) */

src/lib/polling.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export async function poll<T>(options: PollOptions<T>): Promise<T> {
9898
tick += 1;
9999
setTimeout(scheduleFrame, ANIMATION_INTERVAL_MS).unref();
100100
};
101-
setTimeout(scheduleFrame, ANIMATION_INTERVAL_MS).unref();
101+
scheduleFrame();
102102
}
103103

104104
try {
@@ -183,7 +183,7 @@ export async function withProgress<T>(
183183
tick += 1;
184184
setTimeout(scheduleFrame, ANIMATION_INTERVAL_MS).unref();
185185
};
186-
setTimeout(scheduleFrame, ANIMATION_INTERVAL_MS).unref();
186+
scheduleFrame();
187187

188188
try {
189189
return await fn((msg) => {

0 commit comments

Comments
 (0)