Skip to content

Comments

Don't announce when merging onto highway#239

Merged
bsudekum merged 3 commits intomasterfrom
annnounce-ramp
May 23, 2017
Merged

Don't announce when merging onto highway#239
bsudekum merged 3 commits intomasterfrom
annnounce-ramp

Conversation

@bsudekum
Copy link
Contributor

When there is only a single option and it is to merge onto a highway, a high alert becomes redundant and is noise. The removes the high alert when the upcoming maneuver is merge and the current maneuver is takeOnRamp.

/cc @ericrwolfe

@bsudekum bsudekum requested review from 1ec5 and frederoni May 22, 2017 21:09
fallbackText = speechString(notification: notification, markUpWithSSML: false)

// If the user is merging onto a highway, an announcement to merge is a bit excessive
guard let upComingStep = routeProgress.currentLegProgress.upComingStep, !(routeProgress.currentLegProgress.currentStep.maneuverType == .takeOnRamp && upComingStep.maneuverType == .merge && routeProgress.currentLegProgress.alertUserLevel == .high) else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's no upcoming step, this code also bails. Is that intended?

@1ec5
Copy link
Contributor

1ec5 commented May 23, 2017

When there is only a single option

This PR doesn't check that there's only one possible maneuver. Does it need to?


// If the user is merging onto a highway, an announcement to merge is a bit excessive
guard let upComingStep = routeProgress.currentLegProgress.upComingStep, !(routeProgress.currentLegProgress.currentStep.maneuverType == .takeOnRamp && upComingStep.maneuverType == .merge && routeProgress.currentLegProgress.alertUserLevel == .high) else {
if let upComingStep = routeProgress.currentLegProgress.upComingStep, (routeProgress.currentLegProgress.currentStep.maneuverType == .takeOnRamp && upComingStep.maneuverType == .merge && routeProgress.currentLegProgress.alertUserLevel == .high) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the parentheses are no longer needed here.

@bsudekum bsudekum merged commit 7952bdc into master May 23, 2017
@bsudekum bsudekum deleted the annnounce-ramp branch May 23, 2017 16:53
wishtrip-dev pushed a commit to wishtrip-dev/mapbox-navigation-ios that referenced this pull request Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants