Improved the UX on Stations Page

This commit is contained in:
Eric Gullickson
2025-12-14 12:51:29 -06:00
parent 3852ec9f71
commit a9fc7741a6
9 changed files with 377 additions and 55 deletions

View File

@@ -67,21 +67,6 @@ Tradeoffs:
- Slightly more frontend code, but minimal security risk.
- Must ensure caching behavior is acceptable (browser cache wont cache `blob:` URLs; rely on backend caching headers + client-side memoization).
#### Option A2 (Simplest Code, Higher Risk): Make Photo Endpoint Public
Why: Restores `<img>` behavior with minimal frontend work.
Implementation outline:
- Backend: remove `preHandler: [fastify.authenticate]` from `/stations/photo/:reference`.
- Add lightweight protections to reduce abuse (choose as many as feasible without adding heavy deps):
- strict input validation (length/charset) for `reference`
- low maxWidth clamp and no arbitrary URL fetching
- maintain `Cache-Control` header (already present)
- optionally add server-side rate limit (only if repo already uses a rate-limit plugin; avoid introducing new infra unless necessary)
Tradeoffs:
- Anyone can hit `/api/stations/photo/:reference` and spend your Google quota.
### Option B (Remove Images): Simplify Cards
Why: If image delivery adds too much complexity or risk, remove images from station cards.
@@ -124,7 +109,7 @@ Important: some saved stations may have `latitude/longitude = 0` if cache miss;
- Desktop saved list: add a “Navigate” icon button that opens a small menu with the 3 links (cleaner than inline links inside `ListItemText`).
- File: `frontend/src/features/stations/components/SavedStationsList.tsx`
- Mobile bottom sheet (station details): add a “Navigate” section with the same 3 links (buttons or list items).
- Mobile bottom sheet (station details): add a “Navigate” section with the same 3 links as buttons.
- File: `frontend/src/features/stations/mobile/StationsMobileScreen.tsx`
## Work Breakdown for Multiple Agents