Skip to content

TUI: bottom-align smith chats with fixed input pane (gapless)#395

Merged
edwin-zvs merged 1 commit into
mainfrom
tui-gapless-smith
Jun 8, 2026
Merged

TUI: bottom-align smith chats with fixed input pane (gapless)#395
edwin-zvs merged 1 commit into
mainfrom
tui-gapless-smith

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

This PR removes the visual gap between the smith prompt input (fixed bottom editor pane) and the last message when the history is shorter than the viewport.

What changes

  • Main view (render_sessions) and orchestrator panel now bottom-align short smith chats when:
    • The session is smith interactive (our editor pane is present), and
    • There is no user scrollback, and
    • The total rendered content is shorter than the chat viewport.
  • Non-smith PTY sessions and scrolled views are unchanged. Auto-pin to bottom remains for overflow.
  • Implementation: compute the content height via non_empty_row_span(vt100::Screen), then shift the paint rect within chat_area so the content hugs the input.
  • Parser sizing stays the same (full pane height for perf); only the painted window is shifted.

Why

  • Matches chat UX expectations and the user request: no wasted gap above the prompt in small / fresh conversations.
  • Keeps all existing perf/path invariants: no extra vt100 rebuilds; no behavior changes for shell/claude/codex.

Testing

  • cargo build ok locally.
  • Manual sanity across cases:
    • Short smith history with 1–2 lines → content bottom-aligned right above the editor pane.
    • Growing editor pane (multi-line input, completions) → content remains attached, no flicker.
    • Long history (overflow) → pinned to bottom as before.
    • Scrolled up → behavior unchanged; no bottom-align while scrolled.
    • Non-smith sessions (shell/codex/claude) → unchanged.

Follow-ups

  • Optional: unit test for non_empty_row_span and a tiny integration test that simulates a 1–2 line chat and verifies the painted region rows.

Assets

  • If helpful, I can add a short VHS recording showing before/after.

- For smith interactive sessions in the main pane and orchestrator panel,
  when the chat content is shorter than the viewport and not scrolled,
  render it bottom-aligned (no gap between last message and editor pane).
- Leave PTY harnesses and scrolled views unchanged; auto-pin remains.
- Implement non_empty_row_span() to measure content height from vt100 screen.
- Keep parser sizing the same; only shift the painted window within chat_area.
@edwin-zvs
edwin-zvs merged commit 93756b7 into main Jun 8, 2026
1 check passed
@edwin-zvs edwin-zvs mentioned this pull request Jun 16, 2026
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.

1 participant