You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix NO_COLOR on TUI detail screens and add ROBOREV_COLOR_MODE env var (#566)
## Summary
- Fix `NO_COLOR=1` not working on TUI review/prompt detail screens
(glamour was ignoring it)
- Add `ROBOREV_COLOR_MODE` env var (`auto`|`dark`|`light`|`none`) for
explicit TUI color theme control
- Apply color mode to both glamour (markdown) and lipgloss
(AdaptiveColor) layers
- `NO_COLOR` takes precedence over `ROBOREV_COLOR_MODE` at all layers
## Problem
glamour's `NewTermRenderer` defaults to `TrueColor` profile regardless
of `NO_COLOR`. The main queue screen (lipgloss only) correctly respected
`NO_COLOR`, but review/prompt detail screens (glamour-rendered markdown)
always emitted ANSI color sequences.
Additionally, there was no way to force a dark/light theme when terminal
background auto-detection failed.
## Changes
### Core fix
- Pass `glamour.WithColorProfile()` to all `glamour.NewTermRenderer`
calls in both `cmd/roborev/tui/helpers.go` and
`internal/streamfmt/render.go`
- Fix `stripTrailingPadding`/`StripTrailingPadding` to skip the
`\x1b[0m` reset suffix in no-color mode
### ROBOREV_COLOR_MODE env var
- `auto` (default): auto-detect terminal background
- `dark`: force dark color palette
- `light`: force light color palette
- `none`: strip all colors (same as `NO_COLOR=1`)
### Lipgloss integration
- Call `lipgloss.SetHasDarkBackground()` / `lipgloss.SetColorProfile()`
in TUI startup so `AdaptiveColor` styles on the queue screen also
respect the env var
- Check `NO_COLOR` first to ensure it always takes precedence
### Consolidation
- Remove duplicate `resolveColorMode()` from TUI helpers; delegate to
`streamfmt.GlamourStyle()` + `streamfmt.ResolveColorProfile()`
- Update `GlamourStyle()` to check `NO_COLOR` (previously skipped,
causing unnecessary terminal background queries)
### Documentation
- Add `ROBOREV_COLOR_MODE` and `NO_COLOR` to README.md, AGENTS.md, and
CLAUDE.md
## Testing
- All existing tests pass (`go test ./...`)
- New tests: `TestResolveColorProfile`,
`TestRenderMarkdownLinesNoColor`, `TestGlamourStyleRespectsColorMode`
with proper dark/light style differentiation
- Manual testing confirmed: `NO_COLOR=1`, `ROBOREV_COLOR_MODE=none`,
`=dark`, `=light` all work on both queue and detail screens
---------
Co-authored-by: Sergey Trofimovsky <sergey.trofimovsky@trulioo.com>
Co-authored-by: Wes McKinney <wesmckinn+git@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
// Long prose lines should be word-wrapped by glamour, not truncated.
305
306
// All words must appear in the rendered output.
306
307
longProse:="This is a very long prose line with important content that should be word-wrapped by glamour rather than truncated so that no information is lost from the rendered output"
0 commit comments