Skip to content

fix(windows): align titlebar overlay color with TabBar background#454

Merged
ErlichLiu merged 1 commit into
mainfrom
fix/windows-titlebar-overlay-color-mismatch
May 14, 2026
Merged

fix(windows): align titlebar overlay color with TabBar background#454
ErlichLiu merged 1 commit into
mainfrom
fix/windows-titlebar-overlay-color-mismatch

Conversation

@ErlichLiu
Copy link
Copy Markdown
Owner

问题

Windows 下右上角的原生标题栏区域(最小化/最大化/关闭按钮,约 140px 宽)呈现出与左侧 TabBar 颜色不一致的色块,在非深色主题下尤为明显(晴空碧海、森息晨光、云朵舞者等亮色主题)。

Closes #436

根因分析

titlebar-overlay.tsTHEME_COLORS 的颜色值参考的是 --background(侧边栏色),而不是 TabBar 的实际渲染颜色。

TabBar 的实际可见颜色是 hsl(--muted / 0.5) 以 alpha 混合到 hsl(--content-area) 背景上的结果。由于 overlay 颜色与 TabBar 颜色不一致,两个区域之间会出现明显的色差边界。

例如晴空碧海亮色主题:

  • 旧 overlay 颜色:#ecf2f7--background 侧边栏色)
  • TabBar 实际颜色:#e6eef5muted/0.5 混合到 content-area
  • 差值肉眼可见,右侧形成割裂感

修复方案

对每个主题预先计算 alpha-composite(hsl(--muted) × 0.5, hsl(--content-area)) 的结果,将 THEME_COLORS 更新为与 TabBar 实际渲染色精确匹配的值:

主题 旧颜色 新颜色
default-light #ffffff #fafafa
default-dark #121212 #1c1c1c
ocean-light #ecf2f7 #e6eef5
ocean-dark #182434 #131c26
forest-light #eff5f1 #ecf1ee
forest-dark #212c26 #16201b
slate-light #e3e1dc #e6e4df
slate-dark #1d1b20 #1f1c21

测试计划

  • 切换到晴空碧海亮色主题,确认右上角 overlay 与 TabBar 颜色一致
  • 切换到森息晨光亮色主题,验证同上
  • 切换到云朵舞者亮色主题,验证同上
  • 深色主题(所有):确认无回退
  • 默认亮色/深色主题:确认无回退

🤖 Generated with Claude Code

The Windows native titlebar overlay (minimize/maximize/close buttons area)
used colors based on --background (sidebar color), which differed from the
actual rendered TabBar background: hsl(--muted / 0.5) alpha-composited over
hsl(--content-area).

For light themes like ocean/forest/slate, this created a clearly visible color
seam where the 140px native overlay block didn't blend with the adjacent TabBar.

Updated THEME_COLORS to use the pre-computed blend values for each theme,
eliminating the visual "cut-off" reported in issue #436.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ErlichLiu ErlichLiu merged commit 05ba8ea into main May 14, 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.

windows下APP右上角UI有点问题

1 participant