[PR #9923] fix: use selectedForeground for transparent background themes in dialogs #13274

Open
opened 2026-02-16 18:18:08 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9923

State: open
Merged: No


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9923 **State:** open **Merged:** No --- 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: <img width="472" height="469" alt="image" src="https://github.com/user-attachments/assets/37782ab8-2c3f-4f3d-a1d0-2ec77b063296" /> After: <img width="655" height="261" alt="image" src="https://github.com/user-attachments/assets/856153b1-2084-4438-916b-b439f2e8ebab" /> ## 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`
yindo added the pull-request label 2026-02-16 18:18:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13274