fix: keep paste badges readable#27991
Closed
mturac wants to merge 1 commit into
Closed
Conversation
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. |
731340d to
c2393f0
Compare
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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. |
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.
Issue for this PR
Closes #27968
Type of change
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.tsbun typecheckbun run lint packages/opencode/src/cli/cmd/tui/context/theme.tsx packages/opencode/test/cli/tui/theme.test.ts(0 errors; existing warnings intheme.tsx)git diff --check origin/dev...HEADbun turbo typecheckScreenshots / recordings
Not included; this is a small color-selection change covered by a regression test.
Checklist