Skip to content

Grow the prompt popup with wrapped text so the typed tail stays visible - #112

Merged
MJohnson459 merged 1 commit into
mainfrom
prompt-popup-wrapped-height
Aug 1, 2026
Merged

Grow the prompt popup with wrapped text so the typed tail stays visible#112
MJohnson459 merged 1 commit into
mainfrom
prompt-popup-wrapped-height

Conversation

@MJohnson459

Copy link
Copy Markdown
Contributor

Size the prompt popup from its wrapped text, not its newlines

The text-prompt popup (Mode::Prompt — refine notes, questions, rejection
feedback) computed its height by counting \n-separated lines in the buffer.
Typed input never contains a newline, since Enter submits, so the box stayed
three rows tall while the Paragraph's Wrap { trim: false } wrapped anything
past ~70 characters below the single visible row — hiding both the tail being
typed and the cursor.

crates/voro/src/ui.rs now measures the popup with
Paragraph::line_count(inner_width) (the workspace already enables ratatui's
unstable-rendered-line-info), which counts wrapped rows and explicit newlines
alike, so pre-seeded multi-line RejectWork buffers (DESIGN.md §11c) still size
correctly. Width (72) and the 3..=20 height clamp are unchanged. When the
wrapped text exceeds the clamp the paragraph scrolls by the overflow so the
bottom — the cursor end — stays visible, rather than letting the same bug recur
for very long text. No keybinding or editing-model changes; Mode::LinkPr is
untouched.

Verified: two new TestBackend render tests in ui.rs — one asserts a
single-line buffer wider than the popup shows both its head and its
TAILMARK▏ tail, the other that a buffer wrapping past the height clamp shows
the tail and no longer the head. Both fail against the previous rendering and
pass after the change. cargo test --workspace (281 + 273 tests) and
cargo clippy --workspace --all-targets -- -D warnings pass; cargo fmt --all --check is clean.

The text-prompt popup measured its height by counting `\n`-separated
lines, but typed input never contains a newline — Enter submits — so a
refine note, question, or rejection past the popup's 70-column inner
width wrapped below the single visible row, hiding both the tail and the
cursor.

Measure with `Paragraph::line_count` at the popup's inner width instead,
which counts wrapped rows and explicit newlines alike, so pre-seeded
multi-line RejectWork buffers still size correctly. Past the 20-row
clamp the paragraph scrolls to the bottom, keeping the cursor end in
view rather than reintroducing the bug for very long text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WKZGWmsroAvj47g2PjPYK4
@MJohnson459
MJohnson459 merged commit ffab33b into main Aug 1, 2026
6 checks passed
@MJohnson459
MJohnson459 deleted the prompt-popup-wrapped-height branch August 1, 2026 20:02
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