Skip to content

fix: let Settings opt in to window opacity - #1096

Open
Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:codex/oss50-20261123-a91c-pebrel-settings-opacity
Open

Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:codex/oss50-20261123-a91c-pebrel-settings-opacity

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Result / 用户结果

Add “Settings follows window opacity” beside the opacity slider. It is off by
default. When enabled, Settings navigation and card backgrounds follow the live
window opacity; at 0% the wallpaper shows through, while text and controls retain
their alpha. The preference persists, can be reset, and reports failed saves.

Fixes #1077.

Design / 设计边界

  • Settings core owns the opt-in boolean, default, parsing and reset; GPUI caches
    the resolved preference and uses the existing live wallpaper opacity.
  • Surface colors, gradients, borders and shadows fade rather than whole elements,
    so controls, text and popup backgrounds remain independently readable.
  • On this base the glass redesign removed the navigation fill. This patch restores
    a solid navigation fill when the preference is off, retaining the readability
    intent of [Bug] 透明度高了会使文字不清晰 #903. Existing glass cards keep their current appearance when off.
  • The existing settings format and persistence path are reused. No dependency,
    thread or public rendering interface is added. Missing/invalid values mean off.
  • Move the complete blur-material type, parser and its existing tests into
    window_effects.rs, re-exporting the same public type; no budget was increased
    and no assertions were removed.
  • At low opacity, choosing a light theme over a dark wallpaper can reduce text
    contrast. The setting explicitly leaves that choice to the user.

Evidence / 验证依据

Windows: 111 settings tests passed; the theme/interaction group passed 50 tests (2 native desktop probes ignored), including mouse, keyboard, reset, 620px scrolling, padding hit targets and a real failed save. After the final wording update, the 2 opacity regressions passed again. The production gpui-shell build, 2 file-budget tests, i18n checks (24 passed, 1 ignored), architecture check and its 62 unit tests, and cargo fmt all passed. Native Windows screenshots cover Nord/NordLight, 0%/50%, opt-in off/on, English/Chinese, and 620px scrolling at 96 DPI. macOS, Linux, fractional DPI and the full application suite were not run.

The regressions exercise the actual Settings switch and card rendering path,
including 0/50/100% for both light and dark themes. Before this change there is no
opt-in preference and the surfaces do not follow the live alpha.

Commands:

cargo test --locked -p pebrel-settings
cargo test --locked -p pebrel --bin pebrel --features gpui-shell,gpui-test-support theme_studio_tests -- --test-threads=1
cargo test --locked -p pebrel --bin pebrel --features gpui-shell,gpui-test-support settings_opacity -- --test-threads=1
cargo build --locked -p pebrel --bin pebrel --features gpui-shell
cargo test --locked -p pebrel --test file_line_budget --features gpui-shell
cargo test --manifest-path tools/i18n-contract/Cargo.toml --locked
cargo fmt --all -- --check
python scripts/check_architecture.py --base 76f74be115ec0fa75dca9a9fdaf6e682f83e05f5
python -m unittest scripts.tests.test_architecture_budgets scripts.tests.test_architecture_dependencies scripts.tests.test_architecture_governance

Native captures below use the production Settings page with isolated settings and
a generated wallpaper. They show off/on at 0% and Chinese text in a light theme.
The OS constrained the client height to 1069px; these are not 1200px-high captures.

dark-default-zero.png

dark-follow-zero.png

light-follow-zero.png

Required Review / 必须确认

  • Followed the contribution, architecture and project-constraints documents.
  • Responsibilities remain with settings core and GPUI; no duplicate authority.
  • Architecture checks pass without increasing budgets.
  • Success/failure and native UI evidence are included; platform limits stated.
  • Both languages use typed message IDs with matching placeholders.
  • No governance rule changed.

This change was prepared with AI assistance.

@Aschenbath
Aschenbath requested a review from Kuddev as a code owner November 23, 2026 13:56
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.

[Bug] 窗口背景不透明度设为 0% 时,设置页侧栏和设置卡片仍是实色,无法整体透明

1 participant