mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 15:45:20 +00:00
Fix/visuals (#469)
* Geohash peers: show face.dashed for self when channel selected via teleport; face.smiling otherwise * Geo presence: broadcast 'teleport' tag on geochat join; track teleported participants and show face.dashed for them in peer list * Teleport tag: attach to actual geohash chat events (sendMessage, emotes, screenshots) instead of separate presence; remove presence emit * Fix: show face.dashed for any teleported peer (not just self) in geohash list * Geo list: show self immediately on channel switch and mark teleported state; clear teleported flags on leaving geochat * Teleport persistence: recompute teleported based on current location vs selected geohash; add face.dashed icon to Teleport button label * Styling: use lighter green/orange for #abcd suffix after nicknames in all chats (senders and @mentions) * Peer lists: render #abcd suffix as lighter green/orange (self orange) in geohash and mesh lists * Toolbar: move unread icon next to #channel badge and allow dynamic width; Peer lists: increase top spacing before first item * Toolbar: prevent geohash channel badge from truncating; give it layout priority and fixed width * Toolbar: make unread envelope independent from channel button (sits left of badge); fix accidental taps opening channel selector * Toolbar: make unread envelope open most recent unread/private chat directly * Geohash peer list: render self row fully orange (icon, base, suffix, '(you)') --------- Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -60,9 +60,19 @@ struct MeshPeerList: View {
|
||||
}
|
||||
|
||||
let displayName = isMe ? viewModel.nickname : peer.nickname
|
||||
Text(displayName)
|
||||
.font(.system(size: 14, design: .monospaced))
|
||||
.foregroundColor((peer.favoriteStatus?.isFavorite ?? false) || peerNicknames[peer.id] != nil ? textColor : secondaryTextColor)
|
||||
let (base, suffix) = splitSuffix(from: displayName)
|
||||
let baseColor = ((peer.favoriteStatus?.isFavorite ?? false) || peerNicknames[peer.id] != nil) ? textColor : secondaryTextColor
|
||||
HStack(spacing: 0) {
|
||||
Text(base)
|
||||
.font(.system(size: 14, design: .monospaced))
|
||||
.foregroundColor(baseColor)
|
||||
if !suffix.isEmpty {
|
||||
let suffixColor = isMe ? Color.orange.opacity(0.6) : baseColor.opacity(0.6)
|
||||
Text(suffix)
|
||||
.font(.system(size: 14, design: .monospaced))
|
||||
.foregroundColor(suffixColor)
|
||||
}
|
||||
}
|
||||
|
||||
if let icon = item.enc.icon, !isMe {
|
||||
Image(systemName: icon)
|
||||
@@ -83,7 +93,7 @@ struct MeshPeerList: View {
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.padding(.vertical, 4)
|
||||
.padding(.top, idx == 0 ? 6 : 0)
|
||||
.padding(.top, idx == 0 ? 10 : 0)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture { if !isMe { onTapPeer(peer.id) } }
|
||||
.onTapGesture(count: 2) { if !isMe { onShowFingerprint(peer.id) } }
|
||||
@@ -92,3 +102,16 @@ struct MeshPeerList: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Helper to split a trailing #abcd suffix
|
||||
private func splitSuffix(from name: String) -> (String, String) {
|
||||
guard name.count >= 5 else { return (name, "") }
|
||||
let suffix = String(name.suffix(5))
|
||||
if suffix.first == "#", suffix.dropFirst().allSatisfy({ c in
|
||||
("0"..."9").contains(String(c)) || ("a"..."f").contains(String(c)) || ("A"..."F").contains(String(c))
|
||||
}) {
|
||||
let base = String(name.dropLast(5))
|
||||
return (base, suffix)
|
||||
}
|
||||
return (name, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user