Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swipe down to reveal steps list #1150

Merged
merged 22 commits into from
Mar 14, 2018
Merged

Conversation

vincethecoder
Copy link
Contributor

@vincethecoder vincethecoder commented Feb 22, 2018

Added functionality to announce current navigation instructions when user puck is tapped.

Issue addressed: #979

PS: Ongoing discussion on what should respond to user interaction with map interface.

cc @mapbox/navigation-ios

TODO:

  • Reveal the step table upon swiping downwards from the banner, leaving in place the current tap gesture.

@bsudekum
Copy link
Contributor

@vincethecoder how shall we proceed here? Per voice yesterday, we discussed this probably is not the best user interaction since it's pretty hidden.

@vincethecoder
Copy link
Contributor Author

@bsudekum Yes, ideally it makes sense to repeat the instructions when the user taps the instructionsBannerView and then have tiny list icon at then top-right corner of the instructionsBannerView to show the remaining instructions. I believe that's more user friendly.

@vincethecoder
Copy link
Contributor Author

simulator screen shot - iphone 8 - 2018-02-26 at 15 37 01

Added a step icon between volume and feedback floating buttons at the right hand side of the map view.

@1ec5
Copy link
Contributor

1ec5 commented Feb 26, 2018

Added a step icon between volume and feedback floating buttons at the right hand side of the map view.

This might not be discoverable/tappable enough for something as crucial as getting the list of steps. Can we nest the button in the banner somehow?

@bsudekum
Copy link
Contributor

bsudekum commented Mar 1, 2018

Per conversation today in chat, we came to the conclusion that we should change this to:

  1. tapping top banner repeats instruction
  2. swiping down on top banner shows steps list

@vincethecoder vincethecoder changed the title Repeat Current Instructions when User Puck is Tapped. Repeat Current Instructions - [Onging Discussion] Mar 6, 2018
@vincethecoder vincethecoder changed the title Repeat Current Instructions - [Onging Discussion] Repeat Current Instructions - [Ongoing Discussion] Mar 6, 2018
@vincethecoder vincethecoder changed the title Repeat Current Instructions - [Ongoing Discussion] Repeat Current Instructions - [When Banner is Tapped] Mar 6, 2018
@vincethecoder vincethecoder changed the title Repeat Current Instructions - [When Banner is Tapped] Repeat Current Instructions - [When Banner is Tapped], Show Instructions Preview - [When Banner is Dragged] Mar 7, 2018
@vincethecoder
Copy link
Contributor Author

vincethecoder commented Mar 7, 2018

As referenced from the ongoing conversation on slack channel, we came to a final conclusion today.

  • Add a subtle handle to the bottom of the banner, as a visual cue that the banner reveals additional steps, similar to what Apple and Google do.
  • Reveal the step table upon swiping downwards from the banner, leaving in place the current tap gesture.

Issue reference: #1138 (comment)

@bsudekum
Copy link
Contributor

bsudekum commented Mar 7, 2018

I'm getting a crash, to reproduce:

  1. start with system muted
  2. move along a step
  3. unmute
  4. tap top banner
  5. asserts here

assert(routeProgress != nil, "routeProgress should not be nil.")

This value is set here:

guard !NavigationSettings.shared.voiceMuted else { return }
routeProgress = notification.userInfo![RouteControllerNotificationUserInfoKey.routeProgressKey] as? RouteProgress

And is nil because the system is muted.

@vincethecoder
Copy link
Contributor Author

@bsudekum cannot reproduce. Can you share the specific route, so that I can simulate it on my branch build? Thanks.

@bsudekum
Copy link
Contributor

bsudekum commented Mar 7, 2018

@vincethecoder I do not think this is specific to a route. The issue is that RouteVoiceController. routeProgress is never set while muted.

@vincethecoder
Copy link
Contributor Author

vincethecoder commented Mar 7, 2018

@bsudekum Sure. I just wanted to test the referenced crash after the change was made. It didn't crash for me. I understand why this not setting the RouteVoiceController. routeProgress will be an issue.

@vincethecoder
Copy link
Contributor Author

@bsudekum moreover, I don't believe the root cause of the identified issue will be in that function scope. We need to investigate why the notification's routeProgress is set to nil prior to our assert check. A separate issue ticket needs to be raised for that.

@bsudekum
Copy link
Contributor

bsudekum commented Mar 7, 2018

It's set to nil because the this check to voiceMuted is true:

guard !NavigationSettings.shared.voiceMuted else { return }
routeProgress = notification.userInfo![RouteControllerNotificationUserInfoKey.routeProgressKey] as? RouteProgress

@bsudekum bsudekum changed the title Repeat Current Instructions - [When Banner is Tapped], Show Instructions Preview - [When Banner is Dragged] Swipe down to reveal steps list Mar 7, 2018
displayPreviewInstructions()
}

private func repeatInstructions() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Per #1138 (comment), we discussed that the first two steps would be implemented first. No need to do anything around repeating the instruction yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bsudekum done ✅. This private function will just live here till we are ready to plug it in a delegate or gesture recognizer

Copy link
Contributor

Choose a reason for hiding this comment

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

@vincethecoder I think we should remove it and add it when it's time to add this feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

routeProgress = notification.userInfo![RouteControllerNotificationUserInfoKey.routeProgressKey] as? RouteProgress
assert(routeProgress != nil, "routeProgress should not be nil.")

guard !NavigationSettings.shared.voiceMuted else { return }
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be undone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bsudekum is there a reason why we have to undo this?

@bsudekum bsudekum added this to the v0.16.x milestone Mar 12, 2018
@bsudekum
Copy link
Contributor

Let's break this PR up into two PRs:

  1. This pr which implements the gesture handlers
  2. Adding subtle button indicator view that clues the user they can pull down.

@@ -56,6 +56,8 @@ extension BaseInstructionsBannerView {
self.separatorView = separatorView

addTarget(self, action: #selector(BaseInstructionsBannerView.tappedInstructionsBanner(_:)), for: .touchUpInside)
Copy link
Contributor

Choose a reason for hiding this comment

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

Tests are failing because this function still exists but was removed here: https://github.com/mapbox/mapbox-navigation-ios/pull/1150/files#diff-7bae0cf60f54997d0d5e86fe02b5cddbL60 and renamed to draggedInstructionsBanner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved ✅

@bsudekum
Copy link
Contributor

bsudekum commented Mar 14, 2018

@vincethecoder when running locally, it appears that tapping the top banner no longer shows the upcoming list view; only swiping.

Scratch that, my pull didn't grab everything.

Copy link
Contributor

@bsudekum bsudekum left a comment

Choose a reason for hiding this comment

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

Per conversation, we're going to add the indicator button view in a followup PR.

@bsudekum
Copy link
Contributor

@vincethecoder the changelog addition can go under the master section.

@bsudekum bsudekum merged commit 7155faa into master Mar 14, 2018
@bsudekum bsudekum deleted the navigation/repeat_instruction branch March 14, 2018 23:20
@brsbl-zz brsbl-zz mentioned this pull request Mar 15, 2018
3 tasks
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.

3 participants