Repository navigation
fix(desktop): hug the summoned shell window to the glass - #11579
Conversation
The 900 pt readable-lane cap inside a larger transparent window left empty wallpaper that still owned clicks. Cap the window at lane plus page margins instead, fill the lane to that frame, and clamp restored frames so a pre-hug 1200 pt width cannot bring the border back. Failure-Class: FC-transparent-top-level-window-occlusion Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
3 issues found across 7 files
Confidence score: 3/5
- In
desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift,adjustWindowWidth(expand:)expands by 400 pt but runs into the 932 pt max cap, so the Tasks chat panel can open in a window that is too narrow and visibly clips content; align the expansion logic with the max-width limit (or raise the cap when that panel is shown). - In
desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift,pinShellWindowSizeLimitsapplies the 932 pt max width to any window titled with an "omi" prefix, which can incorrectly constrain Rewind and auxiliary windows and truncate intended layouts; scope the size pinning to the summoned shell window via a stricter identifier than title prefix. - In
desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift, allowing a 10,000 pt max content height instead of using the active screenvisibleFramecan let users resize the transparent shell off-screen and leave a large occluding frame behind; cap max height to the current display bounds and re-clamp on screen changes.
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/DesktopHomeView.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift:524">
P2: The new max-size pin allows a 10,000 pt content height instead of the active screen's `visibleFrame` height. A user can resize the transparent shell beyond the display and regain a large off-screen occluding frame; preserve the display-derived height limit while adding only the 932 pt width cap.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift:527">
P1: When the Tasks chat panel opens, `adjustWindowWidth(expand:)` adds 400 pt to the Omi window. This 932 pt maximum clamps that resize, so the panel is rendered into an undersized window and its content is clipped; exempt the expanded Tasks layout or include its panel width in the applicable maximum.</violation>
<violation number="3" location="desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift:527">
P2: `pinShellWindowSizeLimits` pins the 932 pt max width on every window whose title begins with "omi", not just the summoned hug-glass shell. Rewind mode (default width 1000) and other auxiliary windows (chat lab, prompt editors) share the "omi" title prefix, so the new max-size pin clamps them narrower than their designed default and prevents wider sizing. Apply the width max only to the actual shell window (e.g. match the exact shell title or use `isShellWindow`) while keeping the min-size pin for all omi windows.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| height: 10_000) | ||
| window.contentMinSize = minimumContentSize | ||
| window.minSize = window.frameRect(forContentRect: NSRect(origin: .zero, size: minimumContentSize)).size | ||
| window.contentMaxSize = maximumContentSize |
There was a problem hiding this comment.
P1: When the Tasks chat panel opens, adjustWindowWidth(expand:) adds 400 pt to the Omi window. This 932 pt maximum clamps that resize, so the panel is rendered into an undersized window and its content is clipped; exempt the expanded Tasks layout or include its panel width in the applicable maximum.
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/DesktopHomeView.swift, line 527:
<comment>When the Tasks chat panel opens, `adjustWindowWidth(expand:)` adds 400 pt to the Omi window. This 932 pt maximum clamps that resize, so the panel is rendered into an undersized window and its content is clipped; exempt the expanded Tasks layout or include its panel width in the applicable maximum.</comment>
<file context>
@@ -526,15 +510,51 @@ struct DesktopHomeView: View {
+ height: 10_000)
+ window.contentMinSize = minimumContentSize
+ window.minSize = window.frameRect(forContentRect: NSRect(origin: .zero, size: minimumContentSize)).size
+ window.contentMaxSize = maximumContentSize
+ window.maxSize = window.frameRect(forContentRect: NSRect(origin: .zero, size: maximumContentSize)).size
+
</file context>
| let minimumContentSize = DesktopWindowLayoutPolicy.minimumContentSize | ||
| let maximumContentSize = NSSize( | ||
| width: DesktopWindowLayoutPolicy.maximumContentWidth, | ||
| height: 10_000) |
There was a problem hiding this comment.
P2: The new max-size pin allows a 10,000 pt content height instead of the active screen's visibleFrame height. A user can resize the transparent shell beyond the display and regain a large off-screen occluding frame; preserve the display-derived height limit while adding only the 932 pt width cap.
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/DesktopHomeView.swift, line 524:
<comment>The new max-size pin allows a 10,000 pt content height instead of the active screen's `visibleFrame` height. A user can resize the transparent shell beyond the display and regain a large off-screen occluding frame; preserve the display-derived height limit while adding only the 932 pt width cap.</comment>
<file context>
@@ -526,15 +510,51 @@ struct DesktopHomeView: View {
+ let minimumContentSize = DesktopWindowLayoutPolicy.minimumContentSize
+ let maximumContentSize = NSSize(
+ width: DesktopWindowLayoutPolicy.maximumContentWidth,
+ height: 10_000)
+ window.contentMinSize = minimumContentSize
+ window.minSize = window.frameRect(forContentRect: NSRect(origin: .zero, size: minimumContentSize)).size
</file context>
| height: 10_000) | ||
| window.contentMinSize = minimumContentSize | ||
| window.minSize = window.frameRect(forContentRect: NSRect(origin: .zero, size: minimumContentSize)).size | ||
| window.contentMaxSize = maximumContentSize |
There was a problem hiding this comment.
P2: pinShellWindowSizeLimits pins the 932 pt max width on every window whose title begins with "omi", not just the summoned hug-glass shell. Rewind mode (default width 1000) and other auxiliary windows (chat lab, prompt editors) share the "omi" title prefix, so the new max-size pin clamps them narrower than their designed default and prevents wider sizing. Apply the width max only to the actual shell window (e.g. match the exact shell title or use isShellWindow) while keeping the min-size pin for all omi windows.
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/DesktopHomeView.swift, line 527:
<comment>`pinShellWindowSizeLimits` pins the 932 pt max width on every window whose title begins with "omi", not just the summoned hug-glass shell. Rewind mode (default width 1000) and other auxiliary windows (chat lab, prompt editors) share the "omi" title prefix, so the new max-size pin clamps them narrower than their designed default and prevents wider sizing. Apply the width max only to the actual shell window (e.g. match the exact shell title or use `isShellWindow`) while keeping the min-size pin for all omi windows.</comment>
<file context>
@@ -526,15 +510,51 @@ struct DesktopHomeView: View {
+ height: 10_000)
+ window.contentMinSize = minimumContentSize
+ window.minSize = window.frameRect(forContentRect: NSRect(origin: .zero, size: minimumContentSize)).size
+ window.contentMaxSize = maximumContentSize
+ window.maxSize = window.frameRect(forContentRect: NSRect(origin: .zero, size: maximumContentSize)).size
+
</file context>
…halo The 34 pt ambient shadow clipped into the 16 pt inset and read as a black band; AppKit's resize rim sat on that outer frame. Inset the glass by the 8 pt resize rim and use a lift that fits inside it. Failure-Class: FC-transparent-top-level-window-occlusion Co-authored-by: Cursor <[email protected]>
The 8 pt gutter and unused title-bar clearance put AppKit's resize rim on empty air around the panels. The lane fills the window, the top bar occupies the hidden title-bar band, and the page sits on the bottom edge. Failure-Class: FC-transparent-top-level-window-occlusion
What changed and why
The summoned macOS shell is a transparent window. The 900 pt readable-lane cap inside that window left empty wallpaper that still belonged to the frame, so clicks beside the glass went nowhere (recurrence of #11552 /
FC-transparent-top-level-window-occlusion). The lane now fills the window, and the window itself is capped at the readable lane.The first hug still left a gutter that clipped the ambient shadow into a thick black halo, and AppKit's resize rim sat on that outer frame. The 8 pt inset and the unused title-bar clearance were the remaining invisible distance between the grab handle and the visible glass. Both are gone:
windowInsetis 0, the top bar occupies the hidden title-bar band (titlebarClearanceis 0), and the page sits on the window's bottom edge. Grabbing the visible panel edge resizes. Remembered pre-hug frames are clamped so the border cannot restore.Height stays display-limited (
visibleFrame); Retina scale is not multiplied. Click-through still covers leftover air (rounded-corner triangles, gaps between stacked panels).Product invariants affected
OmiApp.swiftwindow chrome; session contract unchangedHow it was verified
xcrun swift test --package-path Desktop --filter 'PageGlassLaneTests|ShellModalScrimTests|ShellWindowChromeTests|ShellGlassChromeTests|ShellClickThroughPolicyTests|TopNavigationBarLayoutTests|ChatSurfaceBoundsTests|FloatingGlassChromeTests|ShellSummonTests|DesktopWindowLayoutPolicyTests|QueryShellTests'— 0 failures./Applications/omi-hug-glass.app(com.omi.omi-hug-glass). The titled main window should measure 900 pt wide. Production Omi / Omi Beta / Omi Dev were not overwritten.Tests
TopNavigationBarLayoutTests.testNavigationLaneMatchesFullChatWidthAndPageInsets— the 900 pt cap is on the window; the lane fills the window.ShellClickThroughPolicyTests.testResizableWindowKeepsAnInteractiveEdgeRim— window inset is 0 so the resize rim is on the glass.ShellGlassChromeTests.testTitlebarClearanceIsZeroBecauseTheTopBarOccupiesTheBand— no extra band above the nav bar.PageGlassLaneTests.testTheLanesGlassFillsTheWindowWidthAndKeepsVerticalGaps— horizontal flush; page sits on the window bottom.ShellSummonTests.testARememberedPreHugFrameIsHuggedToTheReadableLane— a 1400 pt remembered frame on a large display becomes the hug max.Failure class (fixes)
Failure-Class: FC-transparent-top-level-window-occlusion
Line-Count-Exception: desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift | 1594 -> 1614 | pin max window width next to the existing min-size pin; splitting DesktopHomeView is out of scope for this hug fix