feat(ui): fall back to pepper-only logo mark on narrow terminals - #1135
feat(ui): fall back to pepper-only logo mark on narrow terminals#1135josemonteiro wants to merge 1 commit into
Conversation
The full 36-col word-art needs CHROME (3) + CELL_PAD (1 each side) + RIGHT_MIN (12) + a MIN_GUTTER on each side to stay readable — below 55 cols the tips column was squeezed to a sliver, and below ~40 the old padding cascade left every body row hard-truncated mid-glyph. The pepper segment of the logo is a standalone 7-col mark, so render() now picks it when width < fullLogoWidth + CHROME + 2*CELL_PAD + RIGHT_MIN + 2*MIN_GUTTER (= 55), keeping the box intact and the right column readable. The padding cascade is replaced by computeHeaderLayout(): the right column keeps its RIGHT_MIN floor then absorbs the remaining slack, while the logo cell keeps up to GUTTER_MAX (10) of symmetric per-side gutter — capped at the old 56-col max — so logo and info lines stay centered as width grows. All dimensions derive from logoWidth/logoHeight, so the variant swap flows through the existing centering and column math untouched. The pepper glyph rows are shared between buildLogoLines and buildCompactLogoLines so the two variants can't diverge, and art rebuilds go through a single rebuildArt() helper. logo-narrow.test.ts gains a variant-switch suite (pepper mark + intact box below 55, full word-art at 55+, re-switch after invalidate), allocation anchors for span/rightColWidth across 11-200 cols, per-regime right-column monotonicity checks, centering assertions, and an overflow sweep including 1-2 col degenerate terminals. Co-Authored-By: Kimchi <noreply@kimchi.dev>
Kimchi Code Review
Summary📊 Review Score: 95/100 (overall code quality — 0 lowest, 100 highest) 🧪 Tests: yes — Excellent coverage. 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: 95/100 (overall code quality — 0 lowest, 100 highest)
⏱️ Estimated effort to review: 3/5 (1 = trivial, 5 = very complex)
🧪 Tests: yes — Excellent coverage. src/components/logo-narrow.test.ts exercises width fitting at many terminal widths, the compact/full variant switch, layout allocation anchors, monotonic right-column growth, horizontal centering, and vertical padding. The tests directly exercise the newly exported computeHeaderLayout and the rendered output.
No significant issues found. LGTM! 🎉
Linked issue
What does this PR do?
Falls back to a pepper-only logo mark on narrow terminals.
The full 36-col word-art needs CHROME (3) + CELL_PAD (1 each side) + RIGHT_MIN (12) + a MIN_GUTTER on each side to stay readable — below 55 cols the tips column was squeezed to a sliver, and below ~40 the old padding cascade left every body row hard-truncated mid-glyph. The pepper segment of the logo is a standalone 7-col mark, so
render()now picks it whenwidth < fullLogoWidth + CHROME + 2*CELL_PAD + RIGHT_MIN + 2*MIN_GUTTER(= 55), keeping the box intact and the right column readable.The padding cascade is replaced by
computeHeaderLayout(): the right column keeps its RIGHT_MIN floor then absorbs the remaining slack, while the logo cell keeps up to GUTTER_MAX (10) of symmetric per-side gutter — capped at the old 56-col max — so logo and info lines stay centered as width grows. All dimensions derive fromlogoWidth/logoHeight, so the variant swap flows through the existing centering and column math untouched. The pepper glyph rows are shared betweenbuildLogoLinesandbuildCompactLogoLinesso the two variants can't diverge, and art rebuilds go through a singlerebuildArt()helper.logo-narrow.test.tsgains a variant-switch suite (pepper mark + intact box below 55, full word-art at 55+, re-switch afterinvalidate), allocation anchors for span/rightColWidth across 11–200 cols, per-regime right-column monotonicity checks, centering assertions, and an overflow sweep including 1–2 col degenerate terminals.Checklist
pnpm run test)pnpm run check)Test note: the 30 failing tests in
src/extensions/permissions,src/extensions/plannotator, andsrc/modes/acpfail identically on the merge-base (6595fbe8) — pre-existing breakage unrelated to this change. All logo tests pass (68/68), andpnpm run checkis clean apart from one pre-existing biome warning in an unrelated test file.