Skip to content

fix(tui): remove extra spacing between message area and composer - #178

Merged
wangtsiao merged 2 commits into
7df-lab:mainfrom
ch4xer:fix/tui-composer-spacing
Aug 4, 2026
Merged

fix(tui): remove extra spacing between message area and composer#178
wangtsiao merged 2 commits into
7df-lab:mainfrom
ch4xer:fix/tui-composer-spacing

Conversation

@ch4xer

@ch4xer ch4xer commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the 3-line gap between the message output area and the composer (dialog box) in the TUI.

Root Cause

Three issues in crates/tui/src/chatwidget/render.rs:

  1. desired_height added +2 extra rows — the viewport was always 2 rows taller than the actual content sum
  2. Bottom pane height clamping saturating_sub(1) — shaved 1 row off the bottom pane even when the viewport was exactly sized
  3. Constraint::Min(1) for history arena — forced at least 1 empty row even with no messages, because this ratatui fork guarantees Min constraints their minimum

Changes

  • Use exact Constraint::Length(history_height) computed from actual viewport line count instead of Constraint::Min(1)
  • Remove + 2 padding in desired_height
  • Remove saturating_sub(1) clamping on bottom height

The three changes work together to ensure viewport height exactly equals the sum of content heights with no leftover blank rows.

🤖 Generated with Claude Code

ch4xer and others added 2 commits August 4, 2026 14:07
Use exact Length constraints with actual viewport line counts instead
of Constraint::Min(1) which forced an extra blank row in the history
area. Remove the +2 padding in desired_height and the saturating_sub(1)
clamping in chat_layout_areas so the viewport height is always exactly
the sum of content heights with no leftover blank rows.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@wangtsiao
wangtsiao merged commit 384ceae into 7df-lab:main Aug 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants