Skip to content

Studio: blur modal titlebar background while keeping window controls sharp - #12433

Merged
mahiatlinux merged 7 commits into
unslothai:mainfrom
Imagineer99:fix/titlebar-modal-blur
Oct 1, 2026
Merged

mahiatlinux merged 7 commits into
unslothai:mainfrom
Imagineer99:fix/titlebar-modal-blur

Conversation

@Imagineer99

Copy link
Copy Markdown
Member

Opening an image preview blurs the page while leaving the Windows/Linux title bar sharp. Add a pointer-transparent backdrop over the custom title bar surface and page navigation for viewport dialogs, alerts and sheets. Keep minimize/maximize/close above that backdrop so their glyphs and normal hover feedback stay sharp and usable.

Panel-local dialogs and menus leave the title bar clear. Nested dialogs retain the effect until the last viewport modal closes. Native macOS chrome is unchanged.

Before / after

Title bar before and after

Window controls retain their normal hover feedback in both themes:

Sharp window control hover states

Full light comparison · Full dark comparison · Evidence metadata

These Playwright captures compare base acc0c89fcb1e with head ca4add32fef5 using production titlebar, media viewer and overlay components in an identical deterministic fixture. Tauri IPC is stubbed; native OS window actions are not executed by Playwright. The full-frame comparisons differ only in the top 40 CSS pixels. The equivalent change was also built into the user's customized Windows desktop app and tested there before this rebase.

Validation

  • Production frontend build and TypeScript checks passed.
  • All 3 existing titlebar layering tests and 9 CI coverage tests passed.
  • Chromium checks passed for media previews, dialogs, alerts, sheets, nested modals, dismissal, panel-local dialogs, menus, window-command dispatch, dragging, light/dark themes, narrow windows and web/macOS exclusions.
  • Fixed-state assertions fail on unmodified main.
  • Added the regression scene to frontend CI.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@danielhanchen

Copy link
Copy Markdown
Member

Two of the failures here come from this PR; the rest are on main.

From this PR:

  • Frontend build + bundle sanity and Frontend unit tests (Windows): tests/crypto-uuid-boot.test.ts "every page loads the polyfill before its module entry" fails on this branch and passes on main. A page this PR adds or edits needs to load the crypto UUID polyfill before its module entry.
  • Repo tests (CPU, rest): tests/studio/playwright_titlebar_blur.py is not at the ruff-format fixed point. Run python scripts/run_ruff_format.py tests/studio/playwright_titlebar_blur.py.

On main, not from this PR, and fixed by #12440 and #12441:

  • the same fixed-point check on tests/studio/test_desktop_reliability_frontend_contract.py;
  • test_api_monitor_entries_and_expanded_text_can_shrink;
  • test_top_level_group_counts_against_the_running_pin_total;
  • test_the_text_of_the_turn_survives_translation.

A rebase after those merge picks them up.

@Imagineer99
Imagineer99 force-pushed the fix/titlebar-modal-blur branch from b331735 to 9f3ddf0 Compare October 1, 2026 15:36
@mahiatlinux mahiatlinux self-assigned this Oct 1, 2026
@mahiatlinux

mahiatlinux commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Manual review, repairs, and UI evidence

Reviewed final source head 20719ef0947044ca116352518669fd67b1a86c99 against merge base 564e98902248871b7be83ceb0a21d594cf9bf7b3, and reviewed the current-main mirror at mahiatlinux/unsloth-staging-review#81.

Codex raised three mirror threads. I confirmed and repaired two:

  • Replaced the document-wide descendant body:has(...) with a direct-child selector. In a synthetic 600,686-element DOM, 40 append-plus-forced-style samples measured 26.8 ms median and 33.2 ms p95 with the descendant selector, versus 14.8 ms median and 16.7 ms p95 with the direct-child selector. The live Radix viewport overlays were confirmed as direct children of body.
  • Marked the custom fixed GuidedTour Radix overlay as a viewport backdrop. The browser scene now opens the real tour component and asserts the computed titlebar effect.

The narrow-navbar report was not reachable: Navbar takes its mobile branch only through useIsMobileShell(), defined as useIsMobile() && !isTauri, while the custom titlebar requires isTauri. The 640 px Tauri fixture confirmed there is no mobile sidebar trigger in the custom-titlebar state. That thread was resolved with this code and runtime evidence, without adding dead styling.

Fix commit 6918c39c3 was pushed to the mirror and landed back to the contributor branch with mirror-pr.py, producing final source commit 20719ef0947044ca116352518669fd67b1a86c99.

Final UI A/B

I ran the deterministic production-component scene against the immutable merge base and the exact repaired source head in isolated installs. The base-derived side received only the smoke page and harness so both sides exercised identical interactions.

Expected and observed: base leaves the Windows/Linux custom titlebar sharp behind viewport modals; the repaired head dims/blurs only the 40 CSS-pixel titlebar band while minimize, maximize, and close remain sharp and pointer-accessible.

Titlebar close-up, before and after

Guided tour, before and after

Full light scene, before and after

Full dark scene, before and after

Narrow scene, before and after

Measured Chromium facts:

  • Base media and tour: generated content none, blur none.
  • Repaired media and tour: generated content present, opacity 1, blur blur(2px), pointer-events none, titlebar backdrop z-index 90, controls z-index 100, Radix overlay z-index 50.
  • Light, dark, and narrow media pixel diffs were bounded exactly to y=0..39. The 1440x900 light capture changed 57,558 pixels, the dark capture 57,525, and the 640x700 narrow capture 25,558.
  • Media viewer, dialog, alert, sheet, the real guided tour, nested modal, dismissal, panel-local exclusion, menu exclusion, minimize/maximize/close dispatch, titlebar drag, light/dark, narrow, web exclusion, and macOS custom-titlebar exclusion all passed.

The same original feature A/B matrix passed with Playwright Firefox 153.0 and the same computed style facts:

Firefox titlebar close-up, before and after

Firefox light | Firefox dark | Firefox narrow

Compatibility basis: Tauri documents Windows WebView2/Chromium and Linux WebKitGTK. WebKit shipped :has() support and lists backdrop-filter plus -webkit-backdrop-filter as supported, matching the declarations used here.

All composites were opened and manually inspected. The expected titlebar treatment is present, the guided-tour gap is closed, and all three native-control glyphs stay sharp. Tauri IPC was stubbed, so no native OS window command was executed.

Executed checks

  • npm run build passed on the exact final source head and on the current-main mirror.
  • npm test passed after the repair: 9,759 passed, 0 failed.
  • The four focused titlebar layering tests passed on the exact final source head.
  • The repository formatter was a fixed point for tests/studio/playwright_titlebar_blur.py; Ruff check passed.
  • git diff --check passed for the final source and mirror net diffs.
  • The isolated Chromium scene passed on the exact final source head with zero page errors.
  • Source CI at final review: 35 successful, 19 pending, 0 failing.

One earlier mirror scene run performed concurrently with the production build and full unit suite timed out waiting for a stubbed window-command dispatch. No code changed; isolated reruns passed on both the mirror and exact final source tree. I classified that as CPU-saturation flake rather than a product failure.

The mirror's GitGuardian alert names studio/backend/tests/test_mcp_image.py, which has no net diff from the mirror base. It is unrelated to this PR's patch.

Full evidence metadata, exact commands, environment, raw captures, and failure model

@mahiatlinux mahiatlinux 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.

LGTM! Ready to merge, all manually checked.

@mahiatlinux

Copy link
Copy Markdown
Contributor
image

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.

3 participants