Skip to content

fix: keep paste badges readable#27991

Closed
mturac wants to merge 1 commit into
anomalyco:devfrom
mturac:fix/27968-paste-badge-contrast
Closed

fix: keep paste badges readable#27991
mturac wants to merge 1 commit into
anomalyco:devfrom
mturac:fix/27968-paste-badge-contrast

Conversation

@mturac
Copy link
Copy Markdown

@mturac mturac commented May 17, 2026

Issue for this PR

Closes #27968

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Paste summary badges used the theme background color as their foreground. That can be transparent in the system theme and custom transparent themes, making the badge text unreadable. This changes the paste badge to use the existing selected foreground contrast helper against the warning badge background, preserving the old opaque-theme fallback behavior.

This PR also adds a regression test for transparent theme backgrounds.

How did you verify your code works?

  • bun test test/cli/tui/theme.test.ts
  • bun typecheck
  • bun run lint packages/opencode/src/cli/cmd/tui/context/theme.tsx packages/opencode/test/cli/tui/theme.test.ts (0 errors; existing warnings in theme.tsx)
  • git diff --check origin/dev...HEAD
  • Push hook: bun turbo typecheck

Screenshots / recordings

Not included; this is a small color-selection change covered by a regression test.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

Potential duplicate found:

Why it's related: Both PRs address the same issue (#27968) of keeping paste badges readable. PR #27969 appears to focus on using contrast-aware foreground for the paste summary badge, while PR #27991 (current) aims to keep paste/image/PDF badges readable when the theme background is transparent. These PRs likely overlap in their scope and should be reviewed together to avoid conflicting changes.

@mturac mturac force-pushed the fix/27968-paste-badge-contrast branch from 731340d to c2393f0 Compare May 17, 2026 09:38
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@simonklee
Copy link
Copy Markdown
Member

Thanks for submitting the PR. I'm going to select one that doesn't have additional tests for this. That seems a bit much. Thanks again, though.

@simonklee simonklee closed this May 18, 2026
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.

Paste summary label is invisible with transparent/system themes

2 participants