From 899e8b9067e2d2020713465fc263409c2e217988 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Mon, 1 Jun 2026 20:55:14 -0500 Subject: [PATCH] fix(tui): keep fmtCwdBranch default, cap cwd at the status-bar call site MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts the shared fmtCwdBranch default (28 → 40) so it isn't an API/ behavior change for other callers, and instead passes max=28 explicitly from the status-bar caller where the tighter cap is intended. --- ui-tui/src/app/useMainApp.ts | 5 ++++- ui-tui/src/domain/paths.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui-tui/src/app/useMainApp.ts b/ui-tui/src/app/useMainApp.ts index 43e8a2ed628..6915c4c5f09 100644 --- a/ui-tui/src/app/useMainApp.ts +++ b/ui-tui/src/app/useMainApp.ts @@ -1035,7 +1035,10 @@ export function useMainApp(gw: GatewayClient) { const appStatus = useMemo( () => ({ - cwdLabel: fmtCwdBranch(cwd, gitBranch), + // Cap the status-bar cwd/branch label tighter than the shared default so + // it doesn't dominate the bar; the status rule reserves the left-side + // essentials and truncates this further on narrow terminals. + cwdLabel: fmtCwdBranch(cwd, gitBranch, 28), goodVibesTick, sessionStartedAt: ui.sid ? sessionStartedAt : null, showStickyPrompt: !!stickyPrompt, diff --git a/ui-tui/src/domain/paths.ts b/ui-tui/src/domain/paths.ts index 90483451c83..43c023b6ba9 100644 --- a/ui-tui/src/domain/paths.ts +++ b/ui-tui/src/domain/paths.ts @@ -5,7 +5,7 @@ export const shortCwd = (cwd: string, max = 28) => { return p.length <= max ? p : `…${p.slice(-(max - 1))}` } -export const fmtCwdBranch = (cwd: string, branch: null | string, max = 28) => { +export const fmtCwdBranch = (cwd: string, branch: null | string, max = 40) => { if (!branch) { return shortCwd(cwd, max) }