mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 07:05:20 +00:00
Notes header: show count in parentheses; icon shows blue if any notes, grey if none; only start live location updates while sheet is open; reduce nickname width; set live distance filter to 10m
This commit is contained in:
@@ -103,7 +103,7 @@ enum TransportConfig {
|
||||
// Location
|
||||
static let locationDistanceFilterMeters: Double = 1000
|
||||
// Live (channel sheet open) distance threshold for meaningful updates
|
||||
static let locationDistanceFilterLiveMeters: Double = 21.0
|
||||
static let locationDistanceFilterLiveMeters: Double = 10.0
|
||||
static let locationLiveRefreshInterval: TimeInterval = 5.0
|
||||
|
||||
// Notifications (geohash)
|
||||
|
||||
@@ -1185,15 +1185,11 @@ struct ContentView: View {
|
||||
showLocationNotes = true
|
||||
}) {
|
||||
HStack(alignment: .center, spacing: 4) {
|
||||
let hasNotes = (notesCounter.count ?? 0) > 0
|
||||
Image(systemName: "long.text.page.and.pencil")
|
||||
.font(.system(size: 12))
|
||||
.foregroundColor(Color(hue: 0.60, saturation: 0.85, brightness: 0.82))
|
||||
.foregroundColor(hasNotes ? Color(hue: 0.60, saturation: 0.85, brightness: 0.82) : Color.gray)
|
||||
.padding(.top, 1)
|
||||
Text("\(notesCounter.count ?? 0)")
|
||||
.font(.system(size: 11, design: .monospaced))
|
||||
.foregroundColor(Color(hue: 0.60, saturation: 0.85, brightness: 0.82))
|
||||
.lineLimit(1)
|
||||
.fixedSize(horizontal: true, vertical: false)
|
||||
}
|
||||
.fixedSize(horizontal: true, vertical: false)
|
||||
}
|
||||
@@ -1286,30 +1282,10 @@ struct ContentView: View {
|
||||
LocationChannelManager.shared.endLiveRefresh()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
updateNotesCounterSubscription()
|
||||
// Keep live updates running while on mesh to follow building changes
|
||||
if case .mesh = locationManager.selectedChannel, locationManager.permissionState == .authorized {
|
||||
LocationChannelManager.shared.beginLiveRefresh()
|
||||
}
|
||||
}
|
||||
.onChange(of: locationManager.selectedChannel) { _ in
|
||||
updateNotesCounterSubscription()
|
||||
if case .mesh = locationManager.selectedChannel, locationManager.permissionState == .authorized {
|
||||
LocationChannelManager.shared.beginLiveRefresh()
|
||||
} else {
|
||||
LocationChannelManager.shared.endLiveRefresh()
|
||||
}
|
||||
}
|
||||
.onAppear { updateNotesCounterSubscription() }
|
||||
.onChange(of: locationManager.selectedChannel) { _ in updateNotesCounterSubscription() }
|
||||
.onChange(of: locationManager.availableChannels) { _ in updateNotesCounterSubscription() }
|
||||
.onChange(of: locationManager.permissionState) { _ in
|
||||
updateNotesCounterSubscription()
|
||||
if case .mesh = locationManager.selectedChannel, locationManager.permissionState == .authorized {
|
||||
LocationChannelManager.shared.beginLiveRefresh()
|
||||
} else {
|
||||
LocationChannelManager.shared.endLiveRefresh()
|
||||
}
|
||||
}
|
||||
.onChange(of: locationManager.permissionState) { _ in updateNotesCounterSubscription() }
|
||||
.alert("heads up", isPresented: $viewModel.showScreenshotPrivacyWarning) {
|
||||
Button("ok", role: .cancel) {}
|
||||
} message: {
|
||||
|
||||
@@ -42,7 +42,7 @@ struct LocationNotesView: View {
|
||||
private var header: some View {
|
||||
HStack {
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text("notes @ #\(geohash)")
|
||||
Text("notes @ #\(geohash) (\(manager.notes.count))")
|
||||
.font(.system(size: 16, weight: .bold, design: .monospaced))
|
||||
if let buildingName = locationManager.locationNames[.building], !buildingName.isEmpty {
|
||||
Text(buildingName)
|
||||
|
||||
Reference in New Issue
Block a user