feat(tui): role-colored gutter, delete-from-index, escape stripping, richer headers#113
Open
jugrajsingh wants to merge 4 commits into
Open
feat(tui): role-colored gutter, delete-from-index, escape stripping, richer headers#113jugrajsingh wants to merge 4 commits into
jugrajsingh wants to merge 4 commits into
Conversation
…ing pane The DarkGray background fill on the selected message force-painted every span's background, clobbering per-span foreground styling. Replace it with a leading `▌ ` gutter in the message's role color (two-space lead on unselected messages keeps columns aligned), so span colors survive intact — important ahead of markdown/syntect rendering. Body wrap width drops by GUTTER_WIDTH in both the renderer and viewing_pane row math so scroll offsets stay consistent.
Ctrl+X in Search (list focused) or Viewing stages the selected session for deletion behind a red-bordered y/N confirm popup. Confirming calls Store::delete_session_data to remove the index row (message_vec + sessions cascade); the on-disk source file is untouched and will re-index on next sync. Cancelling restores the invoking mode.
Replace the naive control-char filter with a state machine that walks each escape sequence to its proper terminator: CSI to its final byte (0x40..=0x7e), OSC/DCS/SOS/PM/APC strings to BEL or ST. Covers both the 7-bit ESC-prefixed introducer classes and their 8-bit C1 equivalents (0x90/0x98/0x9b/0x9d/0x9e/0x9f), since some sources emit raw C1 bytes without an ESC prefix. An unterminated sequence at EOF drops the rest of the input rather than leaking partial escape bytes into the rendered text. Wired into both the copy path and the render path so pasted/rendered content can't smuggle terminal control sequences.
jugrajsingh
force-pushed
the
feat/tui-polish
branch
from
July 21, 2026 07:59
cd4293c to
e91ae41
Compare
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
Four TUI polish items, bundled as one review pass over the same rendering surface:
DarkGraybackground fill on the selected message force-painted every span's background, clobbering per-span foreground styling. Replaced with a leading▌gutter in the message's role color (two-space lead on unselected messages keeps columns aligned), so span colors survive selection intact. Important groundwork ahead of markdown/syntect rendering, where span styling carries more information. Body wrap width drops byGUTTER_WIDTHin both the renderer and the viewing-pane row math so scroll offsets stay consistent with what's drawn.Store::delete_session_datato remove the index row (message_vec+sessions, cascading); the on-disk source file is untouched and will re-index on next sync unless the source is excluded. The confirm popup wording says exactly that — "removed from index, file kept on disk, will resync" — rather than implying deletion of the underlying file. Cancelling restores the invoking mode.0x40..=0x7e), OSC/DCS/SOS/PM/APC strings to BEL or ST. Covers both the 7-bit ESC-prefixed introducer classes and their 8-bit C1 equivalents (0x90/0x98/0x9b/0x9d/0x9e/0x9f), since some sources emit raw C1 bytes without an ESC prefix. An unterminated sequence at EOF drops the rest of the input rather than leaking partial escape bytes into rendered text. Wired into both the copy path and the render path, so neither pasted nor rendered content can smuggle terminal control sequences into the user's terminal.Verification
cargo build,cargo fmt -- --check,cargo test --workspace— green.Test plan