Repository navigation
macos: Blur the window background with Window.setBackgroundAppearance - #484
TianZuo555 wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewI ran it with a small app that calls Found these issues:
nsh/crates/nsh-platform-macos/src/chrome.rs Lines 468 to 480 in 6ee112c
Lines 157 to 159 in 6ee112c
nsh/website/modules/nsh-desktop.md Lines 67 to 69 in 6ee112c
🤖 Generated with Claude Code |
huacnlee
left a comment
There was a problem hiding this comment.
The earlier layering and host-window restoration issues are addressed by static inspection. The new regression test has a separate threading issue; no macOS runtime reproduction was performed.
Reviewed by ChatGPT on behalf of @huacnlee.
c608788 to
a35ff3a
Compare
a35ff3a to
4b51560
Compare
|
We resolved all review findings. Changes Summary
Architectural Note: Window View vs Content ViewThe initial implementation modified the
Final Decision:
Validation
Please review again. @codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@huacnlee |
Add Window.setBackgroundAppearance("opaque" | "blurred") to
nsh/desktop, matching GPUI's WindowBackgroundAppearance. On macOS,
"blurred" displays the sidebar material behind the content view.
Position the backdrop at the back of the content view instead of
NSThemeFrame. Under a hidden title bar, the content view fills the
window, so the blur covers the title bar area. The system title bar
keeps its default appearance when shown.
Make navigation page backdrops transparent while the window is
blurred. This exposes the blur behind unstyled pages. Ensure that
the backdrop color updates during the initial mount batch and
subsequent appearance changes.
Reset the window background when the app stops. A new app loaded into
the view starts with an opaque background.
9a53bf3 to
278befd
Compare




Fixes #417.
Summary
Adds
Window.setBackgroundAppearance("opaque" | "blurred")tonsh/desktop, matching GPUI'sWindowBackgroundAppearance. On macOS,"blurred"displays the sidebar material behind the content view so the desktop shows through transparent app areas.Changes
nsh-core: AddWindowBackgroundAppearanceenum (Opaque,Blurred) and theSetBackgroundAppearancecommand to the desktop module.nsh-platform-macos:NSVisualEffectViewwithBehindWindowblending andSidebarmaterial behind the window's content view.NSThemeFrame. Under a hidden title bar, the content view fills the window and covers the title bar area; under a standard title bar, the system title bar keeps its native look.NavPages.nsh-platform-gpui,nsh-platform-linux,nsh-platform-windows: Implement stubs forSetBackgroundAppearance.docs/dev/macos.md,docs/dev/js-modules.md,docs/dev/gpui.md, and user-facing docs inwebsite/modules/nsh-desktop.mdandwebsite/zh-CN/modules/nsh-desktop.md.tests/compat/cases/macos/window-background.tsxand register it intests/compat/cases/macos/script.txt.Public API
Window.setBackgroundAppearance(appearance: "opaque" | "blurred"): voidinnsh/desktop: Sets whether the window background is opaque or blurred.nsh_core::desktop::WindowBackgroundAppearance:Opaque,Blurred.Validation
cargo test -p nsh-platform-macos --test macos: all 9 window background appearance checks pass.cargo clippy -p nsh-platform-macos --tests: passes with 0 warnings.cargo +nightly fmt --all: code is formatted.