mirror of
https://github.com/Felitendo/Tanken.git
synced 2026-11-01 09:03:25 +01:00
The Tankstellen detail that opened from the Stats ranking or the Verlauf
extreme cards reused showStationSheet({ centered: true }), which leaked
map-only UI (manual-scan banner, "Umgebung neu scannen" button) and
broke in multiple ways:
- Austrian stations (id `at-…`) fell through to a pseudo-station with no
lat/lng/opening hours because Tankerkönig detail.php can't resolve
AT ids.
- Map-cache lookup matched on `name === name || brand === name`, so any
random Aral could be returned instead of the clicked one.
- Opening hours flashed in late via async DOM update on top of stale data.
Replace it with a dedicated openStationDetail flow:
- New /api/station/[id] AT branch reads from the in-memory scan cache
and returns the same shape as the DE path (sans opening hours, which
E-Control doesn't provide).
- New findCachedStationById helper finds the freshest cache copy
across all fuel scans.
- openStationDetail shows a skeleton, then resolves data via exact-id
cache match + /api/station/:id, merges them, and renders the full
modal — address, status with "schließt/öffnet um …", distance,
opening hours (when known), Maps buttons, 24h/7d price chart.
- showStationSheet is back to being the map bottom-sheet only.
Also harden the ranking aggregation in buildHistoryStats: group by
station_id when present, otherwise composite name|brand (avoids two
unrelated stations with the same display name colliding). Fold legacy
no-id rows into the matching id bucket. Raise STATION_MIN_SAMPLES
from 3 to 5 so a single dip can't crown a station.
7 lines
247 B
TypeScript
7 lines
247 B
TypeScript
/// <reference types="next" />
|
|
/// <reference types="next/image-types/global" />
|
|
import "./.next/types/routes.d.ts";
|
|
|
|
// NOTE: This file should not be edited
|
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|