diff --git a/bitchat/Views/ContentSheetViews.swift b/bitchat/Views/ContentSheetViews.swift index 4d9d5c5b..f8fb9411 100644 --- a/bitchat/Views/ContentSheetViews.swift +++ b/bitchat/Views/ContentSheetViews.swift @@ -393,6 +393,11 @@ private struct ContentPrivateChatSheetView: View { ) .themedSurface() .frame(maxWidth: .infinity, maxHeight: .infinity) + // Swipe-right-to-leave lives on the message list only. On the + // whole sheet it preempted the composer's press-and-hold mic + // gesture (a high-priority ancestor drag cancels child gestures + // within milliseconds — same starvation as the image-reveal bug). + .highPriorityGesture(swipeToLeaveGesture) if !theme.usesGlassChrome { Divider() @@ -423,18 +428,19 @@ private struct ContentPrivateChatSheetView: View { } .themedSheetBackground() .foregroundColor(palette.primary) - .highPriorityGesture( - DragGesture(minimumDistance: 25, coordinateSpace: .local) - .onEnded { value in - let horizontal = value.translation.width - let vertical = abs(value.translation.height) - guard horizontal > 80, vertical < 60 else { return } - withAnimation(.easeInOut(duration: TransportConfig.uiAnimationMediumSeconds)) { - showSidebar = true - privateConversationModel.endConversation() - } + } + + private var swipeToLeaveGesture: some Gesture { + DragGesture(minimumDistance: 25, coordinateSpace: .local) + .onEnded { value in + let horizontal = value.translation.width + let vertical = abs(value.translation.height) + guard horizontal > 80, vertical < 60 else { return } + withAnimation(.easeInOut(duration: TransportConfig.uiAnimationMediumSeconds)) { + showSidebar = true + privateConversationModel.endConversation() } - ) + } } /// Persistent one-line reminder that this composer feeds a private