Skip to content

fix(cli): make onboard readable on light-background terminals#199

Merged
0xKT merged 2 commits into
mainfrom
feat/cli_light_dark_theme
Jul 23, 2026
Merged

fix(cli): make onboard readable on light-background terminals#199
0xKT merged 2 commits into
mainfrom
feat/cli_light_dark_theme

Conversation

@0xKT

@0xKT 0xKT commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

raven onboard was unreadable on light-background terminals: the palette was
hardcoded for a dark background and the CLI had no light/dark detection, so
near-white / bright-yellow text vanished on white (issue #169, reproduced on a
released build).

This adds raven/cli/_theme.py: light/dark detection (env RAVEN_THEME /
RAVEN_TERM_BACKGROUND hint / OSC 11 background probe / COLORFGBG, falling
back to dark) plus a scheme-aware palette, wired into the onboarding wizard and
the shared questionary style.

  • Dark rendering is byte-for-byte unchanged (dark token values are the current
    literals; verified by a rendering diff and a parity test).
  • Light values clear WCAG AA 4.5:1 on white; most mirror ui-tui/src/theme.ts.
  • Detection runs on first themed render, never at import, so plain raven ...
    commands do not probe the terminal.
  • Also drops two hardcoded white table columns (skill / cron) that were
    invisible on light backgrounds.

Scope is deliberately limited to what fails on light: named ANSI colors
(red/green/cyan...) elsewhere are terminal-adaptive and were left as-is.

Type

  • Fix

Verification

  • Relevant tests pass locally
  • Relevant lint / type checks pass locally
uv run pytest tests/test_cli_theme.py            # 44 passed (new)
uv run pytest tests/test_cli_onboard_commands.py # 64 passed
uv run pytest tests/test_cli_deep_research_commands.py \
  tests/test_cli_skill_commands.py tests/test_cli_cron_commands.py \
  tests/test_cli_smoke.py                        # 142 passed
uv run ruff check / ruff format --check          # clean

Note for reviewers: the OSC 11 terminal probe can only be exercised on a real
TTY (not in CI). Please confirm on a light-background terminal that
raven onboard is now legible, and on a dark terminal that it is unchanged
(RAVEN_THEME=dark / RAVEN_THEME=light force a scheme).

Risk

  • Security impact considered
  • Backward compatibility considered
  • Rollback path is clear for risky changes

Dark output is unchanged; the new env vars are additive; rollback is a single
commit revert.

Related Issues

Closes #169

@0xKT
0xKT requested review from arelchan and silverLXT July 23, 2026 08:38
0xKT and others added 2 commits July 23, 2026 17:48
Detect terminal light/dark (env override, background hint, OSC 11 probe,
COLORFGBG, fallback dark) and apply a scheme-aware palette so onboard text
is legible on white; dark rendering is byte-for-byte unchanged. Also drop
two hardcoded white table columns (skill/cron) invisible on light backgrounds.

Co-authored-by: Claude (claude-opus-4-8) <noreply@anthropic.com>
GNU screen neither answers the OSC 11 background query nor swallows it, so
the probe bytes echo as visible garbage on the first onboard render. Default
tmux is TERM=screen-256color and cannot answer a bare query either. Gate the
probe on TERM so both fall back to COLORFGBG/dark cleanly.

Co-authored-by: Claude (claude-opus-4-8) <noreply@anthropic.com>
@0xKT
0xKT force-pushed the feat/cli_light_dark_theme branch from ea5896a to 0927674 Compare July 23, 2026 09:50
@silverLXT

silverLXT commented Jul 23, 2026

Copy link
Copy Markdown
验收

great

@silverLXT silverLXT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

@0xKT
0xKT merged commit 7df4560 into main Jul 23, 2026
8 checks passed
@0xKT
0xKT deleted the feat/cli_light_dark_theme branch July 23, 2026 12:53
@0xKT 0xKT mentioned this pull request Jul 23, 2026
12 tasks
0xKT added a commit that referenced this pull request Jul 23, 2026
## Summary

Bump the package version from 0.1.8 to 0.1.9 (patch release). All five
PRs merged since v0.1.8 are fixes, no new features:

- #204 fix: add configurable llm_call_timeout to bound stalled LLM calls
- #199 fix(cli): make onboard readable on light-background terminals
- #189 fix(cli): pick the first node >= 22 across all PATH entries
- #196 fix(commitlint): unify commit/PR length to header-max-length
- #190 fix(tui): surface the real turn-failure detail, not just the code

## Type

- [ ] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [x] Other

## Verification

- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed

Bump is limited to `pyproject.toml` and `uv.lock` (`uv lock` sync).
Commit message lint passes locally.

## Risk

- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes

Version-only change; no code or behavior change.

## Related Issues

N/A

Co-authored-by: Claude (claude-opus-4-8) <noreply@anthropic.com>
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.

fix: raven onboard text invisible on light-background terminals

2 participants