feat: unify transfer risk rule and fix tight-transfer display - #784
Open
reidzeibel wants to merge 4 commits into
Open
feat: unify transfer risk rule and fix tight-transfer display#784reidzeibel wants to merge 4 commits into
reidzeibel wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
reidzeibel
marked this pull request as ready for review
September 4, 2026 21:14
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.
Part of https://github.com/AtB-AS/kundevendt/issues/24416
Background
The same transfer situation was classified by two different rules — one here, one in the app — so planner web and app could disagree about the same trip.
The rule now lives in
@atb-as/utils(7.1.0), imported by planner-web (this PR), atb-bff (soon) and mittatb-app (soon).What changes
hasTemporalOverlap/hasGuaranteedInterchangeIntoand usesgetLegTransferRiskfrom the package instead. The guaranteed-interchange handling from fix: respect guaranteed interchanges when determining trip status #781 is preserved — samemaximumWaitTimesemantics, just no longer a local copy.TripPatternStatusnarrows to'valid' | 'stale'(data freshness only) and risk is reported per leg astransferRisk, plus the worst value at trip level.unlikelybelow −120 s (error, "Ikke mulig") and the newuncertainat 0…−120 s (info, "Usikker overgang"). The card now shows the same verdict as the details screen. This will be refined further, but for this step, we are just aligning how it is between planner-web and app.How will it look like
maximumWaitTimemaximumWaitTimestartedandendedoutranksstale, so a started trip will not show "Resultatene kan være utdaterte" message.Tight transfers
The trip details had no transfer-risk UI at all — only the card chip. It now shows "Usikker overgang" on the leg, styled like the app.
Two display fixes came out of testing a real 23-second transfer, which showed as
15:18 → 15:17with no message at all:Rounding
main15:18 → 15:1715:17 → 15:1715:18 → 15:1715:17 → 15:1715:18 → 15:1815:18 → 15:2015:19 → 15:17Kort byttetid message
mainScreenshots