Skip to content

Fix main graph locking up after system-cancelled gestures - #733

Open
bjorkert wants to merge 1 commit into
devfrom
fix/chart-gesture-lock-recovery
Open

Fix main graph locking up after system-cancelled gestures#733
bjorkert wants to merge 1 commit into
devfrom
fix/chart-gesture-lock-recovery

Conversation

@bjorkert

Copy link
Copy Markdown
Member

A few times the main graph has stopped responding to panning and zooming while the small graph could still move it, and only an app restart would unlock it. The cause is that SwiftUI gestures never receive onEnded when the system cancels a touch, for example from a permission alert, an incoming call or an app switch. The pinch or inspect state then stays latched and swallows every following touch, and in the worst case the gesture system for the view stops delivering events entirely.

This change clears leaked gesture state whenever a new touch begins, resets it when the chart disappears, and rebuilds the chart's gesture attachments when the app returns to the foreground. The current position and zoom are kept across that rebuild, so nothing changes visually.

When the system cancels a touch (permission alert, incoming call, app
switch) the chart gestures never get their onEnded call, so pinch or
inspect state stays latched and blocks all panning and zooming until the
app is restarted. Clear leaked gesture state when a new touch begins,
reset it when the chart disappears, and rebuild the gesture attachments
on foregrounding while keeping the current viewport.

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Accepting code from @bjorkert .

Test by building and using the main-screen zoom and scroll features.

  • ✅ Mac Catalyst (not the pinch part)
  • ✅ SE 2nd gen, iOS 18, Loop URL
  • ✅ SE 3rd gen, iOS 26, Trio URL

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.

2 participants