Skip to content

feat(tui): tint the user's own turns in the transcript - #492

Merged
emal-avala merged 1 commit into
mainfrom
feat/tui-message-backgrounds
Jul 25, 2026
Merged

feat(tui): tint the user's own turns in the transcript#492
emal-avala merged 1 commit into
mainfrom
feat/tui-message-backgrounds

Conversation

@emal-avala

Copy link
Copy Markdown
Member

Summary

User turns render with no background tint, so scanning back through a long transcript there is nothing distinguishing what you typed from what the model said. Peer terminal agents tint the user's own input; we didn't.

The cause: three dead theme slots

The theme already derives these from the active palette:

user_message_bg:   mix(p.blue,   p.bg, 0.88),
bash_message_bg:   mix(p.green,  p.bg, 0.90),
memory_message_bg: mix(p.purple, p.bg, 0.90),

…and nothing consumed any of them. The renderer painted user turns with a hardcoded Color::White foreground and no background at all — the same "built but never wired" pattern as the unused word-diff colours and the parsed-then-discarded hyperlinks.

What changed

  • Apply the tint across the whole user line (marker + body + one trailing cell, so the highlight reads as a block rather than stopping flush against the last glyph).
  • The prefix selects the tint, which is exactly what the three slots were designed for per their doc comments: a plain prompt, a ! shell passthrough, and a # memory note are different kinds of input and now read differently.
  • The marker is stripped from the body instead of being duplicated (!ls -la previously rendered the ! twice).
  • Foreground now comes from the theme instead of a hardcoded colour, so the line participates in colour degradation on limited-colour terminals like everything else.

Verification

  • Three unit tests: every span after the gutter is tinted; the three input kinds get distinct tints; the marker isn't duplicated into the body.
  • Driven live in the TUI and verified at the escape-sequence level — the emitted line now carries 48;5;… (background) across the marker and text with a themed 38;5;… foreground, where before it had no background and a hardcoded white.
  • cargo test, clippy --all-targets -- -D warnings, fmt --check all clean.

The theme derives user_message_bg, bash_message_bg and memory_message_bg
from the active palette, but nothing ever read them: user turns rendered
with a hardcoded white foreground and no background, so a prompt was
visually identical to model output when scanning back through a session.

Apply those slots. The prefix picks the tint, matching the slots' intent —
a plain prompt, a `!` shell passthrough and a `#` memory note read as
different kinds of input — and the marker is no longer duplicated into the
body. Foreground now comes from the theme rather than a hardcoded colour,
so the line degrades with everything else on limited-colour terminals.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@emal-avala
emal-avala merged commit 9be836b into main Jul 25, 2026
14 of 15 checks passed
@emal-avala
emal-avala deleted the feat/tui-message-backgrounds branch July 25, 2026 08:14
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