Skip to content

fix(desktop): restore glass panel clipping broken by the hit-region reporter - #11602

Merged
kodjima33 merged 5 commits into
mainfrom
kodjima33/glass-hitregion-render-neutral
Aug 15, 2026
Merged

kodjima33 merged 5 commits into
mainfrom
kodjima33/glass-hitregion-render-neutral

Conversation

@kodjima33

@kodjima33 kodjima33 commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

GlassSurfaceReviewRegressionTests.testInkGlassPanelClipsReturnedContentButNotAnOuterOverlay fails on main, so Desktop 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 (an NSViewRepresentable) to InkGlassPanelModifier's background. An AppKit view inside that subtree changes how ImageRenderer rasterizes 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 neighbouring ShellModalScrimDismissTests failure persists — that one is pre-existing and not addressed here).

Fix

Register from InkGlassBackdrop's own NSVisualEffectView (now InkGlassBackdropView) — a view the panel already mounts — so the registry adds nothing to any render tree. Reduce Transparency mounts no backdrop, so hasSurfaces(in:) now keeps a window with no registered surface fully interactive instead of turning it into a pass-through hole. debug_hit_probe reports glassSurfaces=<n> so a pass-through verdict can be told apart from that fallback.

Failure-Class: none

Verification

  • swift test --filter GlassSurfaceReviewRegressionTests → 3 passed (fails on main without this change).
  • Built and ran the omi-glassfix bundle: panels render with their rounded clip (screenshot in review), and debug_hit_probe reports glassSurfaces=3 with 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

Review in cubic

… 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

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@kodjima33
kodjima33 merged commit 72b309c into main Aug 15, 2026
29 checks passed
@kodjima33
kodjima33 deleted the kodjima33/glass-hitregion-render-neutral branch August 15, 2026 07:29
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.

1 participant