Skip to content

fix(tui): improve color contrast for light-background terminals#38636

Closed
ademczuk wants to merge 1 commit intoopenclaw:mainfrom
ademczuk:fix/tui-color-contrast-light-themes
Closed

fix(tui): improve color contrast for light-background terminals#38636
ademczuk wants to merge 1 commit intoopenclaw:mainfrom
ademczuk:fix/tui-color-contrast-light-themes

Conversation

@ademczuk
Copy link
Copy Markdown
Contributor

@ademczuk ademczuk commented Mar 7, 2026

Summary

This PR enhances the color contrast for syntax highlighting in light-background terminals. It introduces a new parameter to the createSyntaxTheme function to support light themes, ensuring better visibility and adherence to accessibility standards. [HIGH_CONFIDENCE]

Type: fix [HIGH_CONFIDENCE]

Key Changes

  • Added support for light theme in the createSyntaxTheme function.
  • Implemented logic to detect light backgrounds based on environment variables.
  • Updated tests to cover light background detection scenarios.

Testing

Verify the changes by running the application in both light and dark terminal backgrounds. Check that the syntax highlighting colors are appropriate for each mode and that the light mode is correctly detected based on the environment variables.


Original Description

Summary

  • Problem: TUI colours are hardcoded for dark terminals. Users with light-theme terminals (iTerm2 Solarized Light, Windows Terminal Light, VS Code Light) get invisible or near-invisible text, with contrast ratios as low as 1.2:1 against white backgrounds (WCAG AA requires 4.5:1).

  • Why it matters: All light-theme terminal users have degraded readability. Affects text, syntax highlighting, status indicators, and tool output.

  • What changed: Added light/dark palette detection + WCAG AA-compliant light palette + light syntax theme. 3 files, 167 lines, all in src/tui/theme/.

  • What did NOT change: Dark theme is identical. lightMode defaults to false, selecting the unchanged dark palette. No consumer code changes. No behavioural changes.

Visual Verification

TUI Theme Comparison — Windows 11

Three panels rendered with exact hex values from darkPalette and lightPalette:

  • BEFORE (left): Dark palette on white — text invisible (~1.1:1 contrast)
  • AFTER (center): Light palette on white — all text readable (≥4.5:1, WCAG AA)
  • UNCHANGED (right): Dark palette on dark — no regression

Change Type

  • Bug fix

Scope

  • TUI / CLI

Linked Issue/PR

User-visible / Behavior Changes

Users with light-background terminals will see properly contrasted text when OPENCLAW_THEME=light is set or COLORFGBG env var indicates a light background. Dark terminal users see zero change.

How It Works

Detection (src/tui/theme/theme.ts)


OPENCLAW_THEME=light    light palette (explicit override)

OPENCLAW_THEME=dark     dark palette (explicit override)

COLORFGBG=0;15          light palette (auto-detect: 16-colour, greyscale ramp, colour cube)

(default)               dark palette (preserves current behaviour)

Files Changed

| File | Lines | What |

|------|-------|------|

| src/tui/theme/theme.ts | +48 | isLightBackground() detection, light palette, palette selection |

| src/tui/theme/syntax-theme.ts | +50 | light parameter, VS Code Light+ inspired syntax colours |

| src/tui/theme/theme.test.ts | +73 | 7 tests: detection logic, env var precedence, identity behaviour |

Key Design Decisions

  1. All TUI colour goes through the centralised theme - palette swap propagates automatically to all 7 theme exports (theme, markdownTheme, selectListTheme, etc.)

  2. OPENCLAW_THEME overrides COLORFGBG - explicit user intent wins over auto-detection

  3. COLORFGBG threshold >= 7 - standard ANSI convention (used by vim, tmux); conservative to avoid false positives

  4. Module-level evaluation - same pattern as src/terminal/theme.ts (NO_COLOR/FORCE_COLOR)

Security Impact

  • Handles user input or env vars

  • Reads OPENCLAW_THEME and COLORFGBG, both display-only env vars with no security implications. No validation bypass, no auth changes, no file system access.

Evidence

  • Unit/integration test added or updated

  • 7 new tests covering: default dark, explicit light/dark, COLORFGBG auto-detect, COLORFGBG dark threshold, override precedence, assistantText identity in both modes

  • All 180 TUI tests pass

