Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions Where/WhereUI/Sources/Preview/PreviewSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,15 @@
@MainActor
public static func plannedStayYearReportModel(
showsEstimatedTimeAndPlanning: Bool = true,
plannedRegion: Region = .newYork,
recordedThroughDay: CalendarDay? = nil,
plannedThroughDay: CalendarDay = CalendarDay(year: year, month: 8, day: 15),
) -> YearReportModel {
let completeReport = sampleReport()
var calendar = Calendar(identifier: .gregorian)
calendar.timeZone = TimeZone(identifier: "America/Los_Angeles")!
let today = CalendarDay(from: referenceNow, in: calendar)
let recordedDays = completeReport.days.filter { $0.day <= today }
let recordedDays = completeReport.days.filter { $0.day <= recordedThroughDay ?? today }
var recordedTotals: [Region: Int] = [:]
for day in recordedDays {
for region in day.regions {
Expand All @@ -370,8 +373,8 @@
now: { referenceNow },
)
model.forecasts.setActivePlannedStay(PlannedStay(
region: .newYork,
through: CalendarDay(year: year, month: 8, day: 15),
region: plannedRegion,
through: plannedThroughDay,
))
return model
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import SwiftUI

/// Draws the lighter planned treatment, fading it in after a joined recorded card.
struct PlannedPresenceJourneyBackground: View {
let position: PresenceJourneyCardPosition
let tint: Color

@Environment(\.stylesheet) private var stylesheet

var body: some View {
let timeline = stylesheet.timeline
let row = timeline.row
let planned = timeline.planned
let shape = position.shape(cornerRadius: row.cornerRadius)

ZStack {
if position.isJoinedContinuation {
VStack(spacing: 0) {
LinearGradient(
colors: [
tint.opacity(row.fillOpacity),
tint.opacity(planned.fillOpacity),
],
startPoint: .top,
endPoint: .bottom,
)
.frame(height: planned.transitionHeight)

tint.opacity(planned.fillOpacity)
}
} else {
shape
.fill(tint.opacity(planned.fillOpacity))
}

PlannedStayHatch(
color: tint,
spacing: planned.hatchSpacing,
lineWidth: planned.hatchLineWidth,
gridOriginX: 0,
)
.opacity(planned.hatchOpacity)
.mask {
if position.isJoinedContinuation {
VStack(spacing: 0) {
LinearGradient(
colors: [.clear, .white],
startPoint: .top,
endPoint: .bottom,
)
.frame(height: planned.transitionHeight)

Color.white
}
} else {
Color.white
}
}
}
.clipShape(shape)
}
}

#if DEBUG
#Preview {
PlannedPresenceJourneyBackground(position: .bottom, tint: .blue)
.frame(width: 240, height: 120)
.padding()
.whereBroadwayRoot()
}
#endif
Loading
Loading