From 3a30a72c0bfb31468b8b9bf9fee81ba06a3d7453 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 9 Jul 2024 18:12:47 -0700 Subject: [PATCH 1/3] Larger min width for signal strength --- Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift b/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift index e94baf3af..41e010a28 100644 --- a/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift +++ b/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift @@ -61,6 +61,7 @@ struct NodeInfoItem: View { .foregroundColor(getRssiColor(rssi: node.rssi)) .font(.caption2) } + .frame(minWidth: 100, maxWidth: 180) } if node.telemetries?.count ?? 0 > 0 { From 48220d57acd20be7a8627b0ddf4867cce2852413 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 9 Jul 2024 18:24:23 -0700 Subject: [PATCH 2/3] Improve hardare node details spacing --- Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift b/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift index 41e010a28..0ca9d012c 100644 --- a/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift +++ b/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift @@ -61,14 +61,14 @@ struct NodeInfoItem: View { .foregroundColor(getRssiColor(rssi: node.rssi)) .font(.caption2) } - .frame(minWidth: 100, maxWidth: 180) + .frame(minWidth: 90, maxWidth: 180) } if node.telemetries?.count ?? 0 > 0 { BatteryGauge(node: node) .padding() } - Spacer() } + .padding(.leading) } } From 5c57d38ee6f7f5bf9982ae67c39abb179bc8dea9 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 9 Jul 2024 18:29:59 -0700 Subject: [PATCH 3/3] Update channel url query string location and support both formats --- Meshtastic/MeshtasticApp.swift | 29 +++++++++++++++---- Meshtastic/Views/Settings/ShareChannels.swift | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Meshtastic/MeshtasticApp.swift b/Meshtastic/MeshtasticApp.swift index b00fab92e..578f16d41 100644 --- a/Meshtastic/MeshtasticApp.swift +++ b/Meshtastic/MeshtasticApp.swift @@ -40,11 +40,18 @@ struct MeshtasticAppleApp: App { if (self.incomingUrl?.absoluteString.lowercased().contains("meshtastic.org/e/#")) != nil { if let components = self.incomingUrl?.absoluteString.components(separatedBy: "#") { - guard let cs = components.last!.components(separatedBy: "?").first else { - return - } - self.channelSettings = cs self.addChannels = Bool(self.incomingUrl?["add"] ?? "false") ?? false + if ((self.incomingUrl?.absoluteString.lowercased().contains("?")) != nil) { + guard let cs = components.last!.components(separatedBy: "?").first else { + return + } + self.channelSettings = cs + } else { + guard let cs = components.first else { + return + } + self.channelSettings = cs + } Logger.services.debug("Add Channel \(self.addChannels)") } self.saveChannels = true @@ -60,7 +67,19 @@ struct MeshtasticAppleApp: App { self.incomingUrl = url if url.absoluteString.lowercased().contains("meshtastic.org/e/#") { if let components = self.incomingUrl?.absoluteString.components(separatedBy: "#") { - self.channelSettings = components.last! + self.addChannels = Bool(self.incomingUrl?["add"] ?? "false") ?? false + if ((self.incomingUrl?.absoluteString.lowercased().contains("?")) != nil) { + guard let cs = components.last!.components(separatedBy: "?").first else { + return + } + self.channelSettings = cs + } else { + guard let cs = components.first else { + return + } + self.channelSettings = cs + } + Logger.services.debug("Add Channel \(self.addChannels)") } self.saveChannels = true Logger.mesh.debug("User wants to open a Channel Settings URL: \(self.incomingUrl?.absoluteString ?? "No QR Code Link")") diff --git a/Meshtastic/Views/Settings/ShareChannels.swift b/Meshtastic/Views/Settings/ShareChannels.swift index 51d066eb9..3859693e4 100644 --- a/Meshtastic/Views/Settings/ShareChannels.swift +++ b/Meshtastic/Views/Settings/ShareChannels.swift @@ -319,7 +319,7 @@ struct ShareChannels: View { guard let settingsString = try? channelSet.serializedData().base64EncodedString() else { return } - channelsUrl = ("https://meshtastic.org/e/#" + settingsString.base64ToBase64url() + (replaceChannels ? "" : "?add=true")) + channelsUrl = ("https://meshtastic.org/e/\(replaceChannels ? "" : "?add=true")#" + settingsString.base64ToBase64url()) } } }