findNextStep() needs more context
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 33
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
`findNextStep()` essentially treats the route line as an unordered set of points, ignoring the route line’s directionality. It always returns the closest step, but that isn’t always correct. For example, when the next step is a U-turn, a later step may be closer than the U-turn. Assuming the route line is correct, client code will end up instructing the user to turn right into a grass field rather than turning right onto the side street:

To handle this and other cases correctly, we need to keep track of which steps along the route line have already been completed and simply return the first uncompleted step. (Client code should periodically call `shouldReRoute()` to handle the case where a step has been skipped successfully.) In other words, finding the next step is less of a spatial problem and more of a problem of checking items off a list.
/cc @bsudekum @mikemorris
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating findNextStep() and reading how it evaluates route-line points and steps. Trace the interaction with shouldReRoute() and the client code, then define completion as returning the first uncompleted step while preserving rerouting when a step has been skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100