Skip to content

fix(tui): drop the /statusline picker's padding rows when the list doesn't fit - #7025

Merged
Hmbown merged 1 commit into
codewhale-hq:mainfrom
Lstarsky0:ux/statusline-compact-rows
Oct 19, 2026
Merged

Hmbown merged 1 commit into
codewhale-hq:mainfrom
Lstarsky0:ux/statusline-compact-rows

Conversation

@Lstarsky0

Copy link
Copy Markdown
Contributor

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:

 ┌ Status line ───────────────────────┐
 │                                    │
 │ Choose what the footer shows:      │
 │                                    │
 │  ▸ [✓] Mode  (plan · work ·…)      │
 │    [✓] Model  (the model id…)      │
 │  Space toggle   a all   n none     │
 │  Enter save   Esc cancel           │
 │                                    │
 └────────────────────────────────────┘

After:

 ┌ Status line ───────────────────────┐
 │ Choose what the footer shows:      │
 │                                    │
 │  ▸ [✓] Mode  (plan · work ·…)      │
 │    [✓] Model  (the model id…)      │
 │    [✓] Context window %  (tokens…) │
 │    [✓] Session cost  (running…)    │
 │  Space toggle   a all   n none     │
 │  Enter save   Esc cancel           │
 └────────────────────────────────────┘

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_rows is 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

  • Ran a debug build in a pseudo-terminal with an empty HOME and opened /statusline at 40×12, 60×16, 80×19, 80×20, 80×24 and 100×32, with this change and with a build of d5f6699. 80×24 and 100×32 are byte-identical before and after, and 80×20 keeps its padding. At 40×12, End then a click on the Workspace row toggles Workspace.
  • cargo fmt --all -- --check, cargo clippy -p codewhale-tui --all-targets --all-features with CI's flags, and cargo check -p codewhale-tui --all-targets: clean. Clippy also on 1.99, plus cargo +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

  • One focused change, on d5f6699; it merges cleanly into current main
  • cargo fmt --all passes, and tests cover new or changed behavior
  • If this adds or changes a user-facing feature, I updated its docs and its row in docs/features.toml (cargo test -p codewhale-tui --test feature_registry checks it) — n/a

…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>
@Lstarsky0
Lstarsky0 requested a review from Hmbown as a code owner October 19, 2026 03:59

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T04:03:57.006895Z db04c38 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm label Oct 19, 2026

@Hmbown Hmbown left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 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 - 2 matches the avail_height that centered_modal_area clamps to.
  • Footer: it is still measured at popup_width - 4, which equals inner.width because 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.

@Hmbown
Hmbown merged commit 0004ed1 into codewhale-hq:main Oct 19, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants