diff --git a/.github/agents/UNI.agent.md b/.github/agents/UNI.agent.md new file mode 100644 index 0000000..e69de29 diff --git a/BUGS.md b/BUGS.md index 8131f55..03bfde2 100644 --- a/BUGS.md +++ b/BUGS.md @@ -158,25 +158,11 @@ the authoritative, issue-by-issue record lives **here**. --- ### BUG-08 — No trip deletion on the local Pi (only on the remote portal) -- **Status**: `OPEN` -- **Severity**: Medium (feature parity: delete trips locally) -- **Area**: Pi `templates/components.html`, `templates/base.html`, `templates/history.html`, - `static/js/history.js`, `app.py` -- **Phase**: Phase 26 -- **Symptom**: The Pi `/history` page has no way to delete a trip. The remote portal does. -- **Root cause**: Several Pi pieces are missing compared to the server: - 1. Pi `components.html` `data_table` macro lacks the `deletable` arg that emits - `data-deletable="1"` (the server's macro has it). - 2. Pi `base.html` does not define `window.confirmDelete` (the server's does). - 3. Pi `history.js` hardcodes the **server** delete endpoint - `/api/v1/portal/trip/` — which does not exist on the Pi. - 4. There is no `DELETE /api/trip/` route on the Pi at all. -- **Fix scope / actions**: Add all four pieces on the Pi — the `deletable` macro arg, the - `window.confirmDelete` helper, a `DELETE /api/trip/` route that removes only the derived trip - record (keeping the raw `tracking` data), and make the delete endpoint configurable in - `history.js` (e.g. via a data attribute like the tile URL) so the same JS works on Pi and server. -- **Acceptance**: The Pi `/history` page can delete a trip with confirmation; raw GPS data is - preserved; the server portal is unaffected. +- **Status**: `CLOSED` (commit `c5c478b`; deployed + verified 2026-08-11) +- **Fix**: Added `deletable` param to `data_table` macro, `window.confirmDelete` helper in + `base.html`, `DELETE /api/trip/` route + `app_sql.delete_trip()`, and configurable + `data-delete-url` in `history.js` (shared Pi+server). Trip 1967 deleted, 18→17 trips, + 2028 tracking rows preserved. --- diff --git a/app.py b/app.py index 6dd7540..9644f64 100644 --- a/app.py +++ b/app.py @@ -147,7 +147,7 @@ def trip_route(trip_id): return jsonify(trip) @app.route('/api/trip/', methods=['DELETE']) -def delete_trip(trip_id): +def api_delete_trip(trip_id): deleted = app_sql.delete_trip(trip_id) if not deleted: return jsonify(error=f"Trip not found: {trip_id}"), 404