Add @ autocomplete functionality

- Added autocomplete state tracking in ChatViewModel
- Implemented updateAutocomplete() to parse @ mentions and show suggestions
- Added completeNickname() to handle nickname completion
- Created autocomplete UI overlay above input field
- Shows list of matching nicknames when typing @
- Highlights selected suggestion
- Clicking suggestion completes the mention
This commit is contained in:
jack
2025-07-03 01:08:11 +02:00
parent 4b98aa7918
commit d142fde11d
5 changed files with 251 additions and 17 deletions
+3 -2
View File
@@ -150,7 +150,7 @@ class BluetoothMeshService: NSObject {
self.characteristic = characteristic
}
func sendMessage(_ content: String, to recipientID: String? = nil) {
func sendMessage(_ content: String, mentions: [String] = [], to recipientID: String? = nil) {
messageQueue.async { [weak self] in
guard let self = self else { return }
@@ -162,7 +162,8 @@ class BluetoothMeshService: NSObject {
content: content,
timestamp: Date(),
isRelay: false,
originalSender: nil
originalSender: nil,
mentions: mentions.isEmpty ? nil : mentions
)
if let messageData = message.toBinaryPayload() {