From 4135e388ffac8b1e3014e78111132f845ba2cafe Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Sat, 30 May 2026 10:25:24 +0200 Subject: [PATCH] ui(deploy): reorder progress bar so %, time stay visible on narrow terms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Old layout truncated the critical right-side (1m23s/~3m) on long labels. New layout puts %, bar, and elapsed/eta on the LEFT, label+subtitle on the RIGHT where truncation does no harm. Bar shrunk 20→15 chars. --- apps/rebreak-native/deploy.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/rebreak-native/deploy.sh b/apps/rebreak-native/deploy.sh index 74edbe1..8200bec 100755 --- a/apps/rebreak-native/deploy.sh +++ b/apps/rebreak-native/deploy.sh @@ -134,10 +134,11 @@ runtime_save() { } # Render brew-style SINGLE-LINE progress bar: -# ==> Building xcarchive ████████░░░░░░░░ 42% (1m23s/~3m18s) ↳ CompileSwift Foo +# Layout: ==> 42% ██████░░░ (1m23s/~3m) Label ↳ subtitle +# Critical metrics (%, time) stay LEFT so they're never truncated. render_progress() { local elapsed="$1" expected="$2" label="$3" subtitle="$4" - local width=20 pct filled empty bar elapsed_h expected_h line + local width=15 pct filled empty bar elapsed_h expected_h line if (( expected > 0 )); then pct=$(( elapsed * 100 / expected )) (( pct > 99 )) && pct=99 @@ -154,11 +155,11 @@ render_progress() { elapsed_h=$(format_duration "$elapsed") if (( expected > 0 )); then expected_h=$(format_duration_rounded "$expected") - line=$(printf '%s==>%s %s %s %s%3d%%%s (%s/~%s)' \ - "$BLUE" "$RESET" "$label" "$bar" "$YELLOW" "$pct" "$RESET" "$elapsed_h" "$expected_h") + line=$(printf '%s==>%s %s%3d%%%s %s (%s/~%s) %s' \ + "$BLUE" "$RESET" "$YELLOW" "$pct" "$RESET" "$bar" "$elapsed_h" "$expected_h" "$label") else - line=$(printf '%s==>%s %s %s %s(%s)%s' \ - "$BLUE" "$RESET" "$label" "$bar" "$YELLOW" "$elapsed_h" "$RESET") + line=$(printf '%s==>%s %s(%s)%s %s %s' \ + "$BLUE" "$RESET" "$YELLOW" "$elapsed_h" "$RESET" "$bar" "$label") fi if [[ -n "$subtitle" ]]; then line="$line ↳ $subtitle"