Conversation
| let isDeparture = routeProgress.currentLegProgress.currentStep.maneuverType == .depart && alertLevel == .depart | ||
| let didCompleteManeuver = routeProgress.currentLegProgress.currentStep.distance > 2_000 && routeProgress.currentLegProgress.alertUserLevel == .low | ||
| if isDeparture || didCompleteManeuver { | ||
| let isDeparture = routeProgress.currentLegProgress.currentStep.maneuverType == .depart && (alertLevel == .depart || alertLevel == .low) |
There was a problem hiding this comment.
Maybe rename this variable to isStartingDeparture to reflect its narrower scope.
| if isDeparture || didCompleteManeuver { | ||
| let isDeparture = routeProgress.currentLegProgress.currentStep.maneuverType == .depart && (alertLevel == .depart || alertLevel == .low) | ||
| if let currentInstruction = currentInstruction, isDeparture { | ||
| if routeProgress.currentLegProgress.currentStep.distance > 2_000 { |
There was a problem hiding this comment.
Pull this number out into a constant and document it.
There was a problem hiding this comment.
Should this be based on the step's overall distance or the distance remaining to the maneuver? Also, what happens if the user is a significant distance from the departure point, like in a parking lot – how does that affect the behavior?
There was a problem hiding this comment.
Also, what happens if the user is a significant distance from the departure point, like in a parking lot – how does that affect the behavior?
Let's pull this out into a different PR.
|
@1ec5 updated, pulling #654 (comment) into a followup task. |
We've been omitting departure instructions like
Head west on foo street.This change now makes departure instructions:
Continue west on foo street for 5 miles.Head west on foo street, then in 0.7 miles, turn right onto bar street.Turn right onto bar street.Note, this only can occur when on the departure step and the alert level is .depart or .low.
/cc @1ec5 @frederoni @ericrwolfe