Human Verification

  • Verified scenarios: Tests cover detection logic exhaustively. Visual verification requires manual terminal switching.

  • Edge cases checked: COLORFGBG with multiple semicolons (uses last value), missing env vars, mixed case OPENCLAW_THEME

  • What was NOT verified: Visual appearance on every terminal emulator beyond Windows 11. Colours are WCAG AA-calculated; screenshot verification above confirms contrast on white background.

Compatibility / Migration

  • Backward compatible: yes. Dark theme unchanged, light requires explicit opt-in or COLORFGBG

  • Config changes: new optional OPENCLAW_THEME env var (light/dark)

  • Migration needed: none

Failure Recovery

  • Revert: git revert <sha>, single commit, clean revert

  • Files to restore: src/tui/theme/theme.ts, src/tui/theme/syntax-theme.ts

  • Bad symptoms: Wrong colours on specific terminal (set OPENCLAW_THEME=dark as workaround)

Risks and Mitigations

| Risk | Mitigation |

|------|-----------|

| COLORFGBG false positive (detects light on dark terminal) | OPENCLAW_THEME=dark explicit override available |

| Light palette colour not contrasted enough on specific terminal | All colours WCAG AA-calculated (>=4.5:1 on white); OPENCLAW_THEME override as escape hatch |

| Pre-existing feishu TS2353 errors in CI | Not introduced by this PR. Same 4 errors exist on main |

Regression Risk Assessment

  • Active regressions: 0 open regression issues in TUI area

  • Recent bugfixes in same files: 0 bugfix PRs in last 48h touching src/tui/theme/

  • Competing PRs: None

  • Overall risk: Low. Pure visual change, zero behavioural impact, dark theme unchanged

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87b592176c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 7, 2026

Greptile Summary

This PR introduces light-terminal support to the TUI theme layer by adding palette auto-detection (OPENCLAW_THEME env var + COLORFGBG heuristic), a WCAG AA-targeted lightPalette, and a matching createSyntaxTheme light branch. The dark theme is completely unchanged. The implementation is clean and follows the module-level evaluation pattern already used elsewhere in the codebase.

Key observations:

  • Detection logic (isLightBackground) is correct — explicit OPENCLAW_THEME takes precedence over COLORFGBG, and the default preserves dark behavior.
  • The 7 new tests are well-structured, using vi.resetModules() + dynamic import to correctly exercise module-init-time evaluation.
  • One color in the light syntax theme — #FF0000 used for attr and attribute tokens in syntax-theme.ts (lines 35-36) — has a contrast ratio of ~4.0:1 against white, which falls below the WCAG AA threshold of 4.5:1 claimed by the PR. Using #C50000 would satisfy the requirement at ~4.9:1 contrast.

