Repository navigation
fix(api): ouvrir « Itinéraire » dans le mode du trajet vers l'étape - #544
Merged
Merged
Conversation
…trip to it The Google Maps URL of a step previously opened on foot only. `travelModeOf` carries the transitModes table of the tokens package, and `stepMapsUrl` opens the step at an index in the mode of the trip that leads to it, on foot for the first step and when the trip carries no mode. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The first step neither done nor skipped keeps its step, but maps-url now builds the URL with the shared stepMapsUrl of the orchestration: the mode of the trip to it (the transition of the previous step), on foot for the first step and when the trip carries no mode. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… the API The offline fallback of « Itinéraire » now builds the URL with the shared stepMapsUrl of the orchestration, in the mode of the trip to the step, exactly like maps-url; the local copy on foot is gone. The fixture carries a trip of each mode, and the test asserts the URL the API writes. The comment of the client notes what maps-url answers now. Fixes #510 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…tes offline The test of the trip modes took its expected value from travelModeOf, the function under test: it now names walking, bicycling, transit and driving, checks the destination of the step, and compares each URL of maps-url with stepMapsUrl on the steps of the same planning, as the app writes it offline. Prettier formatting of the files of the branch, and the comment of the directions action as a block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Plan et décisions : les trois commits GLM sont gardés tels quels. La règle vit dans |
Open
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.
Résultat et problème
« Itinéraire » ouvrait toujours Google Maps à pied :
GET /v1/me/planned/:id/maps-urlécrivaittravelmode=walking(walkingMapsUrlde l'API), et l'app recopiait la même URL à pied hors connexion. Le report de l'éditeur sur E-07 (D-052) demande le mode du trajet.packages/orchestration/src/maps.ts:travelModeOf(walk → walking, bike → bicycling, metro → transit, car → driving) etstepMapsUrl(steps, index), qui ouvre l'étape dans le mode du trajet qui y mène (transition.modede l'étape précédente), à pied pour la première étape, une seule destination, jamais dewaypoints(D-032).maps-url(API) et le repli hors connexion deuseGoActions().directions()(mobile) appellent tous deuxstepMapsUrl: une seule définition. Les deux copieswalkingMapsUrl(API et mobile) disparaissent.mappings.transitModes.modes[].mapsdepackages/tokens/generated/tokens.json, vérifié identique, avec un commentaire qui le dit : le paquet tokens n'exporte pas cette table (seulement le thème et les icônes). Copie acceptée pour ce ticket ; le risque d'écart est signalé à l'Inbox.Fixes #510
Écrans : E-07
Dépendance : aucune
Comment vérifier
Les trois premiers commits ont été écrits par un agent opencode (GLM) et sont gardés tels quels ; le quatrième corrige le test API du mode, qui prenait son attendu dans
travelModeOf, la fonction testée, et ajoute le formatage Prettier que GLM n'avait pas passé (pnpm lintlanceprettier --check .).packages/orchestration/src/maps.test.ts: chaque mode, première étape à pied, trajet sans mode à pied, une seule destination.apps/api/src/routes/planned-go.test.ts: un parcours dont les trois trajets sont à vélo, en métro et en voiture donnewalkingvers la première étape, puisbicycling,transitetdriving(valeurs littérales) ; la destination est celle de l'étape, sanswaypoints; chaque URL de l'API est égale àstepMapsUrlappliquée aux étapes du mêmePlannedRoute, ce que l'app écrit hors connexion (critère « URL hors connexion identique »).apps/mobile/src/go/progress.test.ts: la sortie fictive (testPlanned.ts, un trajet à vélo puis en métro) donne les URL exactes attendues.Contrôle par mutation en local : avec
metro → drivingdansmaps.ts, le test API échoue (l'ancien test l'aurait laissé passer).pnpm lint && pnpm typecheck && pnpm testverts en local — lint, Prettier et typecheck verts sans cache (pnpm turbo run lint typecheck --force) ; tests de l'orchestration, des fichiers API du planning et du Go, du dossiergomobile (vitest et jest) verts. Suite complète laissée à la CI (charge machine trop haute pour la suite API entière).Testé sur iOS / Android (préciser) — si mobile : non. Le changement mobile ne porte que sur la construction de l'URL hors connexion, sans rendu ; pas d'écran modifié, pas de test à 150 % de texte.
Formatage mécanique : oui, dans le quatrième commit (
useGo.ts: import regroupé par Prettier ;planned-go.test.tsreformaté avec la réécriture du test).Risque
Niveau : 1 — construction d'une URL externe à partir des données du planning de l'appelant, sans accès, stockage ni entrée non fiable nouveaux.
Taille : 4 commits, +97 / −0, +51 / −37, +29 / −24, +30 / −25 lignes, tests compris.
Revue OWASP : non déclenchée (pas d'accès, de configuration, d'authentification ni de requête nouvelle ; la destination vient du snapshot du planning de l'appelant, encodée par
encodeURIComponent).Retour arrière
Revert de la PR suffisant : aucune migration ni donnée persistée.
🤖 Generated with Claude Code