UX: long-press a message to prefill @mention with sender's full nick#abcd and focus input

This commit is contained in:
jack
2025-08-22 12:13:59 +02:00
parent 0d064084aa
commit 244c8cdf81
+7
View File
@@ -354,6 +354,13 @@ struct ContentView: View {
showMessageActions = true
}
}
.onLongPressGesture(minimumDuration: 0.35) {
// Quick @mention: prefill input with @nick#abcd
if message.sender != "system" && message.sender != viewModel.nickname {
messageText = "@\(message.sender) "
isTextFieldFocused = true
}
}
.padding(.horizontal, 12)
.padding(.vertical, 2)
}