Repository navigation
Conversation
Replaces the raw turn angle format with enum-typed steps that map directly to the instructions the frontend shows. Types only; mock data and wiring into the walking response come in a follow-up PR. Part of #97. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new turn by turn directions format to replace the raw turn angle (
Turn.degrees). Each step now has an enumtypethat maps directly to an instruction the frontend shows, so the FE doesn't need to work out from angles alone which branches exist. This PR only adds the types. Mock data and wiring them into the walking response come in the follow-up PR.Format
Directionsis an ordered array ofDirectionStep, a discriminated union ontype:typedepartturndirection:slight_left|left|sharp_left|slight_right|right|sharp_rightcontinuecrossstreet: string | nullarriveEvery step also has:
path_index: index intopath_coordswhere the step happensdistance: meters until the next step (0 forarrive)onto: string | null: name of the street/path walked along after this steplandmark: string | null: nearby landmark to anchor the instruction (carried over from the oldTurn.landmark)Notes:
.meta({ id }), so they slot into the OpenAPI generation in thedocu/*branches. Usesz.nullableinstead of optional fields.WalkingResponse(path_coords).type/directionit doesn't recognize.Example:
[ { "type": "depart", "path_index": 0, "distance": 40, "onto": "State St", "landmark": null }, { "type": "turn", "direction": "left", "path_index": 5, "distance": 20, "onto": null, "landmark": "Hatcher Library" }, { "type": "cross", "street": "S University Ave", "path_index": 8, "distance": 15, "onto": null, "landmark": null }, { "type": "arrive", "path_index": 12, "distance": 0, "onto": null, "landmark": null } ]Type of Change
feat)fix)Changed Files
src/walking/directions.ts(new)TurnDirection,DirectionStep(plus a schema per step),DirectionStepType,DirectionsRelated Issues
Part of #97 (step 1: types). Prereq of the #97 mock data PR and #98.
Does your code rely on another PR
No.
WalkingResponse.directions(the old format) is in #101, which hasn't merged. Swapping it toDirectionshappens in the mock data PR.Testing Done
Vitest:
tsc --noEmitand typedocChecklist
<type>(scope): short descriptionmainand is our current working update branch (e.g.maizebus2.1,dev)print()/debugPrint()/console.log()left in production code🤖 Generated with Claude Code