Skip to content

fix(tui): use theme background color for dialog/sidebar overlays#23024

Open
mynameistito wants to merge 5 commits intoanomalyco:devfrom
mynameistito:fix/dialog-overlay-gutter-seam
Open

fix(tui): use theme background color for dialog/sidebar overlays#23024
mynameistito wants to merge 5 commits intoanomalyco:devfrom
mynameistito:fix/dialog-overlay-gutter-seam

Conversation

@mynameistito
Copy link
Copy Markdown
Contributor

@mynameistito mynameistito commented Apr 17, 2026

Issue for this PR

Closes: #23021

Type of change

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

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:

  1. dialog.tsx and session/index.tsx - swap hardcoded RGBA.fromInts(0, 0, 0, N) overlays for RGBA.fromValues(theme.background.r, theme.background.g, theme.background.b, N / 255)
  2. Bump @opentui/core and @opentui/solid from 0.1.99 to 0.1.100 to pick up the upstream OSC 11 fix, which makes setBackgroundColor() emit OSC 11 automatically and destroy()/suspend() emit OSC 111 to reset

How 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 typecheck passes clean across all packages.

Screenshots / recordings

Before
opencode-issue-23021.mp4
opencode-pr-23024.mp4

Checklist

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

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
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. contributor labels Apr 17, 2026
@github-actions
Copy link
Copy Markdown
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:

  1. PR fix(tui): use theme-aware color for dialog overlay on system theme #14686 - "fix(tui): use theme-aware color for dialog overlay on system theme"

    • Related to using themed colors for dialog overlays instead of hardcoded values
  2. PR fix(opencode): use themed TUI overlay dimmers #18750 - "fix(opencode): use themed TUI overlay dimmers"

    • Also addresses overlay dimming with theme-aware 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.

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

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

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.

Dialog overlay gutter seam on Windows 11

1 participant