UI improvements and performance optimizations

- Changed toolbar text from "bitchat*" to "bitchat/" with tighter spacing
- Removed blue intro message when no peers are connected
- Changed RSSI indicator back to simple dot instead of radiowaves icon
- Added triple-tap gesture on chat area to clear current context
- Improved LinkPreviewView performance with metadata caching
- Moved link previews closer to messages for better visual connection
- Fixed AppInfoView duplication by consolidating strings into single location
- Better error handling for link preview ATS errors
This commit is contained in:
jack
2025-07-22 16:19:40 +02:00
parent 849da32947
commit 8f9df5beb3
4 changed files with 348 additions and 273 deletions
+2 -21
View File
@@ -122,21 +122,7 @@ class ChatViewModel: ObservableObject {
.sink { [weak self] (messageID, status) in
self?.updateMessageDeliveryStatus(messageID, status: status)
}
// Show welcome message after delay if still no peers
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) { [weak self] in
guard let self = self else { return }
if self.connectedPeers.isEmpty && self.messages.isEmpty {
let welcomeMessage = BitchatMessage(
sender: "system",
content: "get people around you to download bitchat…and chat with them here!",
timestamp: Date(),
isRelay: false
)
self.messages.append(welcomeMessage)
}
}
// When app becomes active, send read receipts for visible messages
#if os(macOS)
NotificationCenter.default.addObserver(
@@ -2061,12 +2047,7 @@ class ChatViewModel: ObservableObject {
} else {
// System message
var contentStyle = AttributeContainer()
// Check for welcome message
if message.content.contains("get people around you to download bitchat") {
contentStyle.foregroundColor = Color.blue
} else {
contentStyle.foregroundColor = Color.gray
}
contentStyle.foregroundColor = Color.gray
let content = AttributedString("* \(message.content) *")
contentStyle.font = .system(size: 12, design: .monospaced).italic()
result.append(content.mergingAttributes(contentStyle))