Repository navigation
fix(tui): drop the /statusline picker's padding rows when the list doesn't fit - #7025
Conversation
…esn't fit The /statusline card keeps a blank padding row above and below its content at every size, so when the frame is too short for all eleven items those two rows are spent on chrome while items scroll out of view. At 40x12 the card is 10 rows: border 2, padding 2, header 2 and footer 2 leave room for just Mode and Model. At 60x16 six items show, and at 80x19 Git branch is cut off although the list would fit without the padding. Keep the vertical padding only when the padded card fits the frame; otherwise size the card without it. Horizontal padding is unchanged, so the footer wraps at the same width. 40x12 now shows four items, 60x16 eight, and 80x19 all eleven. Row hitboxes are recorded from the content area, so mouse clicks still land on the painted row. Sizes where the list fits, such as 80x24 and 100x32, render as before. Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Hmbown
left a comment
There was a problem hiding this comment.
🤖 This review is from Claude Opus 5.5, an AI agent working on behalf of the Codewhale maintainers. It is posted through @Hmbown's account, but Hunter did not write it.
Thanks @Lstarsky0, and thanks for following up #7022. The before/after captures at 40×12, 60×16 and 80×19 made this easy to check, and I went through the arithmetic:
- Padded case: when the padded card fits, the height is rows + 6 + footer, as before, so 80×24 and up render the same.
- Unpadded case: otherwise the card asks for rows + 4 + footer, which gives back the two rows and shows all eleven items at 80×19.
- Fit test:
area.height - 2matches theavail_heightthatcentered_modal_areaclamps to. - Footer: it is still measured at
popup_width - 4, which equalsinner.widthbecause horizontal padding is unchanged. - Hitboxes: they come from the content area, so clicks still land on the painted row. The existing 40×12 mouse test covers that path.
- CI: green, including Test on Ubuntu, macOS and Windows.
LGTM. One optional nit: the fit test repeats centered_modal_area's 2-cell margin. Asking the helper would follow it if that margin ever changes: let padded = unpadded_height + 2; let pad = u16::from(centered_modal_area(area, 64, padded, 40, 8).height >= padded);. It doesn't block merging.
— Written by Claude Opus 5.5 (AI agent) on behalf of the maintainers.
What and why
The /statusline card keeps a blank padding row above and below its content at every size. When the frame is too short for all eleven items, those two rows go to chrome while items scroll out of view. At 40×12, before:
After:
The card keeps its vertical padding only when the padded card fits the frame; otherwise it's sized without it. Horizontal padding stays, so the footer still wraps at the width
footer_rowsis computed for. 60×16 goes from six items to eight, and at 80×19, where Git branch used to be cut off, all eleven now show. Row hitboxes are recorded from the content area, so they move with it. Where the list fits, as at 80×24 and 100×32, nothing changes.Issue
No-Issue: /statusline spends its padding rows on chrome when items don't fit, no issue filed for it
How I tested it
cargo fmt --all -- --check,cargo clippy -p codewhale-tui --all-targets --all-featureswith CI's flags, andcargo check -p codewhale-tui --all-targets: clean. Clippy also on 1.99, pluscargo +1.89.0 check -p codewhale-tui.cargo nextest run -p codewhale-tui --lib: 15349 passed, none failed, including the status picker tests at the blocker sizes and the 40×12 mouse test.Checklist
maincargo fmt --allpasses, and tests cover new or changed behaviordocs/features.toml(cargo test -p codewhale-tui --test feature_registrychecks it) — n/a