Skip to content

feat(traffic): distinguish map data from route evidence - #426

Merged
Medformatik merged 9 commits into
mainfrom
feat/traffic-data-status
Oct 7, 2026
Merged

Medformatik merged 9 commits into
mainfrom
feat/traffic-data-status

Conversation

@Medformatik

@Medformatik Medformatik commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Driving and motorcycle route cards now show estimated traffic delays as 1 h 45 min (+45 min), with the duration and delay colored by the existing severity bands. The delay appears only when it is at least five minutes and 10% of the same-path comparison duration.

Unknown or insufficient congestion data leaves the duration in the normal text color. There is no visible unavailable-data row; the explanation remains in About traffic and the route's screen-reader description. Fresh, complete route-specific congestion evidence with no significant delay permits a green duration without an extra caption. Selecting a motorized route alone no longer turns its duration green.

The info button sits at the right of the duration line, above the distance, in every traffic state. Its optional popover explains the estimate, road-update verification and routing source. Request-bound proof checks remain unchanged; verified road-update explanations expire with their evidence and are separate from estimated congestion delays.

The owned Traffic flow legend uses a compact Fast–Slow scale and moves confidence/source explanations into its info popover. TomTom gains its own source/coverage disclosure. Neither map layer claims that its colors affected a route or establish fresh, complete coverage; the public tile formats do not expose usable update timestamps.

Provider limitation: current routing providers do not emit the new trafficCoverage evidence, so the green state is a tested UI consumer and is not yet reachable from production responses. Existing positive same-path delay estimates still appear without claiming complete coverage. When coverage evidence is supplied, its expiry removes both green and delay colors. Engine-side congestion coverage and public overlay publication metadata remain follow-up work; this PR does not close the whole end-to-end scope of #402.

Refs #402.

Verification

  • Final focused run on 2769a87: 121 tests passed across six files, covering route cards, traffic state, popover interactions and both legends.
  • All applicable GitHub checks passed on that commit: lint, types, node/web/mobile/database tests, production/docs builds, Docker builds and CodeQL. The earlier CodeQL regex thread is resolved.
  • Implementation verification also passed root policy/translations, docs build and the full pre-push suite (17,738 passed, 138 skipped, with VITEST_MAX_WORKERS=4; no hooks bypassed).
  • Rendered English/dark and German/light at 320 and 1280 CSS-pixel widths: normal/green/severity colors, inline parenthesized delays, no visible unavailable-data row, aligned 44-pixel info controls, no horizontal overflow or nested controls. Keyboard Escape restores focus without changing route selection. Unknown/expired states retain an accessible description; fresh states remove it.
  • Final visual inspection of the attached before/after images confirmed that they match the delivered layout.

Screenshots

Actual Before: retained from this PR's real parent commit bf47e937a2457f4a2539bcf43d1bf043ccea7248, not an earlier iteration of this PR. These original routes have no comparison duration.

Actual pre-PR route cards and owned legend

Current After examples: different controlled route fixtures demonstrate unavailable data, fresh complete coverage and an estimated 45-minute delay. The green example injects coverage evidence to demonstrate the consumer; it is not a production engine response or a claim of live regional coverage. Images are attached directly to this PR and are absent from the repository. Each PNG is captured at 960 pixels wide, with the 320 CSS-pixel layout enlarged for legibility.

English / dark:

Current traffic display states in English and dark mode

German / light:

Current traffic display states in German and light mode

Checklist

  • Documentation, translations and changeset updated, including the provider prerequisite.
  • No secrets, demo routes or screenshots committed.
  • Existing routing algorithms, provider selection and proof checks preserved.
  • Assigned Medformatik and applied existing enhancement/javascript/integration labels.
  • Contributor license agreement signed.

@Medformatik Medformatik added enhancement New feature or request javascript Pull requests that update javascript code integration New or changed data provider, source, or backend integration labels Oct 7, 2026
@Medformatik Medformatik self-assigned this Oct 7, 2026
Comment thread apps/web/src/components/panels/directions/RouteCard.test.tsx Fixed
@Medformatik
Medformatik merged commit 3c80939 into main Oct 7, 2026
26 checks passed
@Medformatik
Medformatik deleted the feat/traffic-data-status branch October 7, 2026 19:59
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request integration New or changed data provider, source, or backend integration javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants