mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-24 22:45:19 +00:00
Fix press-and-hold mic dying instantly in private chats (#1405)
The private-chat sheet wraps its entire content — composer included — in a high-priority swipe-right-to-leave DragGesture. A high-priority ancestor drag preempts child gestures, so the composer mic's press-and-hold was cancelled 3-10 ms after touch-down (observed on both iOS and macOS in field logs), making voice notes unrecordable inside DMs while working fine in the public timeline. Same starvation mechanism as the DM image-reveal bug (#1402), hitting a drag instead of a tap. The swipe-to-leave gesture now attaches to the message list only — where users actually swipe — leaving the composer's gestures (mic hold, text field, buttons) out of its reach. Co-authored-by: jack <jackjackbits@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
jack
Claude Fable 5
parent
e642f696cb
commit
6886035632
@@ -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,7 +428,9 @@ private struct ContentPrivateChatSheetView: View {
|
||||
}
|
||||
.themedSheetBackground()
|
||||
.foregroundColor(palette.primary)
|
||||
.highPriorityGesture(
|
||||
}
|
||||
|
||||
private var swipeToLeaveGesture: some Gesture {
|
||||
DragGesture(minimumDistance: 25, coordinateSpace: .local)
|
||||
.onEnded { value in
|
||||
let horizontal = value.translation.width
|
||||
@@ -434,7 +441,6 @@ private struct ContentPrivateChatSheetView: View {
|
||||
privateConversationModel.endConversation()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/// Persistent one-line reminder that this composer feeds a private
|
||||
|
||||
Reference in New Issue
Block a user