From 65099da80c810194ca9bdc16d94e0c744bda4df3 Mon Sep 17 00:00:00 2001 From: bwees Date: Wed, 1 Jul 2026 21:23:03 -0500 Subject: [PATCH 1/2] fix: path map hops banner overlap --- MC1/Views/Map/PathDistanceBanner.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MC1/Views/Map/PathDistanceBanner.swift b/MC1/Views/Map/PathDistanceBanner.swift index 604df2b2..0f5f1931 100644 --- a/MC1/Views/Map/PathDistanceBanner.swift +++ b/MC1/Views/Map/PathDistanceBanner.swift @@ -1,8 +1,8 @@ import MapKit import SwiftUI -/// Floating top-of-map capsule summarizing a path: hop count and, when at least -/// two nodes have coordinates, the drawn-path distance. +/// Floating bottom-of-map capsule summarizing a path: hop count and, when at +/// least two nodes have coordinates, the drawn-path distance. struct PathDistanceBanner: View { private static let horizontalPadding: CGFloat = 16 private static let verticalPadding: CGFloat = 10 @@ -12,6 +12,8 @@ struct PathDistanceBanner: View { var body: some View { VStack { + Spacer() + HStack { Text(L10n.Contacts.Contacts.Trace.Map.hops(hopCount)) if let distance = totalPathDistance { @@ -24,11 +26,9 @@ struct PathDistanceBanner: View { .padding(.horizontal, Self.horizontalPadding) .padding(.vertical, Self.verticalPadding) .liquidGlass(in: .capsule) - - Spacer() } .frame(maxWidth: .infinity) - .safeAreaPadding(.top) - .transition(.move(edge: .top).combined(with: .opacity)) + .safeAreaPadding(.bottom) + .transition(.move(edge: .bottom).combined(with: .opacity)) } } From abec7d2a134f63f506bd85d9a233037694b9323c Mon Sep 17 00:00:00 2001 From: bwees Date: Fri, 3 Jul 2026 15:10:54 -0500 Subject: [PATCH 2/2] chore: move bubble into principal bar location --- .../Chats/Components/MessagePathMapView.swift | 15 +++++---- MC1/Views/Map/PathDistanceBanner.swift | 33 ++++++++----------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/MC1/Views/Chats/Components/MessagePathMapView.swift b/MC1/Views/Chats/Components/MessagePathMapView.swift index f857b896..e5bb8ce1 100644 --- a/MC1/Views/Chats/Components/MessagePathMapView.swift +++ b/MC1/Views/Chats/Components/MessagePathMapView.swift @@ -86,11 +86,6 @@ struct MessagePathMapView: View { ) .ignoresSafeArea() - PathDistanceBanner( - hopCount: hopCount, - totalPathDistance: totalPathDistance - ) - VStack { Spacer() HStack { @@ -116,9 +111,15 @@ struct MessagePathMapView: View { } } } - .navigationTitle(L10n.Chats.Chats.Path.map) - .navigationBarTitleDisplayMode(.inline) .toolbar { + if !locatedNodes.isEmpty { + ToolbarItem(placement: .principal) { + PathDistanceBanner( + hopCount: hopCount, + totalPathDistance: totalPathDistance + ) + } + } ToolbarItem(placement: .confirmationAction) { Button(L10n.Localizable.Common.done) { dismiss() } } diff --git a/MC1/Views/Map/PathDistanceBanner.swift b/MC1/Views/Map/PathDistanceBanner.swift index 0f5f1931..cab37494 100644 --- a/MC1/Views/Map/PathDistanceBanner.swift +++ b/MC1/Views/Map/PathDistanceBanner.swift @@ -1,34 +1,27 @@ import MapKit import SwiftUI -/// Floating bottom-of-map capsule summarizing a path: hop count and, when at -/// least two nodes have coordinates, the drawn-path distance. +/// Path summary shown in place of the map sheet's navigation title: hop count +/// and, when at least two nodes have coordinates, the drawn-path distance. struct PathDistanceBanner: View { private static let horizontalPadding: CGFloat = 16 - private static let verticalPadding: CGFloat = 10 + private static let verticalPadding: CGFloat = 8 let hopCount: Int let totalPathDistance: CLLocationDistance? var body: some View { - VStack { - Spacer() - - HStack { - Text(L10n.Contacts.Contacts.Trace.Map.hops(hopCount)) - if let distance = totalPathDistance { - Text("•") - Text(Measurement(value: distance, unit: UnitLength.meters), - format: .measurement(width: .abbreviated, usage: .road)) - } + HStack(spacing: 4) { + Text(L10n.Contacts.Contacts.Trace.Map.hops(hopCount)) + if let distance = totalPathDistance { + Text("•") + Text(Measurement(value: distance, unit: UnitLength.meters), + format: .measurement(width: .abbreviated, usage: .road)) } - .font(.subheadline.weight(.medium)) - .padding(.horizontal, Self.horizontalPadding) - .padding(.vertical, Self.verticalPadding) - .liquidGlass(in: .capsule) } - .frame(maxWidth: .infinity) - .safeAreaPadding(.bottom) - .transition(.move(edge: .bottom).combined(with: .opacity)) + .font(.subheadline.weight(.medium)) + .padding(.horizontal, Self.horizontalPadding) + .padding(.vertical, Self.verticalPadding) + .liquidGlass(in: .capsule) } }