Skip to content

fix(window): do not cover platform blur with opaque backgroundColor - #10349

Closed
innocarpe wants to merge 4 commits into
stablyai:mainfrom
innocarpe:fix/macos-window-blur-opacity
Closed

innocarpe wants to merge 4 commits into
stablyai:mainfrom
innocarpe:fix/macos-window-blur-opacity

Conversation

@innocarpe

@innocarpe innocarpe commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

User-facing: On macOS (and Windows acrylic), Window Blur + Background Opacity could look completely broken — the window stayed fully opaque even after enabling blur and lowering opacity.

Technical: createMainWindow always set an opaque backgroundColor (#0a0a0a / #ffffff) even when blur enabled platform materials. That solid fill covered macOS vibrancy / Windows acrylic, so lowering terminalBackgroundOpacity only revealed the same solid chrome color — never the desktop.

Fixes #8797

Impact / ELI5

Orca was putting a solid painted board behind the glass. Turning on “blur” and lowering opacity only made the terminal more see-through to that solid board. This removes the solid board when blur is on, so you can actually see the frosted desktop through a translucent terminal.

Root cause

From the has_repro handoff (docs/bug-reproductions/8797.md):

  1. Blur path set vibrancy: 'under-window' + transparent: true (Darwin) or backgroundMaterial: 'acrylic' (Windows).
  2. Constructor always applied opaque backgroundColor: dark ? '#0a0a0a' : '#ffffff'.
  3. Terminal opacity only rewrites the xterm theme to rgba(...) — it never changed the BrowserWindow fill.
  4. Result: transparent terminal sits on solid black/white; blur never shows.

Fix

New pure helper resolveMainWindowChromeOptions:

Platform Blur off Blur on
macOS opaque fill #00000000 + vibrancy: under-window + visualEffectState: active + transparent: true
Windows opaque fill #00000000 + backgroundMaterial: acrylic
Linux opaque fill opaque fill (no material)

createMainWindow consumes the helper instead of hard-coding the opaque fill.

Evidence

pnpm exec vitest run --config config/vitest.config.ts \
  src/main/window/main-window-chrome-options.test.ts \
  src/main/window/repro-8797-blur-opacity-noop.test.ts

Result: 8/8 passed.

Manual (macOS):

  1. Settings → Terminal → Window → enable Window Blur → restart.
  2. Lower Background Opacity below 1.
  3. Terminal should reveal blurred desktop (chrome UI still solid via CSS).

User-regression-tradeoffs

Checklist notes

  • Cross-platform: Darwin + Windows materials; Linux no-op path preserved.
  • SSH/remote: n/a (local BrowserWindow chrome only).
  • Agents/integrations: n/a.
  • Performance: same window-creation path; no runtime cost.
  • UI: relies on existing renderer surfaces for chrome; terminal opacity path unchanged.
  • Security: n/a.

AI review summary


Note: Re-opened as a new PR after an accidental empty force-push during local rebase cleanup closed the original #10064 (no code intent to withdraw). Branch tip restored with an empty recovery commit.

ELI5

Window Blur plus lower opacity looked fully solid on macOS/Windows acrylic because an opaque background covered the platform material. The solid fill is removed when blur is on so blur and transparency actually show.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e28a9f1c-e3e2-491b-abc5-b0df4c0079e8

📥 Commits

Reviewing files that changed from the base of the PR and between e919f48 and 6e7a4c4.

📒 Files selected for processing (9)
  • src/main/window/createMainWindow.test.ts
  • src/main/window/createMainWindow.ts
  • src/main/window/main-window-chrome-options.test.ts
  • src/main/window/main-window-chrome-options.ts
  • src/main/window/repro-8797-blur-opacity-noop.test.ts
  • src/renderer/src/app-shell/use-document-appearance.ts
  • src/renderer/src/assets/main.css
  • src/renderer/src/lib/window-blur-root-class.test.ts
  • src/renderer/src/lib/window-blur-root-class.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/main/window/createMainWindow.test.ts
  • src/renderer/src/lib/window-blur-root-class.test.ts
  • src/renderer/src/assets/main.css
  • src/main/window/createMainWindow.ts
  • src/renderer/src/lib/window-blur-root-class.ts
  • src/main/window/main-window-chrome-options.ts
  • src/main/window/main-window-chrome-options.test.ts
  • src/main/window/repro-8797-blur-opacity-noop.test.ts

📝 Walkthrough

Walkthrough

The change centralizes main-window background and blur configuration in resolveMainWindowChromeOptions. Windows with blur use transparent acrylic styling, while other configurations use opaque backgrounds. Renderer appearance handling now toggles a desktop-only window-blur class and applies transparent document surfaces. Tests cover platform-specific chrome settings, terminal opacity, root-class behavior, CSS transparency, and paired web-client exclusion.

Merge Risk: ⚪ Minimal · up to 6e7a4

This localized change removes the opaque native fill only when blur is enabled so macOS vibrancy and Windows acrylic can show through, while preserving opaque behavior elsewhere; no actionable merge-blocking risk remains after normal checks.

🚥 Pre-merge checks | ✅ 1 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the issue and fix, but it omits the required Visual Proof and does not complete the template's Testing and Checklist sections. Add before-and-after screenshots or a video, then complete the required Testing, AI Disclosure, Review, and Checklist sections.
Linked Issues check ⚠️ Warning The PR fixes Windows acrylic but leaves macOS blur unchanged, while linked issue #8797 requires a macOS blur and opacity fix. Implement the macOS fix required by #8797, or link a Windows-specific issue if the scope is intentionally narrowed.
Out of Scope Changes check ⚠️ Warning Windows acrylic changes and related renderer class and CSS wiring are outside the macOS-only scope of linked issue #8797. Link a Windows-specific issue or remove changes unrelated to the macOS blur and opacity requirements of #8797.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: preventing an opaque background from covering platform blur materials.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/main/window/main-window-chrome-options.ts (1)

1-6: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Condense the explanatory file banners.

  • src/main/window/main-window-chrome-options.ts#L1-L6: reduce to the essential blur-surface rationale.
  • src/main/window/repro-8797-blur-opacity-noop.test.ts#L1-L14: retain a short issue reference and move rerun instructions elsewhere if needed.

As per coding guidelines, comments must be concise, non-obvious, and preferably one line.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ef71bae-c897-418f-8b29-8293b641fe44

📥 Commits

Reviewing files that changed from the base of the PR and between 981653f and 358f64be49905bbbf0a6c92dcda11fa2001f983b.

📒 Files selected for processing (4)
  • src/main/window/createMainWindow.ts
  • src/main/window/main-window-chrome-options.test.ts
  • src/main/window/main-window-chrome-options.ts
  • src/main/window/repro-8797-blur-opacity-noop.test.ts

@innocarpe
innocarpe force-pushed the fix/macos-window-blur-opacity branch from 358f64b to ebf2b72 Compare July 24, 2026 09:02
@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (ebf2b7277)

Rebased onto upstream/main. Kept main macOS Tahoe repaint guard (isMacosTahoeOrNewer) and transparent chrome options for Window Blur (#8797). Dropped empty restore tip.

@nwparker

nwparker commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Automated screenshot pass — this comment is from a bulk process that only adds visual context (Electron e2e captures or re-uploaded docs product shots). It is not a code review, triage decision, or claim that the change is verified. Images may be current baselines or related product references, not before/after of a specific PR branch.

What this image is

Current window background baseline from Electron e2e — related to platform blur / opaque backgroundColor; not a blur repro.

Visual evidence

10-workspace-active.png
10-workspace-active.png

@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (1c2c4c4c5)

Address CodeRabbit: Windows acrylic now sets transparent:true (with regression coverage). Wiring test already asserted resolveMainWindowChromeOptions invocation + platformBlurOptions spread.

@nwparker nwparker added the bug Something isn't working label Jul 27, 2026
@innocarpe
innocarpe force-pushed the fix/macos-window-blur-opacity branch from 1c2c4c4 to 7ca44fa Compare July 27, 2026 14:59
@innocarpe
innocarpe force-pushed the fix/macos-window-blur-opacity branch from 7ca44fa to 241d9c8 Compare August 14, 2026 17:02
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@innocarpe

Copy link
Copy Markdown
Contributor Author

Follow-up for the Windows report on #8797.

Rebased onto current main and narrowed the branch:

Preserves: #8482 (no macOS vibrancy/transparent). This PR is now the Windows half of #8797, not a claim to close the macOS visual no-op.

Window Blur + terminal Background Opacity looked like no-ops on macOS because
BrowserWindow always painted a solid #0a0a0a/#ffffff fill over vibrancy. When
blur materials are active, use a transparent window fill (and Darwin
visualEffectState: active) so lowered terminal alpha can reveal the blur layer.

Fixes stablyai#8797
CodeRabbit: wiring test should prove the resolver call and
platformBlurOptions spread, not only the import name.
Set transparent:true with backgroundMaterial acrylic so Windows blur
composites under titleBarStyle:hidden, and cover the path in unit tests.
Window Blur already requested backgroundMaterial:acrylic on win32, but
the opaque BrowserWindow fill and renderer root covered it, so the
setting looked like a no-op. Use a transparent fill (Electron only
honors #AARRGGBB alpha with transparent:true) and drop the desktop
root paint so acrylic can show through.

Preserves stablyai#8482: do not reintroduce macOS vibrancy or transparency.

Refs stablyai#8797
@innocarpe
innocarpe force-pushed the fix/macos-window-blur-opacity branch from 241d9c8 to 6e7a4c4 Compare August 15, 2026 11:18
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@innocarpe

Copy link
Copy Markdown
Contributor Author

Rebased onto current main after the App shell split.

The window-blur root class is now driven from useDocumentAppearance, so acrylic still shows through on the desktop shell and stays off for the paired web client. Wiring tests updated to the new call site.

Validation: focused window/chrome/blur tests 21 passed.

@innocarpe

Copy link
Copy Markdown
Contributor Author

Closing this in favor of #12470.

That maintainer PR already covers the Windows acrylic half this branch isolated: it drops the opaque backgroundColor so acrylic is visible, and it deliberately never sets transparent / #00000000 because of #8482. Keeping both open would compete on createMainWindow and the blur root class.

The fork portfolio mirror will be closed to match.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Background Opacity" and "Window Blur" have no visible effect on macOS

3 participants