Skip to content

Conversation

@ShamanicArts
Copy link

@ShamanicArts ShamanicArts commented Jan 22, 2026

Fixes #9920

Fixes invisible button text in DialogConfirm, DialogAlert, and DialogHelp when using transparent background themes.

Problem

These dialog components used theme.selectedListItemText directly for button text color. For themes without an explicit selectedListItemText defined, this defaults to theme.background. On transparent background themes, this means the text color is literally transparent (alpha=0), making button labels completely invisible.

Solution

Use the selectedForeground(theme) function instead, which:

  • Detects transparent backgrounds
  • Calculates proper contrasting color (black or white based on primary color luminance)
  • Falls back appropriately for non-transparent themes

This matches how DialogSelect already handles this case correctly.

Before:
image

After:
image

Files Changed

  • packages/opencode/src/cli/cmd/tui/ui/dialog-confirm.tsx
  • packages/opencode/src/cli/cmd/tui/ui/dialog-alert.tsx
  • packages/opencode/src/cli/cmd/tui/ui/dialog-help.tsx

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@ShamanicArts ShamanicArts marked this pull request as draft January 22, 2026 01:56
@ShamanicArts ShamanicArts marked this pull request as ready for review January 22, 2026 01:59
@ariane-emory
Copy link
Contributor

LGTM: this looks like it's consistent with fixes to a similar problem in other locations that I'd contributed in the long-since merged PRs #4572 (including a function contributed by @knanao) and #7246.

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.

No text on transparent background in dialog-alert, dialog-confirm & dialog help buttons

2 participants