Compare commits

..
Author SHA1 Message Date
jack 429c88aa1e Header spacing: tighten gap between #mesh/#geohash and peer count 2025-09-13 23:03:30 +02:00
jack 6f3b61c3df Header: move notes + bookmark to left of #mesh/#geohash 2025-09-13 23:01:15 +02:00
jack 3f1a9686dd chore: commit remaining local changes 2025-09-13 22:58:06 +02:00
jack 179378031a Notes sheet: show timestamp in brackets; drop #abcd from @name 2025-09-13 22:54:40 +02:00
jack 03b70e2c2f Notes sheet: color #abcd suffix as darker green via opacity (match chat) 2025-09-13 22:51:36 +02:00
jack 08782f0196 Location Notes header: remove extra gap before #geohash (drop leading padding) 2025-09-13 22:50:01 +02:00
jack e855a2e40b Notes icon: use sheet count until counter finishes initial load; don’t zero on sheet close\n\n- Compute hasNotes using max(count, sheetCount) while initialLoadComplete is false.\n- Remove sheetNotesCount reset on sheet disappear to avoid transient grey. 2025-09-13 22:46:43 +02:00
jack 2b567bfb97 Notes counter: unsubscribe without clearing count on resubscribe\n\n- Avoid calling cancel() in subscribe; just unsubscribe old sub to prevent wiping count to 0.\n- Prevents green→grey flicker after closing sheet or location updates. 2025-09-13 22:45:43 +02:00
jack a6d98de90e Notes counter UX: avoid grey flicker when closing sheet\n\n- Preserve last count during resubscribe to prevent brief 0 state.\n- Keep existing subscription when building geohash temporarily unavailable; only cancel if none or permission revoked. 2025-09-13 22:41:21 +02:00
jack ea22ccda71 Location Channels: boxed 'bookmarked' section; keep 'remove location access' outside box\n\n- Wrap bookmarked list in a rounded, subtle grey box within the list.\n- Ensure the 'remove location access' button is not inside the box and clears list row background. 2025-09-13 22:38:40 +02:00
jack 19533742ff Notes icon: use green when notes exist (matches app green) 2025-09-13 22:35:12 +02:00
jack e80f725906 Location Channels sheet: use black sheet background like other sheets\n\n- Add backgroundColor and apply to container and list.\n- Hide list default background with scrollContentBackground(.hidden). 2025-09-13 22:29:58 +02:00
jack c7d8c95f8d Notes: standardize on building-level (8 chars) for publish/read\n\n- Use .building geohash when opening notes, reacting to channel updates, and subscribing the counter.\n- Update comments to reflect building-level scope. 2025-09-13 22:28:50 +02:00
jack 743551c10c Header spacing: move #mesh/#geohash closer to notes/bookmark\n\n- Reduce trailing padding on channel badge and leading padding on notes/bookmark to cluster them together.\n- Keeps larger gap before people count for readability. 2025-09-13 22:27:51 +02:00
jack 7da6f95e87 Fix notes icon color: subscribe/count at block-level geohash\n\n- Use block (precision 7) geohash for notes: when opening sheet, on channel changes, and when subscribing the counter.\n- Aligns with LocationNotesManager which publishes at street-level geohash, allowing the counter to detect notes and turn icon blue. 2025-09-13 22:26:34 +02:00
jack bd753af6cb Location Notes: @name regular green, #abcd darker; nudge #hash\n\n- Render '@' and base name in regular green, suffix '#abcd' in darker green.\n- Add extra left padding before '#geohash' in notes header.\n- Increase leading padding for channel badge to push #mesh/#geohash further right. 2025-09-13 22:24:10 +02:00
jack a3f54c5bf8 Location Notes + Header polish\n\n- Header: add space in '@ #geohash' and use darker green for geohash.\n- Notes list: render '@name#abcd' with darker green for #abcd to match chat.\n- Header: move geochat bookmark icon after #geohash badge with consistent spacing. 2025-09-13 22:18:14 +02:00
jack 79a045af39 Header: nudge #mesh/#geohash badge right with leading padding 2025-09-13 22:13:19 +02:00
jack 607acdbfe4 Header spacing: add breathing room between channel badge, notes button, and people count\n\n- Add trailing padding after #mesh/#geohash badge.\n- Add leading padding before notes button and people counter to improve readability. 2025-09-13 22:10:07 +02:00
jack 5b3f1a1350 Location Notes: prefix usernames with @ and lighten #geohash\n\n- Show @ before usernames in notes list.\n- Split header into '@' and '#geohash' and color the geohash with secondary green for consistency. 2025-09-13 22:09:10 +02:00
jack ee4ce4a38e UI: replace textual 'close' with X icon\n\n- AppInfoView (iOS): use xmark icon in nav bar to match Location Notes style.\n- LocationChannelsSheet: use xmark icon for close on iOS/macOS toolbars; add accessibility label. 2025-09-13 22:02:56 +02:00
3 changed files with 4 additions and 111 deletions
+2 -3
View File
@@ -33,6 +33,7 @@
0481A3472E6D869F00FC845E /* TorURLSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0481A3442E6D869F00FC845E /* TorURLSession.swift */; };
0481A3482E6D869F00FC845E /* TorManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0481A3432E6D869F00FC845E /* TorManager.swift */; };
0481A3492E6D869F00FC845E /* TorURLSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0481A3442E6D869F00FC845E /* TorURLSession.swift */; };
0481A35B2E6D9BEF00FC845E /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0481A35A2E6D9BEF00FC845E /* libz.tbd */; };
0481A35D2E6DA18600FC845E /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0481A35C2E6DA18600FC845E /* libz.tbd */; };
0481A3902E734CAE00FC845E /* CommandProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0481A38F2E734CAE00FC845E /* CommandProcessorTests.swift */; };
@@ -382,6 +383,7 @@
0481A39F2E744D6300FC845E /* tor-nolzma.xcframework */,
0481A35A2E6D9BEF00FC845E /* libz.tbd */,
0481A35C2E6DA18600FC845E /* libz.tbd */,
);
path = Frameworks;
sourceTree = "<group>";
@@ -813,10 +815,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
7DD72D928FF9DD3CA81B46B0 /* Assets.xcassets in Resources */,
E0A1B2C3D4E5F6012345678D /* relays/online_relays_gps.csv in Resources */,
);
+1 -37
View File
@@ -86,38 +86,6 @@ final class SecureLogger {
return level.order >= minimumLevel.order
}
// MARK: - In-memory debug buffer (DEBUG builds only)
#if DEBUG
private static let logBufferQueue = DispatchQueue(label: "chat.bitchat.securelogger.buffer")
private static var logBuffer: [String] = []
private static let logBufferCap: Int = 2000
/// Append a sanitized line to the in-memory debug buffer
private static func record(_ line: String) {
logBufferQueue.async {
logBuffer.append(line)
if logBuffer.count > logBufferCap {
logBuffer.removeFirst(logBuffer.count - logBufferCap)
}
}
}
/// Get the current logs as an array (oldest first)
static func getLogs() -> [String] {
return logBufferQueue.sync { logBuffer }
}
/// Get the current logs as a single string
static func getLogText() -> String {
return getLogs().joined(separator: "\n")
}
/// Clear the in-memory debug buffer
static func clearLogs() {
logBufferQueue.async { logBuffer.removeAll(keepingCapacity: false) }
}
#endif
// MARK: - Security Event Types
enum SecurityEvent {
@@ -191,9 +159,7 @@ final class SecureLogger {
let errorDesc = sanitize(error.localizedDescription)
#if DEBUG
let line = "\(location) Error: \(sanitized)\(errorDesc)"
os_log("%{public}@", log: category, type: .error, line)
record(line)
os_log("%{public}@ Error in %{public}@: %{public}@", log: category, type: .error, location, sanitized, errorDesc)
#else
os_log("%{private}@ Error in %{private}@: %{private}@", log: category, type: .error, location, sanitized, errorDesc)
#endif
@@ -237,7 +203,6 @@ private extension SecureLogger {
#if DEBUG
os_log("%{public}@", log: category, type: level.osLogType, sanitized)
record(sanitized)
#else
// In release builds, only log non-debug messages
if level != .debug {
@@ -255,7 +220,6 @@ private extension SecureLogger {
#if DEBUG
os_log("%{public}@", log: .security, type: level.osLogType, message)
record(message)
#else
// In release, use private logging to prevent sensitive data exposure
os_log("%{private}@", log: .security, type: level.osLogType, message)
+1 -71
View File
@@ -1,9 +1,4 @@
import SwiftUI
#if os(iOS)
import UIKit
#elseif os(macOS)
import AppKit
#endif
struct AppInfoView: View {
@Environment(\.dismiss) var dismiss
@@ -196,77 +191,12 @@ struct AppInfoView: View {
.background(Color.red.opacity(0.1))
.cornerRadius(8)
#if DEBUG
// Debug section (visible only in Debug builds)
DebugLogsSection(textColor: textColor, secondaryTextColor: secondaryTextColor)
.padding(.top)
#endif
.padding(.top)
}
.padding()
}
}
#if DEBUG
private struct DebugLogsSection: View {
let textColor: Color
let secondaryTextColor: Color
@State private var logsText: String = SecureLogger.getLogText()
private let timer = Timer.publish(every: 1.0, on: .main, in: .common).autoconnect()
var body: some View {
VStack(alignment: .leading, spacing: 12) {
SectionHeader("DEBUG")
HStack(spacing: 12) {
Button {
copyToPasteboard(logsText)
} label: {
Text("copy logs")
.font(.system(size: 14, design: .monospaced))
.foregroundColor(textColor)
}
.buttonStyle(.plain)
Button {
SecureLogger.clearLogs()
logsText = ""
} label: {
Text("clear logs")
.font(.system(size: 14, design: .monospaced))
.foregroundColor(textColor)
}
.buttonStyle(.plain)
}
ScrollView {
Text(logsText.isEmpty ? "(no logs)" : logsText)
.font(.system(size: 12, design: .monospaced))
.foregroundColor(secondaryTextColor)
.frame(maxWidth: .infinity, alignment: .leading)
.textSelection(.enabled)
.padding(8)
}
.frame(minHeight: 180)
.background(secondaryTextColor.opacity(0.08))
.cornerRadius(8)
}
.onReceive(timer) { _ in
logsText = SecureLogger.getLogText()
}
}
private func copyToPasteboard(_ text: String) {
#if os(iOS)
UIPasteboard.general.string = text
#elseif os(macOS)
let pb = NSPasteboard.general
pb.clearContents()
pb.setString(text, forType: .string)
#endif
}
}
#endif
struct SectionHeader: View {
let title: String
@Environment(\.colorScheme) var colorScheme