Repository navigation
fix(transit): show platform changes and the platform riders see - #728
Merged
Merged
Conversation
HAFAS departures mapped the planned platform as the current one, so
platform changes never showed. A merged board row kept the first
source's platform, which at Köln Messe/Deutz is DELFI's internal number
("85") rather than the track ("2"). Rows now show the platform most
sources give, and a change when one moves the departure off the plan
most sources give. Added platform sections ("10" to "10 A-B") are no
change.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Part of #401. Station boards showed the wrong platform in two ways.
platformand the planned one asplannedPlatform. Our mapping read them the other way round, which has been the case since the first transit commit. It also dropped the planned platform, so a board couldn't flag a change.Changes:
normalizeFptfDepartureand the stopovers of the dynamic registry, transport.rest and DB providers):platformis the current platform, andscheduledPlatformis the planned one. A cancelled departure keeps its planned platform.choosePlatform):platformChangedin@openmapx/mobility-core/platformtreats that as the same platform. The merge,PlatformBadgeand navigation's platform-change announcement all use it. Without it, this PR would have introduced a false "changed" badge.Köln Messe/Deutz, same departures. Before (
main, openmapx.com): DELFI's numbers.After: the tracks on the signs.
Köln Hbf, ICE 512 moved from track 5 to 6. Before: the change is shown from DELFI's "86".
After: from the planned track.
The after views come from a local web build of this branch against openmapx.com, through a local proxy (not committed) that builds the place boards with this branch's merge code. HAFAS stops go through this branch's adapter; the other stops' departures come from production. In the same setup, boards showed live changes that
maindrops: six at Frankfurt (Main) Hbf (e.g. RB33 20 → 19), three at München Hbf and two at Berlin Hbf.Known limits:
Not changed: the geocoding package's undeclared
@openmapx/mobility-coredependency. I listed it as a problem earlier, but it isn't one. 33 packages,apps/webamong them, importmobility-corewithout declaring it. They resolve it through the shared tsconfigpaths(tsx at runtime, Next and Vitest), and transitively through@openmapx/core, which declares it. So Turbo's task hashing still covers them. Declaring it in one of the 33 would change nothing.Validation:
New tests cover:
platformChanged;PlatformBadgewith added sections;Seven of these fail against
main's code.Full Vitest run: 24,541 passed, 1 failed. The failure was the guard against bare
fetch()in integrations, tripped by my uncommitted local proxy; it passes once the proxy is removed.check-typespasses forapps/api,apps/webandpackages/core, and Biome is clean.Not run locally: the docs build.
Release and upgrade impact
Product impact: ordinary
No package release: the built
@openmapx/extension-cliand@openmapx/extension-contractspackages are byte-identical tomain(both built and compared, 42 files); the changed shared code is the FPTF departure mapping in@openmapx/coreand the new platform helper in@openmapx/mobility-core, which they don't ship.