Improved the UX on Stations Page
This commit is contained in:
@@ -67,21 +67,6 @@ Tradeoffs:
|
||||
- Slightly more frontend code, but minimal security risk.
|
||||
- Must ensure caching behavior is acceptable (browser cache won’t 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
|
||||
|
||||
Reference in New Issue
Block a user