Skip to content

fix: prevent infinite layout loop in CatalogHeroView - #10

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/catalog-app-hang
Open

fix: prevent infinite layout loop in CatalogHeroView#10
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/catalog-app-hang

Conversation

@sentry

@sentry sentry Bot commented Jul 28, 2026

Copy link
Copy Markdown

This PR addresses an app hang issue (OPENNOW-MAC-22) caused by an infinite layout loop within CatalogHeroView in CatalogView.swift.

Root Cause:
The GeometryReader's onChange(of: proxy.size.width) handler was updating containerWidth, which in turn adjusted the CatalogHeroView's height. When this view is inside a ScrollView, changes in its height can cause the macOS vertical scrollbar to toggle on or off. This scrollbar toggle changes the available width by approximately 15pt, which was enough to re-trigger the onChange handler, creating a continuous feedback loop and hanging the app during the SwiftUI layout pass.

Solution:
Introduced a threshold check in the onChange handler for proxy.size.width. The containerWidth will now only be updated if the absolute difference between the current containerWidth and the new width is greater than 20 points. This effectively filters out the minor width fluctuations caused by the scrollbar appearing or disappearing, breaking the infinite loop while still allowing legitimate window resizing to function correctly.

Fixes OPENNOW-MAC-22

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.

0 participants