Skip to content

[codex] fix invisible prompt text in low-contrast themes#14182

Draft
yxshee wants to merge 1 commit intoanomalyco:devfrom
yxshee:update/tui-input-visible-14056
Draft

[codex] fix invisible prompt text in low-contrast themes#14182
yxshee wants to merge 1 commit intoanomalyco:devfrom
yxshee:update/tui-input-visible-14056

Conversation

@yxshee
Copy link
Contributor

@yxshee yxshee commented Feb 18, 2026

Summary

This PR fixes the TUI symptom reported in #14056 where prompt input can become effectively invisible even though keystrokes are still captured and submitted.

The user-facing impact is that the app appears unresponsive while typing, despite the prompt being sent correctly. In practice this looks like “nothing is being typed,” which blocks normal interaction.

Root Cause

Theme resolution trusted the configured/resolved foreground color (theme.text) without validating contrast against the prompt input surface (backgroundElement).

In edge cases (especially terminal-driven/system color setups), those colors can resolve too close to each other, producing extremely low contrast in the prompt textarea. The input buffer is still functioning, but text is visually lost.

Fix

During theme resolution, this change now:

  1. Chooses the prompt text background context (backgroundElement, or background if element background is transparent).
  2. Computes contrast between resolved text color and that background.
  3. If contrast is too low, replaces theme.text with a guaranteed readable fallback (black/white chosen by higher contrast).

This keeps normal themes unchanged and only applies a fallback when text would otherwise be hard or impossible to read.

Validation

  • bun run --cwd packages/opencode typecheck
  • bun run --cwd packages/opencode test -- --bail 1 test/cli/tui/transcript.test.ts

Notes

  • Push required --no-verify because local Bun is 1.3.6 while repo pre-push hook requires ^1.3.9.

Closes #14056

@github-actions
Copy link
Contributor

Hey! Your PR title [codex] fix invisible prompt text in low-contrast themes doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI doesn't show what user types. Text is invisible

1 participant

Comments