feat: compact segments in the footer when they don't fit the screen#264
Conversation
Kimchi Code Review
Summary📊 Review Score: 92/100 (overall code quality — 0 lowest, 100 highest) 🧪 Tests: yes — Extensive test coverage added (621 lines) exercising compaction builders, regex matching, behavioral acceptance at representative terminal widths (160 down to 10), CJK/wide-character handling, segment visibility toggles, info-line layout, and a regression test against orphan separators. Tests are well-structured and validate the UX-ladder truncation strategy. No significant issues found. LGTM! 🎉 What to expectKimchi will analyze the changes in this pull request and post:
The review typically completes within a few minutes. This comment will be updated once the review is ready. Interact with Kimchi
ConfigurationReviews are configured by your organization admin. Powered by Kimchi — AI-powered code review by CAST AI |
There was a problem hiding this comment.
📊 Review Score: 88/100 (overall code quality — 0 lowest, 100 highest)
⏱️ Estimated effort to review: 3/5 (1 = trivial, 5 = very complex)
🧪 Tests: yes — Thorough test coverage added: unit tests for all compact-form builders, regex validation for SHORTCUT_TAIL, behavioural acceptance tests across 14 representative terminal widths, and regression tests for info-line rendering and orphan separators.
📝 Found 2 issue(s). See inline comments for details.
|
@kimchi review |
|
🔄 Starting review on |
|
📚 No documentation changes were needed for this PR (Job ID: |
There was a problem hiding this comment.
📊 Review Score: 92/100 (overall code quality — 0 lowest, 100 highest)
⏱️ Estimated effort to review: 3/5 (1 = trivial, 5 = very complex)
🧪 Tests: yes — Extensive test coverage added (621 lines) exercising compaction builders, regex matching, behavioral acceptance at representative terminal widths (160 down to 10), CJK/wide-character handling, segment visibility toggles, info-line layout, and a regression test against orphan separators. Tests are well-structured and validate the UX-ladder truncation strategy.
No significant issues found. LGTM! 🎉
|
|
||
| describe("compact-form builders", () => { | ||
| describe("buildContextCompact", () => { | ||
| it("returns `N% ctx` with no bar", () => { |
There was a problem hiding this comment.
I doubt we need that much unit testing here. This is easily testable manually.
Closes #LLM-1606
When everything fits

Compacting steps:

When the screen is very narrow and compacted elements doesn't fit they are truncated:

Kimchi Summary
What changed
Added responsive compaction to the status footer so it gracefully narrows for smaller terminals instead of overflowing. When space is constrained, the footer progressively abbreviates labels, drops decorative prefixes, and strips shortcut hints before falling back to tail truncation.
Why
The footer previously overflowed when terminal width was insufficient, causing elements to run off-screen. This makes the footer readable in narrow terminals or split-pane layouts.
Key changes
src/components/footer.ts: Replaced fixed string concatenation with aSegment-based layout engine (layoutFooter,renderLine) that applies an ordered UX-ladder ofCompactionSteps.src/components/footer.ts: Each footer segment now carries a stableSegmentIdand optionalrawinputs, enabling type-safe rebuilds during compaction without re-parsing ANSI.src/components/footer.ts: Added compact-form buildersbuildContextCompact(drops bar, keepsN% ctx),buildMultiModelAbbrev(multi-model:→m-m:), andbuildPhaseCompact(dropsphase:prefix).src/components/footer.ts: AddedSHORTCUT_TAILregex andstripShortcutHintsAcrossto remove trailing shortcut hints (e.g.→ shift+tab) frompermissionsandmulti-modelsegments.src/components/footer.ts: AddeddropFermentPrefixto slice off theferment:label in place when space is constrained.src/components/footer.test.ts: Added comprehensive behavioral tests rendering the footer at widths 160, 100, 60, 20, 10, plus regression tests for orphan separators, info lines, and shortcut-tail regex matching.Impact