Skip to content

fix(ui): readable send, approve, review and toolbar chips; say sent after a send - #190

Merged
backnotprop merged 2 commits into
mainfrom
fix/send-button-contrast
Nov 23, 2026
Merged

backnotprop merged 2 commits into
mainfrom
fix/send-button-contrast

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The Send button drew bold ANSI black (colour 0) on dark 256-colour backgrounds. Terminal themes remap colour 0, so the text often sat close to its background. After a send the button also kept reading Send 0 new ▸ target in the "sent" colour.

Colours

Every state now takes both its text and its background from the 256-colour cube or grey ramp (16-255), never from the 16 ANSI colours. Ratios are WCAG 2 contrast with xterm's 256-colour values.

State Before Ratio before After, dark After, light Ratio after
new notes bold 0 on 30 #008787 4.8 (pure black), 3.8 (#1e1e2e black) bold 16 on 37 #00afaf same 7.75
sent bold 0 on 22 #005f00 2.6, 2.1 194 #d7ffd7 on 22 #005f00 22 on 194 7.27
at a dialog bold 0 on 58 #5f5f00 3.1, 2.4 bold 16 on 214 #ffaf00 same 11.38
nothing to send dim ANSI grey on toolbar 238 / 252 light: 2.6 (#7f7f7f on 252) before DIM 250 on toolbar 238 239 on toolbar 252 5.13 / 5.39

New notes stay the loud teal call to action, sent is a quiet green (dark chip on a dark terminal, pale chip on a light one), a blocked agent is amber, and nothing to send is muted grey on the toolbar grey like the Review button. DIM is gone because terminals render it differently. The theme is read with theme::theme(), as the diff viewer already does.

Other chips (second commit)

The same fault was in other text we draw on a background we paint. All of these now take both colours from the 256-colour table, per theme:

Chip Before Ratio before After, dark After, light Ratio after
Approve bold ANSI 0 on 28 #008700 4.47 (pure black), 3.49 (#1e1e2e) bold 16 on 34 #00af00 same 7.13
Review ▾ ANSI cyan on toolbar dark 3.1 to 4.9, light 1.3 to 2.1, by palette 80 on 238 23 on 253 5.65 / 5.36
floating toolbar labels ANSI yellow / green / red on toolbar dark red 1.7 (xterm), light yellow 2.0, green 2.1 (macOS Basic) 221 / 114 / 217 on 238 58 / 22 / 124 on 253 dark 7.02 / 5.61 / 5.57, light 4.81 / 5.70 / 5.32
current search match ANSI 0 on 208 / 214 3.8 with a #45475a black 16 on 208 16 on 214 8.72 / 11.38
light cursor ANSI white on 238 palette-dependent (no fixed text) 231 on 238 9.74

The dark Review button changed too: ANSI cyan on 238 is only 3.1 to 3.3 with the macOS Basic or Solarized cyan. The light toolbar grey moves from 252 to 253, the darkest grey on which a dark amber comment label still reaches 4.5:1. The light nothing-to-send Send text is now 5.95 on 253. The text on these chips is not a [colors] role; the README says so next to toolbar.

ui::chips holds the per-theme colours. One table-driven test computes the contrast of every pair in both themes (the four Send states, Approve, Review, the three toolbar labels, and every palette style that fixes both its text and its background) and fails below 4.5:1 or on an ANSI colour. ui::send_button keeps a test that every Send state has its own background.

Labels

State Document (file/folder) review Code review Reply review
sent, agent Send 0 new ▸ T (E) → Sent ✓ ▸ T same Sent ▸ T → Sent ✓ ▸ T
sent, clipboard Copy 0 new → Copied ✓ same Copied → Copied ✓
at a dialog Send N new ▸ T (E) → T at a dialog · retry (E) unchanged T at a dialog · click to retry → T at a dialog · retry (E)

A new or edited note brings back Send N new ▸ T (E). Copied ✓ shows when this session's last send went to the clipboard, including the picker's copy row. If the notes went to an agent and the target is back to asking (or a reopened review's notes are already marked sent), the button shows Sent ✓. Tests cover both. E does what it did before. README, the crate README, docs/spec-herdr-integration.md and decision 13 in docs/decisions.md quote the new labels.

Checked

cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass locally. I ran the binary in a private tmux with a scratch HOME and data dir and a delivery command that writes to a file, then captured every state on the document and code review screens, a gated review's Approve button and the floating toolbar, in both themes.

Each state now takes its text and background from the 256-colour table instead of ANSI
black, which terminal themes remap, and holds at least 4.5:1 in the dark and light themes.
A unit test computes the ratio for every state and theme. Once everything is sent the button
reads 'Sent ✓ ▸ target' instead of 'Send 0 new', and a blocked agent reads the same on the
document and code review screens.
…st test for every chip

The Approve button, the Review menu button, the floating toolbar's labels, the current search
match and the light cursor drew ANSI colours on a background we paint. They now take both
colours from the 256-colour table, per theme, at 4.5:1 or more; ui::chips holds them and one
table-driven test checks every pair, the Send states included. The light toolbar grey moves
from 252 to 253 so its comment label can reach 4.5:1. After a copy the Send button says
Copied, and Sent when the notes went to an agent.
@backnotprop backnotprop changed the title fix(ui): readable send button in every state; say sent after a send fix(ui): readable send, approve, review and toolbar chips; say sent after a send Nov 23, 2026
@backnotprop
backnotprop added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 5c67640 Nov 23, 2026
3 checks passed
@backnotprop
backnotprop deleted the fix/send-button-contrast branch November 23, 2026 20:02
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