Skip to content

feat(ui): fall back to pepper-only logo mark on narrow terminals - #1135

Draft
josemonteiro wants to merge 1 commit into
getkimchi:masterfrom
josemonteiro:feat/compact-pepper-logo
Draft

feat(ui): fall back to pepper-only logo mark on narrow terminals#1135
josemonteiro wants to merge 1 commit into
getkimchi:masterfrom
josemonteiro:feat/compact-pepper-logo

Conversation

@josemonteiro

Copy link
Copy Markdown
Contributor

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 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.

Checklist

  • I have read CONTRIBUTING.md and agree to the CLA
  • This PR links to an open issue above
  • Tests pass locally (pnpm run test)
  • Lint passes (pnpm run check)
  • Documentation updated if behavior changed

Test note: the 30 failing tests in src/extensions/permissions, src/extensions/plannotator, and src/modes/acp fail identically on the merge-base (6595fbe8) — pre-existing breakage unrelated to this change. All logo tests pass (68/68), and pnpm run check is clean apart from one pre-existing biome warning in an unrelated test file.

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>
@josemonteiro josemonteiro added the new feature Introduces a new feature label Sep 3, 2026
@kimchi-review

kimchi-review Bot commented Sep 3, 2026

Copy link
Copy Markdown

Kimchi Code Review

Property Value
Commit 592bf74
Author @josemonteiro
Files changed 3
Review status Completed
Comments 0
Duration 162s

Summary

📊 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! 🎉

What to expect

Kimchi will analyze the changes in this pull request and post:

  • A summary of the overall changes
  • Inline comments on specific lines with findings categorized by issue type

The review typically completes within a few minutes. This comment will be updated once the review is ready.

Interact with Kimchi
  • @getkimchi review — re-trigger a full review on the latest commit
  • @getkimchi summary — regenerate the PR summary
  • @getkimchi ignore — skip this PR (no review will be posted)
  • Reply to any inline comment to ask follow-up questions or request clarification
Configuration

Reviews are configured by your organization admin.
Review instructions, excluded directories, and severity thresholds can be adjusted per repository in the Kimchi dashboard.


Powered by Kimchi — AI-powered code review by CAST AI

@kimchi-review kimchi-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 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! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Introduces a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant