Skip to content

feat(theme): app-wide window glass with vibrancy/acrylic - #3972

Closed
MuathJ wants to merge 1 commit into
stablyai:mainfrom
MuathJ:feat/window-glass
Closed

MuathJ wants to merge 1 commit into
stablyai:mainfrom
MuathJ:feat/window-glass

Conversation

@MuathJ

@MuathJ MuathJ commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Root cause this fixes: blur & background opacity never visibly worked before because the macOS window set transparent: true together with vibrancy, which suppresses the vibrancy view, and an opaque backgroundColor painted over the blur layer.

Summary

Adds Window Glass - a translucent window mode that lets the blurred desktop show through the whole app (sidebars, terminals, editor, panels), backed by macOS vibrancy and Windows acrylic.

User-visible changes:

  • New "Window Glass" section in Settings → Appearance (placed above File Explorer) with two controls:
    • Glass Mode (toggle) - turns the whole app into translucent glass with the desktop blurred behind it. Requires a restart (the window's transparency/material is set at window creation), so the toggle shows a "Restart required" banner with a relaunch button.
    • Glass Opacity (0–1) - how opaque the app surfaces are in Glass Mode. The middle view (terminal, editor/file viewer, page backgrounds) tracks this value exactly; chrome (sidebars, titlebar, cards) sits +0.25 more opaque so framing stays readable. Floating overlays (dropdowns, dialogs, tooltips, command palette) stay fully opaque for readability.
  • These two settings moved out of Settings → Terminal → Window and were renamed (previously "Window Blur" and "Background Opacity"), since the effect is now app-wide rather than terminal-only. Their descriptions were updated and the in-settings search index was moved accordingly. Persisted setting keys are unchanged (windowBackgroundBlur, terminalBackgroundOpacity), so existing configs keep working.
  • Ghostty import: background-blur (boolean or numeric radius) now maps to the Glass Mode setting, alongside the existing background-blur-radius.

Behavior when Glass Mode is off is unchanged from today - the window is opaque and the terminal/editor/preview render their solid themes (the glass/opacity logic is fully gated on the blur setting).

Screenshots

  • Opacity at 0 - Glass On
image
  • Glass Off
image
  • Opacity at 0 - Glass On
image
  • Glass Off
image
  • Opacity at 0 - Glass On
image image
  • Glass Off
image
  • Opacity at 0 - Glass On
image
  • Glass Off
image
  • Opacity at 0.3 - Glass On
image

Testing

  • pnpm lint - passes (oxlint, switch-exhaustiveness, and the check-styled-scrollbars guard).
  • pnpm typecheck - typecheck:node and typecheck:web both clean (0 errors).
  • pnpm test - touched suites green: mapper.test.ts, createMainWindow.test.ts, terminal-appearance.test.ts, TerminalSettingsPreview.lifecycle.test.tsx.
  • pnpm build - passes (typecheck → relay → computer-macos → cli → electron-vite → web all succeed).
  • Added or updated high-quality tests that would catch regressions:
    • Ghostty background-blur mapping (boolean / numeric radius / 0 / invalid + the "radius not preserved" note).
    • createMainWindow window options per platform (macOS vibrancy without transparent, Windows acrylic, Linux opaque fallback).
    • Settings preview transparency gated on blur (catches the "preview shows a light theme as dark when blur is off" regression).

Manually verified on macOS (dark mode) via the running dev app: Glass Mode on → vibrancy shows through; Glass Opacity drives terminal/editor/chrome at the expected levels; Glass Mode off → solid themes everywhere (terminal, editor, preview); floating overlays stay opaque; terminal scrollbar matches the file editor. Windows & Linux are not tested and should be verified.

AI Review Report

Reviewed the diff with an AI coding agent across the dimensions CONTRIBUTING requires:

  • Cross-platform (macOS / Linux / Windows): All window-material logic in createMainWindow.ts is guarded by process.platform - macOS uses vibrancy: 'under-window' + visualEffectState: 'active' (no transparent: true, which was the bug); Windows uses backgroundMaterial: 'acrylic'; Linux has no native blur surface and keeps an opaque backgroundColor. No keyboard shortcuts, accelerators, shortcut labels, or filesystem paths were added or changed, so there are no metaKey/CmdOrCtrl/⌘-vs-Ctrl/path.join concerns in this PR. The renderer CSS gates everything on a glass class driven by the blur setting, identical across platforms. macOS verified live; Windows acrylic and Linux opaque-fallback paths are guarded but were not visually verified - flagged in Notes.
  • SSH / remote / local: Changes are window-level (main process) and renderer styling only; no assumptions about processes, files, shells, credentials, or network paths. The relaunch uses the existing window.api.app.relaunch() IPC. No SSH/remote-specific behavior.
  • Agents / integrations / git providers: Provider-neutral. The only integration touch is the Ghostty importer, guarded by an explicit key (background-blur) with strict value validation; nothing GitHub/GitLab-specific.
  • Performance: No new work in hot paths. The glass effect is pure CSS variables; applyTerminalAppearance only sets allowTransparency/theme when blur is on, and the per-pane loop is unchanged. Two documentElement.style.setProperty calls fire only when the blur/opacity settings change.
  • UI quality (STYLEGUIDE): Used existing tokens and shadcn/settings primitives (SettingsSwitchRow, NumberField, SettingsSubsectionHeader, SearchableSetting). Flagged and fixed by the review: hardcoded hex in the "pin solid" rules → new --background-solid / --editor-surface-solid tokens; the custom terminal-scrollbar style was reconciled with the "don't write a fourth scrollbar style" rule by mirroring .scrollbar-editor's exact values (xterm owns its internal scrollbar elements, so the class can't be attached) and documenting it - check-styled-scrollbars passes. Light and dark both covered.
  • Security: see below.

Security Audit

Low risk. No input handling, command execution, path handling, auth, secrets, or new dependencies are introduced.

  • IPC: No new IPC channels; reuses the existing app:relaunch path that the old Window Blur toggle already used.
  • Window security: Only adds non-opaque window material options (vibrancy/acrylic) and omits the opaque backgroundColor on a blur surface - sandbox, contextIsolation, webviewTag, and the webview hardening in createMainWindow are untouched.
  • Untrusted input: The Ghostty background-blur value is parsed through the existing strict integer/boolean validation (rejects anything else), so a malformed config can't smuggle a value through.
  • Follow-up: none required.

Notes

  • Restart required: Glass Mode changes the Electron window's transparency/material, which can only be set at window creation, so toggling it prompts a restart (the toggle surfaces a relaunch button). This matches the prior Window Blur behavior.
  • Glass is fully gated on blur: with Glass Mode off, none of the translucency applies - the terminal, editor, settings preview, and app shell render exactly as before. Glass Opacity only has an effect while Glass Mode is on.
  • Platform verification: verified on macOS (vibrancy). Windows (acrylic) and Linux (opaque, no native blur) paths are guarded by process.platform but should be sanity-checked on those platforms before merge.

Comparison to PR #2791

#2791 ("macOS native glass effect as an orthogonal setting") produces the same visual result - a translucent window with the desktop blurred through the shell. This PR reaches it with ~6× less code by layering on settings that already exist instead of building a new feature platform.

This PR #2791
Files / lines 15 · +524 / −170 89 · +1492 / −145
Setting Reuses windowBackgroundBlur + terminalBackgroundOpacity New glassEffect: boolean
Opaque surfaces Flip design tokens translucent once; pin a few overlays New bg-background-opaque util across ~30 components
Monaco CSS override New theme module + 5-component wiring
Platforms macOS + Windows + Linux (opaque fallback) macOS-only by design
Migration None Rewrites a legacy 5-value theme on disk

Why ours is smaller:

  • No new setting. Glass rides on the existing windowBackgroundBlur + terminalBackgroundOpacity, so there's no new type, predicate module, IPC plumbing, on-disk migration, or onboarding.
  • Inverted CSS strategy. We make the design tokens translucent in glass mode in one place and pin back only the handful of real overlays (dialog/sheet/tooltip/switch); popovers, dropdowns, and selects stay opaque automatically via the untouched --popover. The PR feat(theme): macOS native glass effect as orthogonal setting #2791 instead tags ~30 components with bg-background-opaque.
  • Monaco via CSS, not a new theme module wired through five editor components.

Where we differ technically: on macOS we omit transparent: true (the PR #2791 sets transparent: true + backgroundColor: '#00000000'). That combination suppresses the vibrancy view - the actual reason blur rendered opaque - so we use vibrancy: 'under-window' + visualEffectState: 'active' and omit backgroundColor on a blur surface. We also cover Windows (acrylic) and Linux (opaque fallback); the PR #2791 is macOS-only.

Trade-offs vs #2791:

  • Coupling: blur and the glass look are one switch (windowBackgroundBlur); the (PR 2791) keeps them independent. In practice this gives up little - when tested, the existing windowBackgroundBlur never actually rendered blur (it showed opaque, the bug fixed here - see Summary), so there was no working "blur without glass" to preserve.
  • No migration needed: the legacy 5-value theme (glass-light / glass-dark) is (PR 2791)'s lineage, not ours. Our theme is the 3-value enum (system / dark / light, see src/shared/types.ts), and we reuse the existing windowBackgroundBlur + terminalBackgroundOpacity settings rather than adding a key, so there's no on-disk state to convert. A migration here would match zero persisted values.
  • Token blast radius: any new bg-background surface is translucent by default under glass (we pin exceptions with *-solid; (PR 2791) opts in with bg-background-opaque).
  • No prefers-reduced-transparency fallback yet (PR 2791) has one; could be added as a single media query against the same tokens).

ELI5

Window Glass mode makes the whole app translucent with desktop blur (macOS vibrancy / Windows acrylic)—sidebars, terminals, and panels.

@MuathJ MuathJ changed the title feat: app-wide window glass with vibrancy/acrylic feat(theme): app-wide window glass with vibrancy/acrylic May 31, 2026
@nwparker nwparker added the risk:medium Medium risk change label May 31, 2026
@JayefBuilds

JayefBuilds commented Jun 1, 2026 •

Copy link
Copy Markdown

This looks really nice! Excited to use it. Thanks everyone for all the hard work

@KyrillosL

Copy link
Copy Markdown

It looks great, well done !
I'd love to see this in Orca, anyone knows what's blocking the merge ?

@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #36580, which adds Opaque, Translucent and Blurred window materials on macOS, Windows and Linux (plus Reduce Visual Effects) and fixes the transparent-terminal flicker. Thank you for this PR, it shaped the design.

@nwparker nwparker closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request risk:medium Medium risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants