From 68c61476d8f9c7f709faa38b2b15938d4360eab7 Mon Sep 17 00:00:00 2001 From: jack Date: Thu, 21 Aug 2025 00:49:12 +0200 Subject: [PATCH] UI: show Bluetooth range next to #bluetooth in location sheet --- bitchat/Views/LocationChannelsSheet.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bitchat/Views/LocationChannelsSheet.swift b/bitchat/Views/LocationChannelsSheet.swift index 8c95ce92..80a9c0e4 100644 --- a/bitchat/Views/LocationChannelsSheet.swift +++ b/bitchat/Views/LocationChannelsSheet.swift @@ -93,7 +93,7 @@ struct LocationChannelsSheet: View { private var channelList: some View { List { // Mesh option first - channelRow(title: meshTitleWithCount(), subtitle: "#bluetooth", isSelected: isMeshSelected, titleColor: standardBlue) { + channelRow(title: meshTitleWithCount(), subtitle: "#bluetooth • \(bluetoothRangeString())", isSelected: isMeshSelected, titleColor: standardBlue) { manager.select(ChannelID.mesh) isPresented = false } @@ -336,6 +336,18 @@ extension LocationChannelsSheet { return String(format: "%.1f", value) } + private func bluetoothRangeString() -> String { + let usesMetric: Bool = { + if #available(iOS 16.0, *) { + return Locale.current.measurementSystem == .metric + } else { + return Locale.current.usesMetricSystem + } + }() + // Approximate Bluetooth LE range for typical mobile devices; environment dependent + return usesMetric ? "~10–50 m" : "~30–160 ft" + } + private func locationName(for level: GeohashChannelLevel) -> String? { manager.locationNames[level] }