Show a single > marker in the composer instead of a repeating | - #122
Merged
Conversation
The active composer reused the transcript's per-row gutter glyph (currently "▎", falling back to "│"/"|" on limited encodings), which repeats on every wrapped or explicit-newline row of a multi-line draft. That's the right call for submitted transcript messages (it marks each line as belonging to that message), but for the composer itself it reads as one prompt marker per line rather than one prompt. Give the composer its own glyph, a plain ">" that needs no encoding fallback, shown only on the buffer's true first visual row. Continuation/wrapped rows get blank padding of the same width instead, so wrapped text still aligns without repeating the marker. The transcript's gutter (crates/forge-tui/src/user_message_gutter.rs's existing PRIMARY_GLYPH/fallback logic and its extensive per-row test coverage) is untouched -- this only changes GutterRole::Active rendering in widgets/input.rs, plus the width calculation in app/render.rs that already assumed a fixed-width prefix. Since click-to-cursor and copy-buffer math in composer_layout.rs key off gutter_prefix_width (a constant), not literal glyph text per row, keeping the prefix width identical between the marker row and the blank-padded rows means none of that logic needed to change. Updates the input.rs test suite for the new per-row semantics (marker on row 0 only) and removes the now-inapplicable composer fallback-glyph test, since ">" needs no such fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
▎, falling back to│/|), which repeats on every wrapped or explicit-newline row of a multi-line draft — one marker per line instead of one marker for the prompt.>shown only on the buffer's true first visual row. Continuation/wrapped rows get blank padding of the same width instead, so wrapped text still lines up without the marker repeating.user_message_gutter.rs'sPRIMARY_GLYPH/fallback logic, and its extensive per-row test coverage) is untouched — this only changesGutterRole::Activerendering inwidgets/input.rs, plus the composer-width calculation inapp/render.rsthat already assumed a fixed-width prefix.click_to_cursor/copy-buffer math incomposer_layout.rskeys offgutter_prefix_width(a constant), not literal glyph text per row — since the marker row and blank-padded rows keep the exact same prefix width, none of that math needed to change.Test plan
cargo test --package forge-tui— 670/670. Updated the composer test suite for the new per-row semantics (renamed/rewrote the tests that asserted a glyph on every row to assert it on row 0 only, e.g.wrapped_input_has_gutter_only_on_first_row,explicit_newlines_have_gutter_only_on_first_row), and removed the now-inapplicable composer fallback-glyph test (>is plain ASCII, needs no encoding fallback).cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --all-targets --locked— all clean.> Describe a task…; a long line that word-wraps shows>on the first visual row and blank-padded alignment (no|) on the wrapped continuation row.