Skip to content

fix(tui): keep the quote rail on wrapped rows of a blockquote - #7144

Merged
Hmbown merged 1 commit into
codewhale-hq:mainfrom
Lstarsky0:fix/quote-rail-on-wrapped-rows
Oct 29, 2026
Merged

Hmbown merged 1 commit into
codewhale-hq:mainfrom
Lstarsky0:fix/quote-rail-on-wrapped-rows

Conversation

@Lstarsky0

Copy link
Copy Markdown
Contributor

What and why

A blockquote draws its │ rail on its first row only and pads wrapped rows with blanks of the same width. At 60 columns, before:

● Notes:
▏
▏ │ A quoted line that is long enough to wrap twice when
▏   the terminal is only sixty columns wide, so the rail
▏   has to carry on.
▏
▏ │ │ A nested quote that also wraps at sixty columns
▏     because it keeps going for a while.
▏
▏ After the quote.

The assistant rail beside it carries on but the quote's stops, so a wrapped quote reads as one quoted line followed by ordinary text. After:

● Notes:
▏
▏ │ A quoted line that is long enough to wrap twice when
▏ │ the terminal is only sixty columns wide, so the rail
▏ │ has to carry on.
▏
▏ │ │ A nested quote that also wraps at sixty columns
▏ │ │ because it keeps going for a while.
▏
▏ After the quote.

The blanks were there for selection copy: continuation rows reported the rail width as copy_prefix_width because the transcript's rail-scan (compute_rail_prefix_width) doesn't strip spaces. That scan runs on every row and strips the │ spans there as it does on the first one, so every row now draws the same per-depth spans and reports copy_prefix_width: 0, which also removes the first-row branch. blockquote_wraps_with_continuation_rail_indent now expects the rail on each row; its width and re-join checks are unchanged.

Issue

No-Issue: a wrapped blockquote loses its rail after the first row; I searched and found no issue for it

How I tested it

  • Ran a debug build of this change and one of main at 588426d in a pseudo-terminal at 60 columns with an empty HOME and a local mock OpenAI-compatible server replying with a > and a >> quote; the rows above come from those runs.
  • Selection copy, checked before I rebased onto 588426d (which moves markdown_render.rs into codewhale-tui-kit without touching these functions): with a throwaway test (not part of this PR) that selects a wrapped > and >> quote at 24 columns and calls selection_to_text, both builds copy alpha beta gamma delta epsilon zeta eta theta iota kappa, with no rail characters.
  • cargo nextest run -p codewhale-tui -p codewhale-tui-kit --lib: 13880 of 13886 passed, with the 480 tests whose names match markdown, quote, selection or transcript among them. The 6 failures (status_public_output_and_read_only_state_match_baseline, golden_turn_events_match, model_visible_prefix_bytes_match_goldens, interrupted_session_deletion_keeps_recovery_incomplete_and_can_finish, worker_compacts_past_its_context_window_and_keeps_working, reasoning_effort_uses_one_strict_alias_table_and_legacy_fallback) also fail on main at 588426d without this change.
  • cargo fmt --all -- --check, cargo clippy -p codewhale-tui -p codewhale-tui-kit with CI's flags (also on 1.99), cargo check -p codewhale-tui -p codewhale-tui-kit --all-targets and cargo +1.89.0 check -p codewhale-tui -p codewhale-tui-kit: clean.

Checklist

  • One focused change, on 588426d; it merges cleanly into current main
  • cargo fmt --all passes, and tests cover new or changed behavior
  • If this adds or changes a user-facing feature, I updated its docs and its row in docs/features.toml (cargo test -p codewhale-tui --test feature_registry checks it) — n/a

A blockquote drew its │ rail on the first row only and padded wrapped
rows with blanks of the same width, so a quote that wrapped looked as if
it ended after one line while the assistant rail beside it carried on.
The blanks were there for selection copy: continuation rows reported the
rail width as copy_prefix_width because the transcript's rail-scan does
not strip spaces. That scan runs on every row and strips the │ spans
there as it does on the first one, so draw them on every row and report
0 throughout; copied text is unchanged.

blockquote_wraps_with_continuation_rail_indent now expects the rail on
each row.

Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
@Lstarsky0
Lstarsky0 requested a review from Hmbown as a code owner October 29, 2026 17:32

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T17:35:01.297725Z
We couldn’t complete this review. Comment @codex review to try again.
ca5051b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm label Oct 29, 2026
@Hmbown
Hmbown merged commit 9fc5c89 into codewhale-hq:main Oct 29, 2026
27 of 28 checks passed
Hmbown pushed a commit that referenced this pull request Oct 30, 2026
…kip ci]

Nine user-visible fixes landed on main today without an [Unreleased] line.
Adds Fixed entries for:
- #7095 save and recovery-checkpoint coalescing and reset-failure fixes
  (4d974f0, b42759e, c4a4f42, 6a08f03) and interrupted
  deletion retry (16d42ab), stating the original report is not yet
  reproduced;
- #7133 context inspector effective/zero threshold and disabled state
  (0bf3158, e908528);
- #7115 read-only doctor --probe-local credential check (14a5723);
- #7144 blockquote quote rail on wrapped rows, crediting @Lstarsky0 in the
  Fixed entry, the CHANGELOG Contributors block and docs/CONTRIBUTORS.md.

crates/tui/CHANGELOG.md regenerated with scripts/sync-changelog.sh;
sync-changelog --check passes; check-contributor-credit.py: 9 contributors
since v0.10.2 credited on all three surfaces; git diff --check clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants