fix(tui): use theme background color for dialog/sidebar overlays#23024
Open
mynameistito wants to merge 8 commits intoanomalyco:devfrom
Open
fix(tui): use theme background color for dialog/sidebar overlays#23024mynameistito wants to merge 8 commits intoanomalyco:devfrom
mynameistito wants to merge 8 commits intoanomalyco:devfrom
Conversation
Hardcoded black overlay (RGBA.fromInts(0,0,0,150)) caused a visible gutter seam on Windows 11 when dialogs opened. The gutter pixels are painted with the terminal's default bg (now synced via OSC 11), but the overlay darkened the main area to black, creating a mismatch at the edges. Also bumps @opentui/core and @opentui/solid from 0.1.99 to 0.1.100 to pick up the upstream OSC 11 fix (anomalyco/opentui#951). Closes: anomalyco#23021
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Found 2 potentially related PRs that address similar issues with TUI overlay colors:
Both of these PRs tackle the same general problem of using theme colors for dialog/overlay elements instead of hardcoded black colors. You may want to check if these have already been merged or if they address the same underlying issue. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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: #23021
Type of change
What does this PR do?
On Windows 11 (maximized or snapped), the terminal has a pixel gutter where the character grid doesn't fill the window. The upstream OSC 11 fix in opentui (anomalyco/opentui#951) syncs the terminal background to the renderer's theme color, which fixes the gutter for the main app area. But when a dialog opens, the gutter shows up again because the overlay is hardcoded to
RGBA.fromInts(0, 0, 0, 150)(black with alpha). The gutter pixels show the theme background while the overlay darkens everything else to black, so you get a seam at the edges.The fix is to use the theme's background color at the same alpha instead of hardcoded black. This works because the overlay now darkens from the same base color that the gutter is already showing, so there's no mismatch.
Two changes in this PR:
dialog.tsxandsession/index.tsx- swap hardcodedRGBA.fromInts(0, 0, 0, N)overlays forRGBA.fromValues(theme.background.r, theme.background.g, theme.background.b, N / 255)@opentui/coreand@opentui/solidfrom0.1.99to0.1.100to pick up the upstream OSC 11 fix, which makessetBackgroundColor()emit OSC 11 automatically anddestroy()/suspend()emit OSC 111 to resetHow did you verify your code works?
Tested on Windows 11 (v25H2, OS Build 26200.8039) with Windows Terminal v1.24 and Terminal Preview v1.25. Gutter matches theme background with dialogs and sidebar open.
bun typecheckpasses clean across all packages.Screenshots / recordings
Before
opencode-issue-23021.mp4
opencode-pr-23024.mp4
Checklist