Skip to content

Show a single > marker in the composer instead of a repeating | - #122

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/composer-single-arrow-marker
Aug 1, 2026
Merged

Show a single > marker in the composer instead of a repeating |#122
github-actions[bot] merged 1 commit into
mainfrom
feat/composer-single-arrow-marker

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

  • The active composer reused the transcript's per-row gutter glyph (, 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.
  • Gave the composer its own glyph: a plain > 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.
  • The transcript's gutter (user_message_gutter.rs's 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 composer-width calculation in app/render.rs that already assumed a fixed-width prefix.
  • click_to_cursor/copy-buffer math in composer_layout.rs keys off gutter_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.
  • Live-verified against the real release binary: empty composer shows > 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.

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.
@github-actions
github-actions Bot enabled auto-merge (squash) August 1, 2026 13:57
@github-actions
github-actions Bot merged commit c9e7cf9 into main Aug 1, 2026
6 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.

1 participant