The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
feat(ios): the iPad gets the extra large widgets, no Wallet button, a centred share sheet
Maurice5d05363f361d
diff --git a/client/ios/App/App/TrekShellPlugin.swift b/client/ios/App/App/TrekShellPlugin.swiftindex 534288545..99b05e9de 100644--- a/client/ios/App/App/TrekShellPlugin.swift+++ b/client/ios/App/App/TrekShellPlugin.swift@@ -56,10 +56,19 @@ public class TrekShellPlugin: CAPPlugin, CAPBridgedPlugin, ASWebAuthenticationPr/// and a server can require a minimum (minNativeShellApi in /api/health/features).static let shellApi = 2/// The native features by name, so the UI can turn each on by itself.- /// "watch" only where WatchConnectivity is (an iPhone, not an iPad), so the UI never builds a snapshot for nothing.+ /// "watch" only where WatchConnectivity is (an iPhone, not an iPad), so the UI never+ /// builds a snapshot for nothing; "wallet" only where Wallet can take a pass (an+ /// iPhone: an iPad has no Wallet app), so the UI offers no button that does nothing.static var features: [String] {- ["capabilities", "edgeBack", "tileCache", "biometricLock", "geolocation", "sharedFiles", "nativePush", "widgets", "liveActivity", "widgetTrips", "storeKit", "shareSheet", "wallet", "keyCommands"]- + (TrekWatchLink.isAvailable ? ["watch"] : [])+ var names = ["capabilities", "edgeBack", "tileCache", "biometricLock", "geolocation", "sharedFiles", "nativePush", "widgets", "liveActivity", "widgetTrips", "storeKit", "shareSheet", "keyCommands"]+ if canAddWalletPasses { names.append("wallet") }+ if TrekWatchLink.isAvailable { names.append("watch") }+ return names+ }++ /// Whether this device can add a pass to Apple Wallet (an iPhone; not an iPad).+ static var canAddWalletPasses: Bool {+ PKPassLibrary.isPassLibraryAvailable() && PKAddPassesViewController.canAddPasses()}// MARK: - Shared booking documentsdiff --git a/client/ios/App/ShareExtension/ShareView.swift b/client/ios/App/ShareExtension/ShareView.swiftindex 75fabfbde..dd8bb76e0 100644--- a/client/ios/App/ShareExtension/ShareView.swift+++ b/client/ios/App/ShareExtension/ShareView.swift@@ -6,16 +6,24 @@ import SwiftUIstruct ShareView: View {@ObservedObject var model: ShareModel@Environment(\.colorScheme) private var scheme+ @Environment(\.horizontalSizeClass) private var widthClass@State private var shown = false+ /// An iPad window of regular width: the card stands centred over the dimmed+ /// app, as a form does there, instead of rising from the bottom edge. A+ /// narrow Split View or Slide Over window keeps the iPhone's bottom card.+ private var centred: Bool { widthClass == .regular }+var body: some View {- ZStack(alignment: .bottom) {- Color.black.opacity(shown ? 0.28 : 0)+ ZStack(alignment: centred ? .center : .bottom) {+ Color.black.opacity(shown ? (centred ? 0.36 : 0.28) : 0).ignoresSafeArea().onTapGesture { dismiss() }card- .offset(y: shown ? 0 : 520)+ .offset(y: shown ? 0 : (centred ? 40 : 520))+ .opacity(centred && !shown ? 0 : 1)+ .padding(.vertical, centred ? 24 : 0)}.onAppear {withAnimation(.spring(response: 0.5, dampingFraction: 0.86)) { shown = true }@@ -31,14 +39,17 @@ struct ShareView: View {private var card: some View {VStack(spacing: 0) {- Capsule()- .fill(ShareStyle.faint(scheme).opacity(0.5))- .frame(width: 38, height: 5)- .padding(.top, 8)+ // The grabber belongs to a card that rises from the bottom edge.+ if !centred {+ Capsule()+ .fill(ShareStyle.faint(scheme).opacity(0.5))+ .frame(width: 38, height: 5)+ .padding(.top, 8)+ }header.padding(.horizontal, 20)- .padding(.top, 14)+ .padding(.top, centred ? 22 : 14)Group {switch model.phase {@@ -50,7 +61,7 @@ struct ShareView: View {}.padding(.top, 16)}- .padding(.bottom, 12)+ .padding(.bottom, centred ? 20 : 12).frame(maxWidth: 560).background(RoundedRectangle(cornerRadius: 32, style: .continuous)@@ -60,9 +71,9 @@ struct ShareView: View {.strokeBorder(ShareStyle.edge(scheme), lineWidth: 1)).shadow(color: .black.opacity(0.25), radius: 30, y: 10)- .ignoresSafeArea(edges: .bottom)+ .ignoresSafeArea(edges: centred ? [] : .bottom))- .padding(.horizontal, 6)+ .padding(.horizontal, centred ? 24 : 6)}private var header: some View {diff --git a/client/ios/App/ShareExtension/ShareViewController.swift b/client/ios/App/ShareExtension/ShareViewController.swiftindex 1f2ce2baf..9ea65b516 100644--- a/client/ios/App/ShareExtension/ShareViewController.swift+++ b/client/ios/App/ShareExtension/ShareViewController.swift@@ -9,6 +9,24 @@ import UIKitfinal class ShareViewController: UIViewController {private let model = ShareModel()+ // On an iPad the system would put the extension in a form sheet, a box in the+ // middle of the screen with this sheet's own dimming and card inside it. Over+ // the full screen instead, the card stands centred over the app that shared,+ // the way an iPad presents a small form.+ override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {+ super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)+ presentOverFullScreenOnPad()+ }++ required init?(coder: NSCoder) {+ super.init(coder: coder)+ presentOverFullScreenOnPad()+ }++ private func presentOverFullScreenOnPad() {+ if UIDevice.current.userInterfaceIdiom == .pad { modalPresentationStyle = .overFullScreen }+ }+override func viewDidLoad() {super.viewDidLoad()view.backgroundColor = .cleardiff --git a/client/ios/App/TREKWidgets/BookingsContent.swift b/client/ios/App/TREKWidgets/BookingsContent.swiftindex d5a52f083..2206a4ebb 100644--- a/client/ios/App/TREKWidgets/BookingsContent.swift+++ b/client/ios/App/TREKWidgets/BookingsContent.swift@@ -29,6 +29,7 @@ struct BookingsContent: View {switch family {case .small: hero(first, labels)case .medium: list(Array(bookings.prefix(2)), labels, featureFirst: true)+ case .extraLarge: wide(bookings, labels)default: list(Array(bookings.prefix(5)), labels, featureFirst: true)}} else {@@ -74,7 +75,7 @@ struct BookingsContent: View {// MARK: Medium and large: a list, the first one featuredprivate func list(_ bookings: [WidgetSnapshot.Booking], _ labels: WidgetSnapshot.Labels, featureFirst: Bool) -> some View {- VStack(alignment: .leading, spacing: family == .large ? 8 : 7) {+ VStack(alignment: .leading, spacing: family.isTall ? 8 : 7) {HStack {Text(labels.bookings ?? "").trekEyebrow(scheme)Spacer(minLength: 0)@@ -89,7 +90,33 @@ struct BookingsContent: View {}}}- if family == .large { Spacer(minLength: 0) }+ if family.isTall { Spacer(minLength: 0) }+ }+ }++ // MARK: Extra large (iPad): the next one as a card, the rest beside it++ private func wide(_ bookings: [WidgetSnapshot.Booking], _ labels: WidgetSnapshot.Labels) -> some View {+ let first = bookings[0]+ let look = Trek.booking(first.kind)+ let rest = Array(bookings.dropFirst().prefix(5))+ return HStack(alignment: .top, spacing: 18) {+ RowLink(path: first.path) {+ hero(first, labels)+ .padding(14)+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)+ .background(+ RoundedRectangle(cornerRadius: 18, style: .continuous)+ .fill(LinearGradient(colors: [look.color.opacity(scheme == .dark ? 0.24 : 0.14), look.color.opacity(scheme == .dark ? 0.08 : 0.04)], startPoint: .topLeading, endPoint: .bottomTrailing))+ )+ .clipShape(RoundedRectangle(cornerRadius: 18, style: .continuous))+ .overlay(RoundedRectangle(cornerRadius: 18, style: .continuous).stroke(look.color.opacity(0.25), lineWidth: 0.8))+ }+ .frame(maxWidth: rest.isEmpty ? CGFloat.infinity : 240)+ if !rest.isEmpty {+ list(rest, labels, featureFirst: false)+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)+ }}}diff --git a/client/ios/App/TREKWidgets/NextTripWidget.swift b/client/ios/App/TREKWidgets/NextTripWidget.swiftindex 6b65a54b0..a13dbdd18 100644--- a/client/ios/App/TREKWidgets/NextTripWidget.swift+++ b/client/ios/App/TREKWidgets/NextTripWidget.swift@@ -51,6 +51,7 @@ extension TrekFamily {switch family {case .systemSmall: self = .smallcase .systemMedium: self = .medium+ case .systemExtraLarge: self = .extraLargecase .accessoryCircular: self = .circularcase .accessoryRectangular: self = .rectangularcase .accessoryInline: self = .inline@@ -92,7 +93,8 @@ struct NextTripWidget: Widget {}.configurationDisplayName("widget.trip.name").description("widget.trip.description")- .supportedFamilies([.systemSmall, .systemMedium, .systemLarge, .accessoryCircular, .accessoryRectangular, .accessoryInline])+ // systemExtraLarge is the iPad's; an iPhone leaves it out of its gallery.+ .supportedFamilies([.systemSmall, .systemMedium, .systemLarge, .systemExtraLarge, .accessoryCircular, .accessoryRectangular, .accessoryInline])}}@@ -123,7 +125,7 @@ struct TodayWidget: Widget {}.configurationDisplayName("widget.today.name").description("widget.today.description")- .supportedFamilies([.systemMedium, .systemLarge])+ .supportedFamilies([.systemMedium, .systemLarge, .systemExtraLarge])}}@@ -146,7 +148,7 @@ struct BookingsWidget: Widget {}.configurationDisplayName("widget.bookings.name").description("widget.bookings.description")- .supportedFamilies([.systemSmall, .systemMedium, .systemLarge, .accessoryRectangular, .accessoryInline])+ .supportedFamilies([.systemSmall, .systemMedium, .systemLarge, .systemExtraLarge, .accessoryRectangular, .accessoryInline])}}diff --git a/client/ios/App/TREKWidgets/TodayContent.swift b/client/ios/App/TREKWidgets/TodayContent.swiftindex b5d3f6238..ef605a927 100644--- a/client/ios/App/TREKWidgets/TodayContent.swift+++ b/client/ios/App/TREKWidgets/TodayContent.swift@@ -14,55 +14,60 @@ struct TodayContent: View {let total = today.total ?? snapshot.tripLength ?? 1let timed = today.stops.filter { $0.minutes != nil }let done = timed.filter { ($0.minutes ?? 0) < nowMinutes }.count- VStack(alignment: .leading, spacing: 0) {- HStack(alignment: .center, spacing: 10) {- DayBadge(index: today.index ?? 1, total: total)- VStack(alignment: .leading, spacing: 1) {- Text(trip.title).trekEyebrow(scheme)- Text(today.dayLabel)- .font(.system(size: family == .large ? 19 : 16, weight: .heavy))- .foregroundStyle(Trek.ink(scheme))- .lineLimit(1)- }- Spacer(minLength: 0)- if let weather = snapshot.weather {- if family == .large {- PaperWeather(weather: weather)- } else {- WeatherChip(weather: weather)+ if family == .extraLarge {+ wide(snapshot, trip, today, total: total, done: done, timed: timed.count, nowMinutes: nowMinutes)+ } else {+ VStack(alignment: .leading, spacing: 0) {+ HStack(alignment: .center, spacing: 10) {+ DayBadge(index: today.index ?? 1, total: total)+ VStack(alignment: .leading, spacing: 1) {+ Text(trip.title).trekEyebrow(scheme)+ Text(today.dayLabel)+ .font(.system(size: family == .large ? 19 : 16, weight: .heavy))+ .foregroundStyle(Trek.ink(scheme))+ .lineLimit(1)+ }+ Spacer(minLength: 0)+ if let weather = snapshot.weather {+ if family == .large {+ PaperWeather(weather: weather)+ } else {+ WeatherChip(weather: weather)+ }}}- }- if family == .large {- DayProgress(done: done, total: timed.count, scheme: scheme, label: snapshot.labels.allDone)- .padding(.top, 12)- .padding(.bottom, 14)- } else {- Spacer(minLength: 8)- }- StopList(- stops: today.stops, nowMinutes: nowMinutes, limit: family == .large ? 7 : 3,- nothing: snapshot.labels.nothingPlanned, nowLabel: snapshot.labels.now- )- if family == .large {- Spacer(minLength: 8)- if let booking = snapshot.bookings?.first {- NextBookingStrip(booking: booking, labels: snapshot.labels, now: now, onPhoto: false)+ if family == .large {+ DayProgress(done: done, total: timed.count, scheme: scheme, label: snapshot.labels.allDone)+ .padding(.top, 12)+ .padding(.bottom, 14)+ } else {+ Spacer(minLength: 8)+ }+ StopList(+ stops: today.stops, nowMinutes: nowMinutes, limit: family == .large ? 7 : 3,+ nothing: snapshot.labels.nothingPlanned, nowLabel: snapshot.labels.now+ )+ if family == .large {+ Spacer(minLength: 8)+ if let booking = snapshot.bookings?.first {+ NextBookingStrip(booking: booking, labels: snapshot.labels, now: now, onPhoto: false)+ }}}}} else if let snapshot, let trip = snapshot.trip {// Before the trip there is no day yet: count down to it instead.let days = max(snapshot.daysUntilStart(from: now) ?? 0, 0)+ let roomy = family == .extraLargeVStack(alignment: .leading, spacing: 4) {Text(snapshot.labels.nextTrip).trekEyebrow(scheme)- Text(trip.title).font(.system(size: 17, weight: .heavy)).foregroundStyle(Trek.ink(scheme)).lineLimit(2)+ Text(trip.title).font(.system(size: roomy ? 24 : 17, weight: .heavy)).foregroundStyle(Trek.ink(scheme)).lineLimit(2)Spacer(minLength: 0)HStack(alignment: .firstTextBaseline, spacing: 4) {- Text("\(days)").font(Trek.number(40, .heavy)).foregroundStyle(Trek.ink(scheme))- Text(snapshot.labels.days ?? "").font(.system(size: 13, weight: .bold)).foregroundStyle(Trek.muted(scheme))+ Text("\(days)").font(Trek.number(roomy ? 56 : 40, .heavy)).foregroundStyle(Trek.ink(scheme))+ Text(snapshot.labels.days ?? "").font(.system(size: roomy ? 16 : 13, weight: .bold)).foregroundStyle(Trek.muted(scheme))}- RouteArc(progress: 1 - min(Double(days), 60) / 60, color: Trek.ink(scheme)).frame(height: 24)+ RouteArc(progress: 1 - min(Double(days), 60) / 60, color: Trek.ink(scheme)).frame(height: roomy ? 34 : 24)}} else {EmptyTrip(text: snapshot?.labels.noTrip ?? "", family: family)@@ -70,6 +75,48 @@ struct TodayContent: View {}}+extension TodayContent {+ /// The iPad's extra large: the day, its progress, the weather and the next+ /// booking in a column, the day's stops as a timeline beside it.+ func wide(+ _ snapshot: WidgetSnapshot, _ trip: WidgetSnapshot.Trip, _ today: WidgetSnapshot.Today,+ total: Int, done: Int, timed: Int, nowMinutes: Int+ ) -> some View {+ HStack(alignment: .top, spacing: 22) {+ VStack(alignment: .leading, spacing: 0) {+ HStack(alignment: .center, spacing: 10) {+ DayBadge(index: today.index ?? 1, total: total)+ VStack(alignment: .leading, spacing: 1) {+ Text(trip.title).trekEyebrow(scheme)+ Text(today.dayLabel)+ .font(.system(size: 19, weight: .heavy))+ .foregroundStyle(Trek.ink(scheme))+ .lineLimit(1)+ .minimumScaleFactor(0.8)+ }+ Spacer(minLength: 0)+ }+ DayProgress(done: done, total: timed, scheme: scheme, label: snapshot.labels.allDone)+ .padding(.top, 12)+ if let weather = snapshot.weather {+ PaperWeather(weather: weather).padding(.top, 16)+ }+ Spacer(minLength: 8)+ if let booking = snapshot.bookings?.first {+ NextBookingStrip(booking: booking, labels: snapshot.labels, now: now, onPhoto: false)+ }+ }+ .frame(width: 250)+ .frame(maxHeight: .infinity, alignment: .top)+ StopList(+ stops: today.stops, nowMinutes: nowMinutes, limit: 8,+ nothing: snapshot.labels.nothingPlanned, nowLabel: snapshot.labels.now+ )+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)+ }+ }+}+/// Today's number in a dark tile with the trip's length under it.struct DayBadge: View {let index: Int@@ -142,3 +189,64 @@ struct DayProgress: View {}}}++/// The travel day as its Live Activity shows it on the lock screen (iPhone and+/// iPad): trip and day on top, the next stop large, the day's stops as+/// segments. Plain values rather than the activity's attributes, so the+/// preview renderer can draw it at every width the lock screen gives it.+struct TripDayBanner: View {+ let tripTitle: String+ let dayLabel: String+ let nextName: String+ let nextTime: String?+ let done: Int+ let total: Int++ var body: some View {+ HStack(alignment: .center, spacing: 14) {+ ZStack {+ Circle().stroke(Color.white.opacity(0.18), lineWidth: 5)+ Circle()+ .trim(from: 0, to: total > 0 ? max(0.02, Double(done) / Double(total)) : 0)+ .stroke(+ AngularGradient(colors: [Trek.confirmed.opacity(0.7), Trek.confirmed], center: .center),+ style: StrokeStyle(lineWidth: 5, lineCap: .round)+ )+ .rotationEffect(.degrees(-90))+ Image(systemName: "mappin.and.ellipse").font(.system(size: 17, weight: .bold)).foregroundStyle(.white)+ }+ .frame(width: 52, height: 52)+ VStack(alignment: .leading, spacing: 3) {+ HStack {+ Text(tripTitle)+ .font(.system(size: 11, weight: .bold))+ .tracking(0.5)+ .textCase(.uppercase)+ .foregroundStyle(.white.opacity(0.65))+ .lineLimit(1)+ Spacer(minLength: 4)+ Text(dayLabel).font(.system(size: 11, weight: .bold)).foregroundStyle(.white.opacity(0.65)).lineLimit(1)+ }+ HStack(alignment: .firstTextBaseline) {+ Text(nextName).font(.system(size: 18, weight: .heavy)).foregroundStyle(.white).lineLimit(1)+ Spacer(minLength: 4)+ if let nextTime {+ Text(nextTime).font(Trek.number(18, .heavy)).foregroundStyle(.white)+ }+ }+ DayStopProgress(done: done, total: total).padding(.top, 3)+ }+ }+ .padding(16)+ }+}++/// The day's timed stops as segments, those behind filled (the Live Activity's bar).+struct DayStopProgress: View {+ let done: Int+ let total: Int++ var body: some View {+ DaySegments(index: done + 1, total: max(total, 1), color: Trek.confirmed, track: Color.white.opacity(0.2))+ }+}diff --git a/client/ios/App/TREKWidgets/TrekFamily.swift b/client/ios/App/TREKWidgets/TrekFamily.swiftindex 6bfc90d33..1fbb4427c 100644--- a/client/ios/App/TREKWidgets/TrekFamily.swift+++ b/client/ios/App/TREKWidgets/TrekFamily.swift@@ -4,16 +4,22 @@ import Foundation/// so the views also render outside a widget (the preview renderer in/// client/ios/WidgetPreviews draws every size to a PNG on the CI's Mac).enum TrekFamily: String, CaseIterable {- case small, medium, large, circular, rectangular, inline+ case small, medium, large, extraLarge, circular, rectangular, inlinevar isAccessory: Bool { self == .circular || self == .rectangular || self == .inline }- /// The point size of the family on a 6.1" iPhone, for the renderer.+ /// A home-screen widget as tall as a large one: the large and the iPad's+ /// extra large, which have room for a list with a foot under it.+ var isTall: Bool { self == .large || self == .extraLarge }++ /// The point size of the family on a 6.1" iPhone, for the renderer. The+ /// extra large exists on an iPad only; its size is that of an 11" iPad.var previewSize: CGSize {switch self {case .small: return CGSize(width: 170, height: 170)case .medium: return CGSize(width: 364, height: 170)case .large: return CGSize(width: 364, height: 382)+ case .extraLarge: return CGSize(width: 715.5, height: 342)case .circular: return CGSize(width: 76, height: 76)case .rectangular: return CGSize(width: 172, height: 76)case .inline: return CGSize(width: 250, height: 26)@@ -21,6 +27,34 @@ enum TrekFamily: String, CaseIterable {}}+/// The iPads the renderer draws the home-screen widgets for, with the sizes+/// iPadOS gives each family there (Human Interface Guidelines, Widgets). An+/// iPad mini's small widget is smaller than an iPhone's, a 13" iPad's medium+/// and large are wider.+enum TrekPad: String, CaseIterable {+ case ipad13, ipad11, ipadMini++ /// The small widget's side, the medium's and large's width, the extra large's width.+ private var metrics: (small: CGFloat, wide: CGFloat, extraWide: CGFloat) {+ switch self {+ case .ipad13: return (170, 378.5, 795)+ case .ipad11: return (155, 342, 715.5)+ case .ipadMini: return (141, 305.5, 634.5)+ }+ }++ func size(_ family: TrekFamily) -> CGSize {+ let m = metrics+ switch family {+ case .small: return CGSize(width: m.small, height: m.small)+ case .medium: return CGSize(width: m.wide, height: m.small)+ case .large: return CGSize(width: m.wide, height: m.wide)+ case .extraLarge: return CGSize(width: m.extraWide, height: m.wide)+ default: return family.previewSize+ }+ }+}+extension WidgetSnapshot {/// What the widget gallery shows before the app ever wrote a snapshot, and/// what the renderer draws: a trip to Kyoto with a full day, bookings and to-dos.diff --git a/client/ios/App/TREKWidgets/TripContent.swift b/client/ios/App/TREKWidgets/TripContent.swiftindex 4a0c72bb1..e0e725978 100644--- a/client/ios/App/TREKWidgets/TripContent.swift+++ b/client/ios/App/TREKWidgets/TripContent.swift@@ -85,6 +85,53 @@ struct TripContent: View {}.frame(width: 96, height: 96)}+ case .extraLarge:+ // The iPad's wide widget: the trip and its countdown on the left, the+ // bookings ahead in a column on the right.+ HStack(alignment: .top, spacing: 20) {+ VStack(alignment: .leading, spacing: 0) {+ HStack(alignment: .top) {+ Text(snapshot.labels.nextTrip).trekEyebrowOnPhoto()+ Spacer(minLength: 0)+ if let weather = snapshot.weather { WeatherChip(weather: weather, onPhoto: true) }+ }+ Spacer(minLength: 0)+ HStack(alignment: .bottom, spacing: 12) {+ VStack(alignment: .leading, spacing: 2) {+ Text(trip.title)+ .font(.system(size: 28, weight: .heavy))+ .foregroundStyle(.white)+ .lineLimit(2)+ .minimumScaleFactor(0.75)+ if let place = trip.place {+ Label(place, systemImage: "location.fill")+ .font(.system(size: 13, weight: .semibold))+ .foregroundStyle(.white.opacity(0.85))+ .lineLimit(1)+ }+ }+ Spacer(minLength: 0)+ countdown(days, snapshot.labels, size: 54)+ }+ RouteArc(progress: progress, color: .white)+ .frame(height: 34)+ .padding(.top, 10)+ .padding(.bottom, 12)+ TripFacts(snapshot: snapshot, onPhoto: true)+ }+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)+ if let bookings = snapshot.bookings, !bookings.isEmpty {+ VStack(alignment: .leading, spacing: 8) {+ Text(snapshot.labels.bookings ?? "").trekEyebrowOnPhoto()+ ForEach(Array(bookings.prefix(4).enumerated()), id: \.offset) { _, booking in+ NextBookingStrip(booking: booking, labels: snapshot.labels, now: now)+ }+ Spacer(minLength: 0)+ }+ .frame(width: 290)+ .frame(maxHeight: .infinity, alignment: .top)+ }+ }default:VStack(alignment: .leading, spacing: 0) {HStack(alignment: .top) {@@ -201,6 +248,44 @@ struct TripContent: View {}.frame(width: 176)}+ case .extraLarge:+ // The iPad's wide widget: the day on the left, its stops beside it.+ HStack(alignment: .top, spacing: 20) {+ VStack(alignment: .leading, spacing: 0) {+ HStack(alignment: .top) {+ VStack(alignment: .leading, spacing: 3) {+ Text(trip.title).trekEyebrowOnPhoto()+ Text(today.dayLabel)+ .font(.system(size: 26, weight: .heavy))+ .foregroundStyle(.white)+ .lineLimit(1)+ .minimumScaleFactor(0.8)+ }+ Spacer(minLength: 0)+ if let weather = snapshot.weather { BigWeather(weather: weather) }+ }+ DaySegments(index: index, total: total, color: .white, track: .white.opacity(0.25)).padding(.top, 10)+ Spacer(minLength: 8)+ if let next {+ Text(next.time ?? snapshot.labels.today)+ .font(Trek.number(30, .heavy))+ .foregroundStyle(.white)+ Text(next.name)+ .font(.system(size: 16, weight: .bold))+ .foregroundStyle(.white)+ .lineLimit(1)+ .padding(.bottom, 10)+ }+ if let booking = snapshot.bookings?.first {+ NextBookingStrip(booking: booking, labels: snapshot.labels, now: now)+ }+ }+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)+ GlassPanel {+ StopList(stops: today.stops, nowMinutes: nowMinutes, limit: 7, onPhoto: true, nothing: snapshot.labels.nothingPlanned, nowLabel: snapshot.labels.now)+ }+ .frame(width: 300)+ }default:VStack(alignment: .leading, spacing: 0) {HStack(alignment: .top) {diff --git a/client/ios/App/TREKWidgets/TripDayLiveActivity.swift b/client/ios/App/TREKWidgets/TripDayLiveActivity.swiftindex 88987be3e..89b56391b 100644--- a/client/ios/App/TREKWidgets/TripDayLiveActivity.swift+++ b/client/ios/App/TREKWidgets/TripDayLiveActivity.swift@@ -7,7 +7,11 @@ import WidgetKitstruct TripDayLiveActivity: Widget {var body: some WidgetConfiguration {ActivityConfiguration(for: TripDayAttributes.self) { context in- TripDayBanner(attributes: context.attributes, state: context.state)+ TripDayBanner(+ tripTitle: context.attributes.tripTitle, dayLabel: context.state.dayLabel,+ nextName: context.state.nextName, nextTime: context.state.nextTime,+ done: context.state.done, total: context.state.total+ ).activityBackgroundTint(Color(hex: 0x0C0C0F).opacity(0.92)).activitySystemActionForegroundColor(.white).widgetURL(WidgetSnapshot.link(context.attributes.path))@@ -31,7 +35,7 @@ struct TripDayLiveActivity: Widget {DynamicIslandExpandedRegion(.bottom) {VStack(alignment: .leading, spacing: 8) {Text(state.nextName).font(.system(size: 17, weight: .heavy)).lineLimit(1)- StopProgress(done: state.done, total: state.total)+ DayStopProgress(done: state.done, total: state.total)}.padding(.horizontal, 4)}@@ -55,58 +59,3 @@ struct TripDayLiveActivity: Widget {}}}--/// The lock-screen banner: trip and day on top, the next stop large, the-/// day's stops as segments.-private struct TripDayBanner: View {- let attributes: TripDayAttributes- let state: TripDayAttributes.ContentState-- var body: some View {- HStack(alignment: .center, spacing: 14) {- ZStack {- Circle().stroke(Color.white.opacity(0.18), lineWidth: 5)- Circle()- .trim(from: 0, to: state.total > 0 ? max(0.02, Double(state.done) / Double(state.total)) : 0)- .stroke(- AngularGradient(colors: [Trek.confirmed.opacity(0.7), Trek.confirmed], center: .center),- style: StrokeStyle(lineWidth: 5, lineCap: .round)- )- .rotationEffect(.degrees(-90))- Image(systemName: "mappin.and.ellipse").font(.system(size: 17, weight: .bold)).foregroundStyle(.white)- }- .frame(width: 52, height: 52)- VStack(alignment: .leading, spacing: 3) {- HStack {- Text(attributes.tripTitle)- .font(.system(size: 11, weight: .bold))- .tracking(0.5)- .textCase(.uppercase)- .foregroundStyle(.white.opacity(0.65))- .lineLimit(1)- Spacer(minLength: 4)- Text(state.dayLabel).font(.system(size: 11, weight: .bold)).foregroundStyle(.white.opacity(0.65)).lineLimit(1)- }- HStack(alignment: .firstTextBaseline) {- Text(state.nextName).font(.system(size: 18, weight: .heavy)).foregroundStyle(.white).lineLimit(1)- Spacer(minLength: 4)- if let time = state.nextTime {- Text(time).font(Trek.number(18, .heavy)).foregroundStyle(.white)- }- }- StopProgress(done: state.done, total: state.total).padding(.top, 3)- }- }- .padding(16)- }-}--/// The day's timed stops as segments, those behind filled.-private struct StopProgress: View {- let done: Int- let total: Int-- var body: some View {- DaySegments(index: done + 1, total: max(total, 1), color: Trek.confirmed, track: Color.white.opacity(0.2))- }-}diff --git a/client/ios/WidgetPreviews/Sources/WidgetPreviews/Render.swift b/client/ios/WidgetPreviews/Sources/WidgetPreviews/Render.swiftindex d83c05a84..8e8158bce 100644--- a/client/ios/WidgetPreviews/Sources/WidgetPreviews/Render.swift+++ b/client/ios/WidgetPreviews/Sources/WidgetPreviews/Render.swift@@ -51,7 +51,23 @@ struct Render {}let lock = LockScreen(snapshots: states.prefix(3).map(\.1), now: now).environment(\.colorScheme, scheme)try write(lock, to: out.appendingPathComponent("lock-\(schemeName).png"))++ // The iPad: every home-screen size of each widget as that iPad gives+ // them, the extra large included, per kind in one strip.+ for pad in TrekPad.allCases {+ for (stateName, snapshot) in states where ["upcoming", "coverrunning", "empty"].contains(stateName) {+ for kind in WidgetKind.allCases {+ let strip = PadStrip(kind: kind, pad: pad, snapshot: snapshot, now: now)+ .environment(\.colorScheme, scheme)+ .environment(\.trekStaticPreview, true)+ try write(strip, to: out.appendingPathComponent("pad-\(pad.rawValue)-\(kind.rawValue)-\(stateName)-\(schemeName).png"), scale: 2)+ }+ }+ }+ let padLock = PadLockScreen(snapshot: states[1].1, now: now).environment(\.colorScheme, scheme)+ try write(padLock, to: out.appendingPathComponent("pad-lock-\(schemeName).png"), scale: 2)}+ try write(LiveActivityWidths(), to: out.appendingPathComponent("liveactivity-widths.png"))let args = Array(CommandLine.arguments.dropFirst())try Mockups.render(to: out, iconPath: args.count > 1 ? args[1] : nil, now: now)print("wrote \(try FileManager.default.contentsOfDirectory(atPath: out.path).count) images to \(out.path)")@@ -77,9 +93,9 @@ struct Render {}@MainActor- static func write<V: View>(_ view: V, to url: URL) throws {+ static func write<V: View>(_ view: V, to url: URL, scale: CGFloat = 3) throws {let renderer = ImageRenderer(content: view)- renderer.scale = 3+ renderer.scale = scaleguard let image = renderer.nsImage,let tiff = image.tiffRepresentation,let bitmap = NSBitmapImageRep(data: tiff),@@ -95,9 +111,9 @@ enum WidgetKind: String, CaseIterable {var families: [TrekFamily] {switch self {- case .trip: return [.small, .medium, .large, .circular, .rectangular, .inline]- case .today: return [.medium, .large]- case .bookings: return [.small, .medium, .large, .rectangular, .inline]+ case .trip: return [.small, .medium, .large, .extraLarge, .circular, .rectangular, .inline]+ case .today: return [.medium, .large, .extraLarge]+ case .bookings: return [.small, .medium, .large, .extraLarge, .rectangular, .inline]case .todos: return [.small, .medium, .large, .circular, .rectangular]case .packing: return [.small, .medium, .large, .circular, .rectangular]case .atlas: return [.small, .medium, .large, .circular, .rectangular, .inline]@@ -113,9 +129,11 @@ struct WidgetFrame: View {let family: TrekFamilylet snapshot: WidgetSnapshotlet now: Date+ /// The device's size for the family, when it is not the 6.1" iPhone's.+ var size: CGSize? = nilvar body: some View {- let size = family.previewSize+ let size = self.size ?? family.previewSizeif family.isAccessory {// As the lock screen draws them: white on the wallpaper, no box of their own// (the circular one gets the system's soft disc).@@ -270,3 +288,98 @@ struct NewWidgets: View {)}}++/// One widget kind in every home-screen size an iPad gives it, side by side on+/// that iPad's wallpaper, the extra large last.+struct PadStrip: View {+ let kind: WidgetKind+ let pad: TrekPad+ let snapshot: WidgetSnapshot+ let now: Date+ @Environment(\.colorScheme) private var scheme++ var body: some View {+ HStack(alignment: .top, spacing: 24) {+ ForEach(kind.families.filter { !$0.isAccessory }, id: \.self) { family in+ WidgetFrame(kind: kind, family: family, snapshot: snapshot, now: now, size: pad.size(family))+ }+ }+ .padding(28)+ .background(+ LinearGradient(+ colors: scheme == .dark ? [Color(hex: 0x1D2440), Color(hex: 0x0B0F1E)] : [Color(hex: 0xC9D8F0), Color(hex: 0xF3E3D3)],+ startPoint: .topLeading, endPoint: .bottomTrailing+ )+ )+ }+}++/// An 11" iPad's lock screen on its side: the clock with the accessories under+/// it on the left, as iPadOS places them, and the travel day's Live Activity.+struct PadLockScreen: View {+ let snapshot: WidgetSnapshot+ let now: Date++ var body: some View {+ HStack(alignment: .top, spacing: 0) {+ VStack(alignment: .leading, spacing: 14) {+ WidgetFrame(kind: .trip, family: .inline, snapshot: snapshot, now: now)+ Text(now, format: .dateTime.hour().minute())+ .font(.system(size: 96, weight: .semibold, design: .rounded))+ .foregroundStyle(.white)+ HStack(spacing: 10) {+ WidgetFrame(kind: .trip, family: .circular, snapshot: snapshot, now: now)+ WidgetFrame(kind: .todos, family: .circular, snapshot: snapshot, now: now)+ WidgetFrame(kind: .packing, family: .circular, snapshot: snapshot, now: now)+ }+ WidgetFrame(kind: .trip, family: .rectangular, snapshot: snapshot, now: now)+ WidgetFrame(kind: .bookings, family: .rectangular, snapshot: snapshot, now: now)+ WidgetFrame(kind: .todos, family: .rectangular, snapshot: snapshot, now: now)+ }+ .padding(.leading, 64)+ .padding(.top, 70)+ Spacer(minLength: 0)+ }+ .frame(width: 1194, height: 834, alignment: .topLeading)+ .overlay(alignment: .bottom) {+ LiveActivityCard(width: 500).padding(.bottom, 40)+ }+ .background(+ LinearGradient(colors: [Color(hex: 0x2B3A67), Color(hex: 0x6B4A6E), Color(hex: 0x1C1726)], startPoint: .top, endPoint: .bottom)+ )+ }+}++/// The travel day's Live Activity as the lock screen tints it.+struct LiveActivityCard: View {+ let width: CGFloat++ var body: some View {+ TripDayBanner(+ tripTitle: "Autumn in Kyoto", dayLabel: "Day 3 of 9",+ nextName: "Kiyomizu-dera", nextTime: "13:30", done: 2, total: 5+ )+ .frame(width: width)+ .background(RoundedRectangle(cornerRadius: 24, style: .continuous).fill(Color(hex: 0x0C0C0F).opacity(0.92)))+ }+}++/// The Live Activity at the widths an iPhone's and an iPad's lock screen give+/// it, and with a long German day and stop, to see it hold at each.+struct LiveActivityWidths: View {+ var body: some View {+ VStack(alignment: .leading, spacing: 18) {+ ForEach([364, 500, 640] as [CGFloat], id: \.self) { width in+ LiveActivityCard(width: width)+ }+ TripDayBanner(+ tripTitle: "Herbst in Kyoto und Nara", dayLabel: "Tag 3 von 9",+ nextName: "Kiyomizu-dera und Sannenzaka-Spaziergang", nextTime: "13:30", done: 2, total: 5+ )+ .frame(width: 364)+ .background(RoundedRectangle(cornerRadius: 24, style: .continuous).fill(Color(hex: 0x0C0C0F).opacity(0.92)))+ }+ .padding(28)+ .background(Color(hex: 0x1E2A3A))+ }+}