[codex] fix invisible prompt text in low-contrast themes#14182
Draft
yxshee wants to merge 1 commit intoanomalyco:devfrom
Draft
[codex] fix invisible prompt text in low-contrast themes#14182yxshee wants to merge 1 commit intoanomalyco:devfrom
yxshee wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
backgroundElement, orbackgroundif element background is transparent).theme.textwith 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 typecheckbun run --cwd packages/opencode test -- --bail 1 test/cli/tui/transcript.test.tsNotes
--no-verifybecause local Bun is1.3.6while repo pre-push hook requires^1.3.9.Closes #14056