P1: Favourites Trends graph — FuelHistoryStore + TrendsView (Swift Charts)
- Shared/FuelHistory.swift: GitHub mirror read path (latest.json pointer + history/YYYY-MM-DD.json day files); day math (UTC noon keys), slim day decode with the shared price band, series + deltaSeries (vs-cheapest rebase), favourites-only app-group cache (90-day prune), parallel per-day fetches, 404/network = graph gap never error. - FuelPriceProvider: shared priceBand + mapGrades (single source for live + history decoding). - FuelBoard/TrendsView.swift: line chart in the Favourites tab via toolbar button + sheet; fuel capsule (fuels with favourites only), 7/30/90 range, Price/vs-cheapest toggle, per-station legend, price-display style on y-axis, empty/loading/retry states with honest copy; no widget in v1. - Localizable.strings: Trends keys. - 83 tests (13 history + URL regression): day math, band guard, series gaps, delta rebasing, prune, and the appendingPathComponent regression (relative URL resolution dropped /main — all fetches 404'd). - Sim-verified: favourites rows + TOP/deltas; sheet controls + building-up state with live first-snapshot date (archive has 1 day; lines render once >=2 snapshots). - Backlog: P1 Trends DONE (unmerged); P0 REMAINING = live provider chain + telemetry beacon.
This commit is contained in:
@@ -134,3 +134,17 @@
|
||||
|
||||
/* Station row */
|
||||
"best" = "best";
|
||||
|
||||
/* Trends — price history chart */
|
||||
"Trends" = "Trends";
|
||||
"Range" = "Range";
|
||||
"Mode" = "Mode";
|
||||
"Price" = "Price";
|
||||
"vs cheapest" = "vs cheapest";
|
||||
"%lld days" = "%lld days";
|
||||
"Fetching price history…" = "Fetching price history…";
|
||||
"Couldn't load price history" = "Couldn't load price history";
|
||||
"Retry" = "Retry";
|
||||
"No price history yet" = "No price history yet";
|
||||
"First snapshot %@ — a few days are needed to draw a trend." = "First snapshot %@ — a few days are needed to draw a trend.";
|
||||
"Prices are recorded each day FuelBoard's relay runs — check back in a few days." = "Prices are recorded each day FuelBoard's relay runs — check back in a few days.";
|
||||
|
||||
Reference in New Issue
Block a user