Repository navigation
fix(ui): fit the review panel and next-steps box to narrow terminals - #14
Merged
Merged
Conversation
Below about 60 columns the review's right edge wrapped onto the next line. reviewLines() floored its wrap width at 40 columns no matter how narrow the terminal, never fitted the title, and the next-steps box was sized only to its content. The old test checked the review body against the width but not the frame note() draws around it. rail.ts now exports the frame widths it draws (NOTE_FRAME, NOTE_TITLE_FRAME, BOX_FRAME), and callers fit to them: - the review body wraps to columns - frame - label (unchanged at 80+ columns: the interactive session is identical at 80, 96 and 120); - title facts (kind, edition, licence) that don't fit move to the top of the panel instead of being cut, and an over-long name is clipped; - the next box drops its # notes first, then its frame, rather than draw an edge that wraps. The new test renders the whole framed output at 30-120 columns in both glyph sets and fails on the old code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W2BaQmV2uiGiqUHSfS6KUH
Review follow-ups: box() takes an optional compact line list and owns the whole fallback (full -> compact -> unboxed), so cli.ts no longer repeats its fit test, and box() measures its content once. The review's label column is derived from the sections again instead of a copied list of their names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W2BaQmV2uiGiqUHSfS6KUH
lnorton89
commented
Nov 17, 2026
lnorton89
left a comment
Contributor
Author
There was a problem hiding this comment.
Code review
Five findings on 6a9b08a: three fixed in 3010ceb, two skipped on purpose.
| Finding | Outcome |
|---|---|
The review's label width came from a hand-copied list of section names, so it could drift from sections |
Fixed: derived from sections again |
cli.ts repeated box()'s fit rule to decide whether to drop the notes |
Fixed: box() takes an optional compact line list and owns the whole fallback (full → compact → unboxed) |
box() measured its content twice |
Fixed |
| Still overflows below ~22–26 columns | Skipped: the 12-column label plus frame can't fit there; the test covers 30 columns up |
The --yes summary inherits the title split though it has no frame |
Skipped: cosmetic, and every fact is still shown |
The new test also asserts the box keeps its frame exactly when the compact lines fit. CI: 32/32 green on 3010ceb. Locally: 54/54, and the interactive session is still identical to main at 80 and 120 columns.
Generated by Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Below about 60 columns the interactive review panel's right edge wrapped onto the next line, and the next-steps box overflowed under about 75. I found this while comparing screens for #13; it happens on both clack versions.
Root cause
reviewLines()floored its wrap width at 40 columns however narrow the terminal was, thennote()added 18 columns of label and frame around it.name · kind · Rust 2024 · licence) was never fitted.box()was sized only to its content (cargo clippy --all-targets -- -D warnings # the lint gate CI runs).Fix
src/ui/rail.tsexports the frame widths it draws (NOTE_FRAME,NOTE_TITLE_FRAME,BOX_FRAME), and callers fit to them:columns − frame − label. At 80+ columns this is the same number as before.# notesfirst, then its frame, so it never draws an edge that wraps.Test plan
note()andbox()) at 30, 40, 44, 50, 58, 60, 80, 100 and 120 columns, in both glyph sets, for a GUI, a workspace with a long name plus--bin, and a library. It checks every line fits and no title fact is lost. It fails on the old code (a 58-column line at 30 columns).npm run typecheck && npm test: 54/54mainat 80, 96 and 120 columns. At 44 columns the review now draws a complete 44-column frame.Generated by Claude Code