Skip to content

Delete route alternatives from the web planner, the iOS app, the route server and the route API #3287

Closed

Description

@timohueser

Status: done
Size: M
Part of #3286.
Systems: route-planning, routing

TL;DR

Goal: No client asks for alternative routes and the route server computes none.
Problem: "Route options" lists alternative routes. It adds a link, a list, lines on the map and a second elevation view. The corridor alternative exists only for a route with two points, so trips almost never get it. The owner wants it removed everywhere.
Decision: Delete the feature in the web planner, the iOS app, the router, the service and the spec. The answer stays {"routes": [...]} with exactly one route, so the web planner can deploy before the route service. The service keeps no code for old clients, because the project has no released app.
Contracts: specs/route-api.md, specs/vectors/route-answer.json

Plan

  1. Web, whole files: delete builder/web/src/lib/planner/route-options.ts, route-options.test.ts, builder/web/src/components/planner/CompareList.svelte and CompareProfile.svelte.
  2. builder/web/src/components/planner/PlannerApp.svelte: delete the state list and each line that resets it, the "Route options" link (.list-links), its header and lead text (.list-head, .list-lead), optionRows, optionsReason, optionStatus, useOptionRow, comparison, the compare prop of the map and the CompareProfile branch of the drawer. The side panel then always shows the day list or the route list.
  3. builder/web/src/components/planner/PlannerMap.svelte: delete the compare prop, its line layers and its letter marks.
  4. builder/web/src/lib/planner/plan-session.svelte.ts: delete options, compared, findAlternatives, previewOption and the function that applies an option. builder/web/src/lib/planner/routing.ts: delete requestAlternatives, the alternatives field of the request body, RoutingLine.primary and via. builder/web/src/lib/planner/route-legs.ts: delete LegCache.add. route-answer.ts: stop reading reason and via.
  5. Router: delete planner/router/src/alternatives.rs. That file holds Router::routes, which goes with it. In planner/router/src/router.rs delete Request.alternatives, Request.alternatives_only, Route.reason, Route.via, the struct Response, the field primary and the method Router::primary; Router::route stays the one entry point and computes the route itself. answer::answer in answer.rs takes one &Route and writes {"routes": [route]}. planner/service/src/lib.rs calls router.route. Update lib.rs, shape.rs, search.rs, examples/query.rs and planner/service/tests/http.rs to match.
  6. planner/router-build/tests/routing.rs: delete the tests of alternatives and the deleted struct fields.
  7. Spec: in specs/route-api.md delete the request rows alternatives and alternatives_only, the answer rows reason and via, and the sentences about alternatives. The answer text becomes: "The answer is {"routes": [...]}. It holds one route." specs/vectors/route-answer.json keeps one route; update specs/vectors/README.md.
  8. READMEs: delete the lines about alternatives in planner/router/README.md, planner/service/README.md and planner/router-build/README.md.
  9. iOS: delete companion-ios/Packages/OBCKit/Sources/OBCUI/PlannerPreview/PlannerRouteOptions.swift, PlannerRouteOptionsPanel.swift and companion-ios/Packages/OBCKit/Tests/OBCUITests/PlannerRouteOptionsTests.swift. In PlannerPreviewView.swift delete the panel case .options and the "Route options" row. In PlannerPreviewModel.swift and PlannerPreviewMap.swift delete the option state and the .option line. In OBCPlanner/PlannerService.swift delete RouteOption, the alternatives request and the alternatives parameter. LocalFirstPlanner.swift and RouteAnswer.swift (fields reason, via) follow.
  10. Tests: remove the alternatives cases from plan-session.test.ts, routing.test.ts, PlannerApp.svelte.test.ts, builder/web/tests/browser/planner/stubs.js and companion-ios/Packages/OBCKit/Tests/OBCPlannerTests/PlannerServiceTests.swift.

Stays: the presets (riding-profiles.ts), the less-climbing profiles, signed routes, saved versions and "Compare versions" (CompareScreen.svelte), townName.

Deployment order: the web planner, then a new iOS build, then the route service. The iOS app sends alternatives: false on every route request and the service rejects unknown fields. So every route request of an iOS build from before this change fails against the new service.

Done when

  • obc test -p planner-router -p planner-service -p planner-router-build
  • obc exec cargo clippy -p planner-router -p planner-service -p planner-router-build --all-targets -- -D warnings
  • From builder/web: npx vitest run src/lib/planner/ src/components/planner/ and npm run check
  • grep -ri "alternative" builder/web/src/lib/planner builder/web/src/components/planner planner/router planner/service specs/route-api.md finds nothing about route alternatives.
  • CI builds and tests the iOS package. iOS cannot be compiled on the Linux build machine.

Activity

  1. added a commit that references this issue on Nov 10, 2026
  2. timohueser commented on Nov 10, 2026

    @timohueser
    OwnerAuthor

    Merged into planner-ux with #3313.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions