fix(tui): keep status rule one-line in skinny terminals - #31081
Conversation
Clamp and truncate the cwd/branch segment so narrow status bars cannot wrap into the composer input row.
🔎 Lint report:
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts the TUI StatusRule layout so the status bar stays on one line in narrow terminals by clamping/truncating the right-hand cwd/branch segment, and adds regression tests around the width calculations.
Changes:
- Introduces a
statusRuleWidthshelper to compute left/right/separator widths based on terminal columns. - Updates
StatusRulerendering to conditionally render and truncate the cwd/branch segment within a fixed-width box. - Adds vitest coverage for the width calculation behavior across “skinny terminal” sizes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui-tui/src/components/appChrome.tsx | Adds statusRuleWidths and uses it to clamp/truncate the status rule’s right-hand cwd/branch segment. |
| ui-tui/src/tests/statusRule.test.ts | Adds regression tests to ensure computed widths do not exceed the terminal width and that the cwd segment is truncated/omitted on narrow widths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Make the cwd separator width conditional so the computed status layout matches the rendered row on ultra-narrow terminals.
Budget the right-hand status label by terminal display width so wide Unicode paths cannot wrap skinny status bars.
hal-blinc
left a comment
There was a problem hiding this comment.
Coach review: ready to merge. Verified clean merge state, no failing/pending checks, targeted review/tests passed or were confirmed by CI. Low-risk housekeeping fix.
|
LGTM in tests. |
…-status-rule fix(tui): keep status rule one-line in skinny terminals
fix(tui): keep status rule one-line in skinny terminals
…-status-rule fix(tui): keep status rule one-line in skinny terminals
…-status-rule fix(tui): keep status rule one-line in skinny terminals
…-status-rule fix(tui): keep status rule one-line in skinny terminals
…-status-rule fix(tui): keep status rule one-line in skinny terminals
Summary
Context
Addresses the skinny-terminal report where the status bar wraps into the input field.
Test plan
npm run build --prefix packages/hermes-inknpx vitest run --maxWorkers 4 --testTimeout 15000 src/__tests__/statusRule.test.tsnpx eslint src/components/appChrome.tsx src/__tests__/statusRule.test.ts(0 errors; existingGoodVibesHeartdependency warning remains)npm run build