Repository navigation
fix(desktop): restore glass panel clipping broken by the hit-region reporter - #11602
Conversation
… main
Release Eligibility runs the canonical post-merge lane with
--skip-pr-body-checks and an empty body, which excludes only checks that
declare requires_pr_body. product-file-line-count-ratchet and
failure-class-guard-artifact-ratchet both consume {pr_body_file} but did
not declare it, so every merge that legitimately carried a
Line-Count-Exception (or guard-artifact note) failed Release Eligibility
on main — permanently, because no authoritative PR body exists on a push.
That is a required exact-SHA check for the desktop release planner, so
one such merge wedges the release train: after #11596 grew
OmiMarkdown.swift 1636 -> 1643 with an approved exception, main went red
and no desktop candidate cut for 9 hours across five desktop merges.
Declare requires_pr_body on both checks (the manifest header already
states this rule) and add a manifest-wide contract test asserting that
any check consuming {pr_body_file} declares it, so a third one cannot
reintroduce the wedge. PR-lane authority is unchanged: both checks still
run on every PR, where the exception is readable.
Verification: replayed the canonical post-merge lane against the wedged
commit (--base 68e869c --head 9f87c2f --skip-pr-body-checks) — 18
checks pass where CI reported 'product-file-line-count-ratchet FAIL';
.github/scripts/test_run_checks.py 45 passed (1 pre-existing unrelated
DeferredMarkerTests failure, also red on clean main);
test_check_release_eligibility.py + test_preflight_runner.py 34 passed.
Failure-Class: none
…eporter #11552 registered each glass panel's extent by adding an InkGlassHitRegionReporter (an NSViewRepresentable) to the panel modifier's background. An AppKit view inside that subtree changes how ImageRenderer rasterizes it, and the panel stopped clipping returned content to its rounded corner: GlassSurfaceReviewRegressionTests.testInkGlassPanelClipsReturnedContentButNotAnOuterOverlay has been failing on main ever since. Desktop Swift Build & Tests is a required check for the release planner, so this also held candidates back. Register from InkGlassBackdrop's own NSVisualEffectView instead — a view the panel already mounts — so the registry adds nothing to any render tree. Reduce Transparency mounts no backdrop, so a window with no registered surface now stays fully interactive rather than becoming a pass-through hole. debug_hit_probe reports the surface count so a pass-through verdict can be told apart from that fallback. Verification: swift test --filter GlassSurfaceReviewRegressionTests — 3 passed (the clipping test fails on main without this change; confirmed by removing only the reporter). Built and ran omi-glassfix: panels render with their rounded clip, debug_hit_probe reports glassSurfaces=3 with the title band still passing clicks through (accepts=false) and panel content interactive (accepts=true). Failure-Class: none
There was a problem hiding this comment.
1 issue found across 7 files
Confidence score: 3/5
- In
desktop/macos/Desktop/Sources/MainWindow/ShellClickThrough.swift, the Reduce Transparency guard appears to make the whole transparent shell window interactive, so clicks in visual "air" regions (panel gaps/rounded corners) are swallowed instead of passing through, which can block underlying app interactions and feel like a regression in window behavior — tighten the hit-testing condition so only visible shell content receives events under Reduce Transparency.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/Desktop/Sources/MainWindow/ShellClickThrough.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/ShellClickThrough.swift:107">
P2: Under Reduce Transparency this guard makes the entire transparent shell window fully interactive, so clicks over the shell's "air" (gaps between panels, rounded-corner triangles) are swallowed again instead of passing through — the dead-zone bug class fixed in #11372. The removed `InkGlassBackdropView`-unconditional reporter used to register every panel's extent regardless of Reduce Transparency, so air pass-through kept working; now the only thing that registers a surface for the SwiftUI panels is the material backdrop (`InkGlass.showsMaterial` is false under Reduce Transparency) and `InkGlassSurface`/`InkGlassView` has no callers, so `hasSurfaces` returns false and the fallback returns true for every point. Consider registering the panel's extent even when the material is suppressed (e.g. keep the empty-registry fallback only for genuinely content-less windows), so dead zones do not return for Reduce Transparency users.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| contentContains: { | ||
| // No registered surface means nothing can vouch for this window's content, so it stays | ||
| // fully interactive rather than becoming a pass-through hole. | ||
| guard InkGlassHitRegions.shared.hasSurfaces(in: window) else { return true } |
There was a problem hiding this comment.
P2: Under Reduce Transparency this guard makes the entire transparent shell window fully interactive, so clicks over the shell's "air" (gaps between panels, rounded-corner triangles) are swallowed again instead of passing through — the dead-zone bug class fixed in #11372. The removed InkGlassBackdropView-unconditional reporter used to register every panel's extent regardless of Reduce Transparency, so air pass-through kept working; now the only thing that registers a surface for the SwiftUI panels is the material backdrop (InkGlass.showsMaterial is false under Reduce Transparency) and InkGlassSurface/InkGlassView has no callers, so hasSurfaces returns false and the fallback returns true for every point. Consider registering the panel's extent even when the material is suppressed (e.g. keep the empty-registry fallback only for genuinely content-less windows), so dead zones do not return for Reduce Transparency users.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/ShellClickThrough.swift, line 107:
<comment>Under Reduce Transparency this guard makes the entire transparent shell window fully interactive, so clicks over the shell's "air" (gaps between panels, rounded-corner triangles) are swallowed again instead of passing through — the dead-zone bug class fixed in #11372. The removed `InkGlassBackdropView`-unconditional reporter used to register every panel's extent regardless of Reduce Transparency, so air pass-through kept working; now the only thing that registers a surface for the SwiftUI panels is the material backdrop (`InkGlass.showsMaterial` is false under Reduce Transparency) and `InkGlassSurface`/`InkGlassView` has no callers, so `hasSurfaces` returns false and the fallback returns true for every point. Consider registering the panel's extent even when the material is suppressed (e.g. keep the empty-registry fallback only for genuinely content-less windows), so dead zones do not return for Reduce Transparency users.</comment>
<file context>
@@ -101,7 +101,12 @@ final class ShellMouseInterceptionSync {
+ contentContains: {
+ // No registered surface means nothing can vouch for this window's content, so it stays
+ // fully interactive rather than becoming a pass-through hole.
+ guard InkGlassHitRegions.shared.hasSurfaces(in: window) else { return true }
+ return InkGlassHitRegions.shared.containsPoint($0, in: window)
+ })
</file context>
The first pass registered each panel's extent from InkGlassBackdrop's own view, but Reduce Transparency does not mount the backdrop — so in that accessibility mode the shell had no registered surface, took the empty-registry fallback, and the desktop click dead zone came back. Mount InkGlassHitRegionReporter inside the panel's glass ZStack instead, in every mode. That position is the one the material already occupies, so it does not disturb ImageRenderer the way a background wrapped around the caller's clipped content did. GlassPanelHitRegionTests mounts a real panel in a real window and asserts, for reduceTransparency both true and false, that the panel owns its area while air beside and above it stays click-through, then drives ShellClickThroughPolicy over the same window. Verification: swift test --filter "GlassPanelHitRegionTests|GlassSurfaceReviewRegressionTests" — 5 passed. Negative control: gating the reporter behind showsMaterial fails 3 assertions in the new tests. Live omi-glassfix build, debug_hit_probe with glassSurfaces=3: title band accepts=false, top bar accepts=true, inter-panel gap accepts=false, page panel accepts=true.
surfaceCount ignored alphaValue while containsPoint required it, so a faded-out panel reported a surface but owned no points — the window would take the geometry path with nothing in it and turn entirely click-through. Both now share isVisibleSurface. Verification: swift test --filter "GlassPanelHitRegionTests|GlassSurfaceReviewRegressionTests" — 5 passed.
A glass panel is a squircle, but the registry tested its bare view bounds, so each rounded corner stayed a small dead zone over whatever is behind the window. Surfaces now carry their corner radius and the point test uses rounded containment. Verification: swift test --filter "GlassPanelHitRegionTests|GlassSurfaceReviewRegressionTests" — 6 passed, including testCornerCutOutsAreAirNotSurface (middle, both straight edges, two corner cut-outs, inside-the-arc, outside-bounds, radius 0). Live omi-glassfix probe with glassSurfaces=3: title band accepts=false, top bar accepts=true, inter-panel gap accepts=false, page panel accepts=true.
Problem
GlassSurfaceReviewRegressionTests.testInkGlassPanelClipsReturnedContentButNotAnOuterOverlayfails onmain, soDesktop Swift Build & Tests— a required exact-SHA check for the desktop release planner — is red and holds candidates back.I introduced it in #11552: to let the shell decide where it may pass clicks through, each glass panel registered its extent by adding an
InkGlassHitRegionReporter(anNSViewRepresentable) toInkGlassPanelModifier's background. An AppKit view inside that subtree changes howImageRendererrasterizes it, and the panel stopped clipping returned content to its rounded corner.Controlled experiment on current
main: with both reporters removed, the clipping test passes (the neighbouringShellModalScrimDismissTestsfailure persists — that one is pre-existing and not addressed here).Fix
Register from
InkGlassBackdrop's ownNSVisualEffectView(nowInkGlassBackdropView) — a view the panel already mounts — so the registry adds nothing to any render tree. Reduce Transparency mounts no backdrop, sohasSurfaces(in:)now keeps a window with no registered surface fully interactive instead of turning it into a pass-through hole.debug_hit_probereportsglassSurfaces=<n>so a pass-through verdict can be told apart from that fallback.Failure-Class: none
Verification
swift test --filter GlassSurfaceReviewRegressionTests→ 3 passed (fails onmainwithout this change).omi-glassfixbundle: panels render with their rounded clip (screenshot in review), anddebug_hit_probereportsglassSurfaces=3with the title band still passing clicks through (shellAccepts=false) while panel content stays interactive (shellAccepts=true) — the fix(desktop): pass clicks through transparent dead zones of the shell and notch windows #11552 behaviour is intact.Line-Count-Exception: desktop/macos/Desktop/Sources/DesktopAutomationBridge.swift | 4575 -> 4577 | debug_hit_probe reports the registered surface count so a pass-through verdict is distinguishable from the empty-registry fallback