fix(tui): preserve footer truncation after merge
This commit is contained in:
@@ -777,10 +777,7 @@ class FooterComponent implements Component {
|
||||
return [`${' '.repeat(Math.max(0, width - visibleWidth(compact)))}${this.palette.dim(compact)}`]
|
||||
}
|
||||
const rightAvailable = width - visibleWidth(counters) - 1
|
||||
const fullWidth = visibleWidth(formattedCwd) + visibleWidth(counters) + visibleWidth(fullRight) + 3
|
||||
const right = this.cwdFormatter === undefined
|
||||
? (visibleWidth(fullRight) <= rightAvailable ? fullRight : compactRight)
|
||||
: (fullWidth <= width ? fullRight : compactRight)
|
||||
const right = visibleWidth(fullRight) <= rightAvailable ? fullRight : compactRight
|
||||
const rightClipped = truncateToWidth(right, rightAvailable, '')
|
||||
const cwdAvailable = Math.max(0, width - visibleWidth(counters) - visibleWidth(rightClipped) - 3)
|
||||
const cwd = truncateToWidth(formattedCwd, cwdAvailable, '')
|
||||
|
||||
@@ -511,10 +511,10 @@ describe('pi-tui chat lifecycle and transcript', () => {
|
||||
await dispose(outsideResult)
|
||||
|
||||
const logicalResult = await setup({
|
||||
cwd: '/host/worktree',
|
||||
cwd: '/w',
|
||||
formatCwd: cwd => `logical:${cwd}\x1b`,
|
||||
})
|
||||
expect(logicalResult.terminal.output).toContain('logical:/host/worktree\\x1b')
|
||||
expect(logicalResult.terminal.output).toContain('logical:/w\\x1b')
|
||||
await dispose(logicalResult)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user