Confidence Score: 4/5

  • Safe to merge with a minor color fix. The dark theme is unchanged and the light theme is opt-in only.
  • The PR is well-structured with sound logic and thorough tests. The dark theme is entirely unchanged and light theme is opt-in, so there is no behavioral risk. One light-mode syntax color (#FF0000 for attr/attribute) does not meet the WCAG AA 4.5:1 contrast target the PR explicitly guarantees. This is a straightforward fix (change to #C50000), but should be corrected before merge to fulfill the PR's stated accessibility claim.
  • src/tui/theme/syntax-theme.ts — Fix #FF0000 to #C50000 for lines 35-36 to meet WCAG AA 4.5:1 contrast threshold.

Last reviewed commit: 87b5921

@ademczuk ademczuk force-pushed the fix/tui-color-contrast-light-themes branch from 00b2364 to a7bccee Compare March 7, 2026 11:06
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 880c9e9dbf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b758228463

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba9a0f994f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@vincentkoc
Copy link
Copy Markdown
Member

@ademczuk screenshot before or after or im closing this PR as i have no way of verifying without a build

Copy link
Copy Markdown
Member

@vincentkoc vincentkoc left a comment

Choose a reason for hiding this comment

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

need verification of changes

@openclaw-barnacle openclaw-barnacle bot added scripts Repository scripts and removed scripts Repository scripts labels Mar 7, 2026
@ademczuk
Copy link
Copy Markdown
Contributor Author

ademczuk commented Mar 7, 2026

CI Status

The 3 failing checks are pre-existing type errors on main, unrelated to this PR:

  • check — TS errors in src/discord/monitor/message-handler.preflight.test.ts, src/discord/monitor/message-handler.queue.test.ts, src/line/bot-handlers.test.ts, src/telegram/bot-native-commands.session-meta.test.ts
  • checks (extensions)extensions/diffs/src/http.ts:180 TypeError in hasProxyForwardingHints
  • secrets — fork PRs can't access repo secrets (expected)

This PR only touches src/tui/theme/ (3 files). All relevant checks pass:

  • checks (node, test)
  • checks (bun, test)
  • checks-windows (all 6 shards) ✅
  • build-artifacts
  • install-smoke
  • dead-code report

@ademczuk ademczuk force-pushed the fix/tui-color-contrast-light-themes branch from f3f68fc to 3303076 Compare March 7, 2026 18:11
@ademczuk
Copy link
Copy Markdown
Contributor Author

ademczuk commented Mar 7, 2026

Aisle Security Finding — Addressed

Fixed in a35aa35. The COLORFGBG parsing now:

  1. Length cap — rejects values over 64 bytes (real COLORFGBG is 3-7 chars like "0;15")
  2. lastIndexOf instead of split — extracts only the last segment without allocating an array
  3. Range clamp 0..255 — rejects out-of-range values and implicitly rejects NaN

This addresses CWE-400 (uncontrolled resource consumption) by bounding both input size and output range before any computation.

@ademczuk
Copy link
Copy Markdown
Contributor Author

ademczuk commented Mar 7, 2026

need verification of changes

TUI Theme Comparison — Windows 11

Rendered using the exact hex values from src/tui/theme/theme.ts darkPalette and lightPalette on Windows 11. Three panels:

Panel Background Palette Verdict
BEFORE (left) White #FFFFFF darkPalette (current main) Text invisible — contrast ~1.1:1 to ~2.5:1
AFTER (center) White #FFFFFF lightPalette (this PR) All text readable — contrast ≥4.5:1 (WCAG AA)
UNCHANGED (right) Dark #1E1E1E darkPalette No regression — identical to current main

Every color shown corresponds 1:1 to the palette objects in the diff. The isLightBackground() function selects lightPalette automatically when OPENCLAW_THEME=light or COLORFGBG indicates a light background; dark users see zero change.

@ademczuk ademczuk requested a review from vincentkoc March 7, 2026 19:02
@ademczuk
Copy link
Copy Markdown
Contributor Author

ademczuk commented Mar 7, 2026

Pushed 50e71a2 with one more fix - using the actual xterm RGB lookup table for 256-colour cube luminance instead of raw 0-5 indices. The previous approximation misclassified some bright backgrounds (e.g. bright cyan at index 39) as dark.

Summary of changes across all commits:

  1. isLightBackground() detection - checks OPENCLAW_THEME env var first (explicit override), then parses COLORFGBG terminal variable for 16-colour palette, 256-colour greyscale ramp, and 6x6x6 colour cube
  2. Dual darkPalette/lightPalette - dark palette is unchanged from the original, light palette uses high-contrast colours for white/light backgrounds
  3. Light syntax highlighting theme - VS Code light-inspired, WCAG AA compliant (#C50000 for attrs after greptile caught the original #FF0000)
  4. 19 tests covering all detection branches

Verification steps:

# Run tests
pnpm vitest run src/tui/theme/theme.test.ts

# Manual - force light mode
OPENCLAW_THEME=light openclaw gateway status

# Manual - auto-detect from terminal
COLORFGBG=0;15 openclaw gateway status

All 10 bot comments from chatgpt-codex-connector and greptile addressed across 5 rounds. CI green (secrets failure is expected for fork PRs).

@ademczuk
Copy link
Copy Markdown
Contributor Author

ademczuk commented Mar 8, 2026

@vincentkoc these CI checks could do with some intent engineering, as this should be a slamdunk of a PR.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 011a70c859

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ademczuk
Copy link
Copy Markdown
Contributor Author

ademczuk commented Mar 8, 2026

@vincentkoc - verification of the changes:

What changed (commit 50e71a2):
The 256-colour cube branch in isLightBackground() was using raw indices (0-5) for BT.601 luminance instead of actual xterm RGB values. Fixed by adding the xterm lookup table [0, 95, 135, 175, 215, 255] and computing luminance on real RGB values (0-255 scale) with threshold 128.

Before: lum = 0.299 * r + 0.587 * g + 0.114 * b where r/g/b were 0-5 indices. Threshold 2.5.
After: lum = 0.299 * rVal + 0.587 * gVal + 0.114 * bVal where rVal/gVal/bVal are actual RGB channel values. Threshold 128.

Verification:

  • All 19 existing tests pass without modification (the threshold change was calibrated correctly)
  • bg=231 (white, RGB 255,255,255, lum=255) → light ✅
  • bg=16 (black, RGB 0,0,0, lum=0) → dark ✅
  • bg=244 (greyscale ramp, ≥50% grey) → light ✅
  • bg=232 (near-black greyscale) → dark ✅
  • Full cube sweep: 141 light / 75 dark classifications match expected luminance distribution

No other files changed. Only 8 lines modified in theme.ts (the cube luminance block).

pnpm vitest run src/tui/theme/theme.test.ts  # 19 tests pass
pnpm tsgo                                     # zero errors

CI: all test jobs green. check failure is an upstream regression affecting all open PRs (confirmed on #39238, #39245).

@vincentkoc vincentkoc force-pushed the fix/tui-color-contrast-light-themes branch from 898ddc2 to 5e1b6dc Compare March 8, 2026 22:28
@openclaw-barnacle openclaw-barnacle bot added the docs Improvements or additions to documentation label Mar 8, 2026
@vincentkoc vincentkoc self-assigned this Mar 8, 2026
@vincentkoc
Copy link
Copy Markdown
Member

Pushed a rebased update to fix/tui-color-contrast-light-themes.

What changed:

  • switched 256-color cube auto-detection to pick the palette by actual text contrast instead of a lum >= 128 midpoint, which addresses the last live Codex thread for bright 256-color backgrounds like COLORFGBG=15;34 and 15;39
  • darkened the light-theme structural colors so borders / blockquote rails / code fences are readable on light terminals
  • kept the light syntax theme and WCAG-safe red attr colors
  • documented OPENCLAW_THEME=light|dark in the TUI docs and env-var reference
  • added focused tests for the new detection cases plus explicit AA contrast assertions for the light palette

Verification:

  • pnpm vitest run src/tui/theme/theme.test.ts

The branch is rebased onto current origin/main, the review threads on the TUI theme files are resolved, and the PR is assigned to vincentkoc.

ademczuk added a commit to ademczuk/openclaw that referenced this pull request Mar 8, 2026
@ademczuk
Copy link
Copy Markdown
Contributor Author

ademczuk commented Mar 8, 2026

@vincentkoc - thanks for the rewrite, the contrast-ratio detection is a much better approach than the fixed threshold.

I've added the missing changelog entry (a5f3808). All CI was green on 5e1b6dc and the branch is rebased on current main.

Since you authored the core rewrite commit (5e1b6dc TUI: harden light theme contrast), cleanest landing path is probably cherry-pick to main and close - happy to have it landed however works best. If you'd rather squash-merge the PR instead, the CHANGES_REQUESTED review would need dismissing or a fresh approval.

…nclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>
@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

10 similar comments
@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

ademczuk added a commit to ademczuk/openclaw that referenced this pull request Mar 8, 2026
…nclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac1d843386

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ademczuk
Copy link
Copy Markdown
Contributor Author

ademczuk commented Mar 8, 2026

Superseded by #40339 - same branch, CHANGELOG conflict resolved, clean diff against main (6 files).

This PR was auto-closed after the branch was force-pushed and couldn't be reopened.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 8, 2026

Too many files changed for review. (3000 files found, 500 file limit)

vincentkoc added a commit that referenced this pull request Mar 8, 2026
* fix(tui): improve colour contrast for light-background terminals (#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: ademczuk <[email protected]>
Co-authored-by: ademczuk <[email protected]>
GordonSH-oss pushed a commit to GordonSH-oss/openclaw that referenced this pull request Mar 9, 2026
…claw#40345)

* fix(tui): improve colour contrast for light-background terminals (openclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: ademczuk <[email protected]>
Co-authored-by: ademczuk <[email protected]>
jenawant pushed a commit to jenawant/openclaw that referenced this pull request Mar 10, 2026
…claw#40345)

* fix(tui): improve colour contrast for light-background terminals (openclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: ademczuk <[email protected]>
Co-authored-by: ademczuk <[email protected]>
Get-windy pushed a commit to Get-windy/JieZi-ai-PS that referenced this pull request Mar 10, 2026
上游更新摘要(abb8f6310 → bda63c3,164 commits):

### 新功能
- ACP: 新增 resumeSessionId 支持 ACP session 恢复(openclaw#41847)
- CLI: 新增 openclaw backup create/verify 本地状态归档命令(openclaw#40163)
- Talk: 新增 talk.silenceTimeoutMs 配置项,可自定义静默超时(openclaw#39607)
- ACP Provenance: 新增 ACP 入站溯源元数据和回执注入(openclaw#40473)
- Brave 搜索: 新增 llm-context 模式,返回 AI 精炼摘要(openclaw#33383)
- browser.relayBindHost: Chrome relay 可绑定非 loopback 地址(WSL2 支持)(openclaw#39364)
- node-pending-work: 新增 node.pending.pull/ack RPC 接口
- Telegram: 新增 exec-approvals 处理器,支持 Telegram 内命令执行审批
- Mattermost: 新增 target-resolution,修复 markdown 保留和 DM media 上传
- MS Teams: 修复 Bot Framework General channel 对话 ID 兼容性(openclaw#41838)
- secrets/runtime-web-tools: 全新 web runtime secrets 工具模块
- cron: 新增 store-migration,isolated-agent 直送核心通道,delivery failure notify
- TUI: 自动检测浅色终端主题(COLORFGBG),支持 OPENCLAW_THEME 覆盖(openclaw#38636)

### 修复
- macOS: launchd 重启前重启已禁用服务,修复 openclaw update 卡死问题
- Telegram DM: 按 agent 去重入站 DM,防止同一条消息触发重复回复(openclaw#40519)
- Matrix DM: 修复 m.direct homeserver 检测,保留房间绑定优先级(openclaw#19736)
- 飞书: 清理插件发现缓存,修复 onboarding 安装后重复弹窗(openclaw#39642)
- config/runtime snapshots: 修复 config 写入后 secret 快照丢失问题(openclaw#37313)
- browser/CDP: 修复 ws:// CDP URL 反向代理和 wildcard 地址重写
- agents/failover: 识别 Bedrock tokens per day 限额为 rate limit

### 版本
- ACPX 0.1.16
- iOS/macOS 版本号更新
- Android: 精简后台权限

构建验证:待执行
sauerdaniel pushed a commit to sauerdaniel/openclaw that referenced this pull request Mar 11, 2026
…claw#40345)

* fix(tui): improve colour contrast for light-background terminals (openclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: ademczuk <[email protected]>
Co-authored-by: ademczuk <[email protected]>
Moshiii pushed a commit to Moshiii/openclaw that referenced this pull request Mar 11, 2026
…claw#40345)

* fix(tui): improve colour contrast for light-background terminals (openclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: ademczuk <[email protected]>
Co-authored-by: ademczuk <[email protected]>
Moshiii pushed a commit to Moshiii/openclaw that referenced this pull request Mar 11, 2026
…claw#40345)

* fix(tui): improve colour contrast for light-background terminals (openclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: ademczuk <[email protected]>
Co-authored-by: ademczuk <[email protected]>
@ademczuk
Copy link
Copy Markdown
Contributor Author

Branch got contaminated with upstream commits during rebase - ended up with a 3k file diff that's obviously unreviewable. Closing to cut down on review queue noise. The original colour contrast fix was a 2-file change, but it's not worth salvaging at this point given upstream terminal rendering has changed since.

dhoman pushed a commit to dhoman/chrono-claw that referenced this pull request Mar 11, 2026
…claw#40345)

* fix(tui): improve colour contrast for light-background terminals (openclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: ademczuk <[email protected]>
Co-authored-by: ademczuk <[email protected]>
Taskle pushed a commit to Taskle/openclaw that referenced this pull request Mar 14, 2026
…claw#40345)

* fix(tui): improve colour contrast for light-background terminals (openclaw#38636)

Detect light terminal backgrounds via COLORFGBG and apply a WCAG
AA-compliant light palette. Adds OPENCLAW_THEME=light|dark env var
override for terminals without auto-detection.

Uses proper sRGB linearisation and WCAG 2.1 contrast ratios to pick
whichever text palette (dark or light) has higher contrast against
the detected background colour.

Co-authored-by: ademczuk <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: ademczuk <[email protected]>
Co-authored-by: ademczuk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: ios App: ios app: macos App: macos channel: bluebubbles Channel integration: bluebubbles channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: irc channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: acpx extensions: copilot-proxy Extension: copilot-proxy extensions: device-pair extensions: diagnostics-otel Extension: diagnostics-otel extensions: google-gemini-cli-auth Extension: google-gemini-cli-auth extensions: llm-task Extension: llm-task extensions: lobster Extension: lobster extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb extensions: minimax-portal-auth extensions: open-prose Extension: open-prose extensions: phone-control extensions: qwen-portal-auth Extension: qwen-portal-auth extensions: talk-voice gateway Gateway runtime scripts Repository scripts security Security documentation size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Improve TUI color contrast for light-background users

2 participants