Skip to content

fix(tui): preserve contrast for transparent themes#37264

Open
vaibhavshn wants to merge 2 commits into
anomalyco:v2from
vaibhavshn:theme-contrast-v2
Open

fix(tui): preserve contrast for transparent themes#37264
vaibhavshn wants to merge 2 commits into
anomalyco:v2from
vaibhavshn:theme-contrast-v2

Conversation

@vaibhavshn

Copy link
Copy Markdown

Issue for this PR

Closes #30056.

Ported over from #36239 which was targeting dev branch.

Type of change

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

What does this PR do?

Badge text becomes invisible if your background is transparent. This fixes that by checking the background color and setting the text color accordingly in two places: file badge when a file is tagged, and another in the diff viewer.

How did you verify your code works?

Ran this with same theme and terminal, and you can see the screenshots below for before and after.

In my case, I ran it with system theme in Ghostty. You will see this with any theme in Ghostty.

Screenshots / recordings

Badge

Before:
Screenshot 2026-07-10 at 17 35 23@2x

After:

Screenshot 2026-07-10 at 17 34 10@2x

Diff Viewer

Before:
Screenshot 2026-07-10 at 17 32 48@2x

After:
Screenshot 2026-07-10 at 17 33 55@2x

Checklist

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

If you do not follow this template your PR will be automatically rejected.

@github-actions

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

Related PR Found

PR #36239 - fix(tui): preserve contrast for transparent themes
#36239

This is the original PR that the current PR (37264) was ported from. According to the PR description, #36239 was targeting the dev branch, and #37264 re-applies the same fix. This appears to be an intentional re-application rather than a duplicate issue, as the PR explicitly mentions it was "ported over" from #36239.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant