fix(tui): keep fmtCwdBranch default, cap cwd at the status-bar call site

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.
This commit is contained in:
Brooklyn Nicholson
2026-06-01 20:55:14 -05:00
parent e25b2a6e18
commit 899e8b9067
2 changed files with 5 additions and 2 deletions

View File

@ -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,

View File

@ -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)
}