Skip to content

Add /contrast: a heavier, brighter rule for pane 0's control block - #78

Merged
glenjbarber merged 1 commit into
mainfrom
ui/high-contrast-rules
Oct 12, 2026
Merged

glenjbarber merged 1 commit into
mainfrom
ui/high-contrast-rules

Conversation

@glenjbarber

Copy link
Copy Markdown
Owner

Summary

Glen uses macOS accessibility features at night and found "more contrast borders" in Windows helps immensely for visibility; this is the same idea applied to pane 0's own top/bottom rules from #75/#76.

/contrast on swaps the rule's glyph from a single line (─) to a double line (═) and draws it bold and bright white instead of the terminal's default dim foreground - a stronger visual edge, not just a different color. The color escape is computed from the plain rule text first, the same discipline the spectrum bars in #77 established, so the added escape bytes are never mistaken for display width by the row-counting math this file has fought hard to keep correct.

Wiring

Mirrors /color end to end, since it's the closest existing precedent for a persisted session/config toggle:

  • Session.Options.HighContrast + Session.SetHighContrast
  • config.Config.HighContrast (high_contrast JSON key) + a byte-preserving config.WriteHighContrast writer, same style as WriteColor
  • --high-contrast CLI flag, plus a startup report line
  • /contrast command (on/off/report, saves to the active configuration file), registered in the dispatcher and the command-help table
  • A test mirroring TestColorSetsTheSessionAndSavesTheChoice

Verification

gofmt -l . clean, go build ./... and go vet ./... pass, make test is green (including the new /contrast test). Verified in a real tmux pane with pipe-pane capturing raw bytes: with high contrast on from startup, both rules render as ═ and the \x1b[1;97m bold/bright-white escape appears around each one.

Test plan

  • make test passes
  • TestContrastSetsTheSessionAndSavesTheChoice covers the save path
  • tmux verification of the glyph swap and the color escape

🤖 Generated with Claude Code

https://claude.ai/code/session_01SQbqTt3wQsPbN6fbaryxkM


Generated by Claude Code

Glen uses macOS accessibility features at night and found "more contrast
borders" in Windows helps immensely; this is the same idea for pane 0's
own top/bottom rules from #75/#76.

/contrast on swaps the rule's glyph from a single line ("─") to a double
line ("═") and draws it bold and bright white instead of the terminal's
default dim foreground - a stronger visual edge for a reader who needs
one, not just a colour change. The colour escape is computed from the
plain rule text, same discipline as the spectrum bars in #77, so the
added bytes are never mistaken for display width by the row-counting
math.

Wired the same way /color already is, end to end: a Session.Options
field and SetHighContrast method, a config.Config member with its own
byte-preserving WriteHighContrast writer, a --high-contrast flag, a
startup report line, and a /contrast command (on/off/report, saves to
the configuration file) with a test mirroring /color's own.

Verified in a real tmux pane with pipe-pane capturing raw bytes: with
high contrast on from startup, both rules render as "═" and the
bold/bright-white escape (\x1b[1;97m) appears around each one. gofmt,
go vet, and make test all pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SQbqTt3wQsPbN6fbaryxkM
@glenjbarber
glenjbarber marked this pull request as ready for review October 12, 2026 03:24
@glenjbarber
glenjbarber merged commit e569505 into main Oct 12, 2026
1 check passed
@glenjbarber
glenjbarber deleted the ui/high-contrast-rules branch October 12, 2026 03:24
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.

2 participants