Repository navigation
Conversation
📝 WalkthroughWalkthroughAdds a platform-aware resolver for main-window background and blur options. Main-window creation now uses the resolver for 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2ebf81d2-cb54-41e1-958a-92a0c09c1cff
📥 Commits
Reviewing files that changed from the base of the PR and between bae29fd and a0b889aeabba7f8b6fa4b66414dc6f7e4461110b.
📒 Files selected for processing (4)
src/main/window/createMainWindow.tssrc/main/window/main-window-chrome-options.test.tssrc/main/window/main-window-chrome-options.tssrc/main/window/repro-8797-blur-opacity-noop.test.ts
| if (input.platform === 'win32') { | ||
| return { | ||
| backgroundColor: '#00000000', | ||
| platformBlurOptions: { | ||
| backgroundMaterial: 'acrylic' | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Files:\n'
git ls-files 'src/main/window/*.ts' | sort
printf '\nRelevant file outlines/contents:\n'
wc -l src/main/window/main-window-chrome-options.ts src/main/window/createMainWindow.ts src/main/window/main-window-chrome-options.test.ts
printf '\n--- main-window-chrome-options.ts ---\n'
cat -n src/main/window/main-window-chrome-options.ts
printf '\n--- createMainWindow.ts relevant section ---\n'
sed -n '200,270p' src/main/window/createMainWindow.ts | cat -n -v
printf '\n--- tests ---\n'
sed -n '1,120p' src/main/window/main-window-chrome-options.test.ts | cat -n -v
printf '\nSearch for ChromeOptions type/usage:\n'
rg -n "type .*Chrome|platformBlurOptions|resolveMainWindowChromeOptions|BrowserWindow|transparent|frame:" src/main/window src -g '*.ts' | head -200Repository: stablyai/orca
Length of output: 32190
🌐 Web query:
Electron BrowserWindow transparent backgroundColor alpha frame Windows documentation
💡 Result:
To create a transparent window in Electron, you must configure the BrowserWindow options with transparent: true. Crucially, on Windows, this setting will not function unless the window is also frameless (i.e., frame: false) [1][2]. Key properties for managing transparency and window appearance include: 1. transparent: Set this to true to make the window transparent [1][3]. On Windows, this requires the window to be frameless [1]. 2. frame: Set this to false to create a frameless window [4]. Frameless windows remove the standard system title bar and borders. 3. backgroundColor: This property sets the window's background color [1][5]. When transparent is set to true, you can use hexadecimal values with alpha channels (e.g., #80FFFFFF) to define the background's opacity [1][6]. In newer Electron versions, setBackgroundColor also supports formats like RGBA, HSLA, and named colors, where the alpha channel can be specified [5]. 4. thickFrame (Windows specific): When using frame: false, you can optionally set thickFrame: true (the default) to retain the standard Windows window frame style (which provides window shadows, animations, and resizing handles) while still allowing the window content to be transparent [7][4]. If set to false, these native window features are disabled [7][4]. For controlling window opacity after initialization, you can use the win.setOpacity(opacity) method, where opacity is a number between 0.0 (fully transparent) and 1.0 (fully opaque) [8][1]. This method is implemented on Windows and macOS [1].
Citations:
- 1: https://github.com/electron/electron/blob/1375c3d805497246a01fd8a86bde0e5a356f1138/docs/api/browser-window.md
- 2: https://imfly.github.io/electron-docs-gitbook/en/api/browser-window.html
- 3: https://github.com/electron/electron/blob/ad3b3e016261e746e667f6a2f8df33cae1e5f0eb/docs/api/browser-window.md
- 4: https://github.com/electron/electron/blob/main/docs/api/structures/base-window-options.md
- 5: https://github.com/electron/electron/blob/v41.2.0/docs/api/browser-window.md
- 6: https://typeerror.org/docs/electron/api/browser-window
- 7: https://electron.ebookchain.org/en/api/browser-window.html
- 8: https://github.com/electron/electron/blob/main/docs/api/browser-window.md
Make the Windows acrylic window actually transparent.
Electron only honors backgroundColor alpha with transparent: true, and Windows transparent windows require frame: false. The Windows branch leaves both out, so the acrylic window can remain opaque.
src/main/window/main-window-chrome-options.ts#L48-L53: returntransparent: trueandframe: falsealongsidebackgroundColor: '#00000000'andbackgroundMaterial: 'acrylic'; update the option type/comment.src/main/window/createMainWindow.ts#L247: ensureframefrom the spy/contract does not override this when Windows blur is enabled.src/main/window/main-window-chrome-options.test.ts#L33-L41: assert the full Windows transparent-window contract.
📍 Affects 3 files
src/main/window/main-window-chrome-options.ts#L48-L53(this comment)src/main/window/createMainWindow.ts#L227-L247src/main/window/main-window-chrome-options.test.ts#L33-L41
a0b889a to
981653f
Compare
|
Accidentally closed when a bad rebase helper force-pushed an empty tip. Restored and continued as #10349. |
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:
createMainWindowalways set an opaquebackgroundColor(#0a0a0a/#ffffff) even when blur enabled platform materials. That solid fill covered macOS vibrancy / Windows acrylic, so loweringterminalBackgroundOpacityonly 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):vibrancy: 'under-window'+transparent: true(Darwin) orbackgroundMaterial: 'acrylic'(Windows).backgroundColor: dark ? '#0a0a0a' : '#ffffff'.rgba(...)— it never changed the BrowserWindow fill.Fix
New pure helper
resolveMainWindowChromeOptions:#00000000+vibrancy: under-window+visualEffectState: active+transparent: true#00000000+backgroundMaterial: acryliccreateMainWindowconsumes 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.tsResult: 8/8 passed.
Manual (macOS):
1.User-regression-tradeoffs
Checklist notes
AI review summary