Skip to content

Badge text invisible when theme background is transparent or none #30056

Description

@shljsl75891

Description

Bug Report
Describe the bug
File attachment badges (e.g. txt, md, pdf,img) have invisible text when a theme sets background to "transparent" or "none". The badge colored box renders correctly but the label inside is not visible.

Expected behavior
Badge label text should be readable regardless of whether background is transparent.

Root cause
Both badge render sites use theme.background as the text foreground color:

  • packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx:174-183
<span style={{ bg: theme.secondary, fg: theme.background }}>
  {file.mime}
</span>
  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx:1383-1391
<span style={{ bg: bg(), fg: theme.background }}>
  {MIME_BADGE[file.mime] ?? file.mime}
</span>
  • theme.tsx:201-205 resolves "transparent"/"none" to RGBA(0,0,0,0), making the text fully transparent.

Plugins

@sahiljassal/opencode-anthropic-auth, @tarquinen/opencode-dcp

OpenCode version

1.15.13

Steps to reproduce

To Reproduce

  1. Use a theme with "background": "transparent" (e.g. gruvbox)
  2. Attach a file or reference one in chat
  3. Observe the badge — colored box shows but text label is missing

Screenshot and/or share link

Gruvbox (broken): badge renders as colored box with no label text

Image Image

Other theme (working): badge renders with visible label (e.g. txt)

Image

Operating System

macOS 26.5

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions