feat(ui): consolidate map filters and rework station selection

- replace inline filter pills with a single "Filters" popover containing
  small pill buttons for fuel/radius/sort/brand (no native <select>s)
- map polish: Carto Positron tiles, hidden zoom buttons, locate-me floating
  button + accuracy ring, smooth flyTo transitions, slim ⓘ attribution
- map markers no longer open Leaflet popups; clicking a marker selects the
  station and surfaces the existing StationCard inline over the map, with
  swipe-down-to-close and a small overlay × button
- price colour now reflects deal quality (cheap / average / expensive vs
  search avg ± 3p) on both list and map — stable across sort/filter
- promote the "X ago" timestamp into the card header so it stays visible
  in the expanded state

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ovidiu U
2026-05-05 12:16:13 +01:00
parent 8dad223d06
commit 11a3b433ff
7 changed files with 587 additions and 256 deletions

View File

@@ -1,6 +1,15 @@
import { ref } from 'vue'
import api from '../axios.js'
const DEAL_THRESHOLD_PENCE = 300
function classifyDeal(price_pence, baseline_pence) {
if (baseline_pence == null) return 'average'
if (price_pence <= baseline_pence - DEAL_THRESHOLD_PENCE) return 'cheap'
if (price_pence >= baseline_pence + DEAL_THRESHOLD_PENCE) return 'expensive'
return 'average'
}
export function useStations() {
const stations = ref([])
const meta = ref(null)
@@ -26,7 +35,11 @@ export function useStations() {
try {
const response = await api.get('/stations', { params })
stations.value = response.data.data
const baseline = response.data.meta?.avg_pence ?? null
stations.value = response.data.data.map(s => ({
...s,
deal_quality: classifyDeal(s.price_pence, baseline),
}))
meta.value = response.data.meta
prediction.value = response.data.prediction ?? null
} catch (err) {