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:
@ -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,
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user