| Prompt | When driver cancels a ride, notifying a cancellation means both an in app status change and notification at the top of the homepage for those who reserved seating and/or storage in their car
Ai:
In my PHP app "Seat Saver" at /Users/louiseoconnell/Herd/seat-saver, when a driver cancels a ride (pages/trip_cancel.php → cancel_trip()), the in-app status change on the passenger side already exists — pages/my_rides.php's "Riding" tab already shows "Cancelled by the driver" for any reservation where trips.is_cancelled is true (via get_reservations_for_user(), which already selects t.is_cancelled), and there's already a "Remove" button there (posting to pages/reservation_cancel.php → cancel_reservation()) that deletes the reservation and gives the seat/storage back to the pool.
What's missing: passengers with a cancelled reservation should also see a notification banner at the top of the homepage (index.php), not just have to notice it on the My Rides page. Please add that.
- On
index.php, above the rides list, show a dismissible banner if the logged-in user has any reservation where the trip is cancelled — something like "One of your rides was cancelled" with which event/date it was, and a link to pages/my_rides.php?view=riding to see details.
- For "dismiss," reuse the existing removal flow rather than inventing new state to track: the banner going away permanently once a cancelled reservation is removed is already how
cancel_reservation()/reservation_cancel.php behaves, so a "Dismiss" button on the banner can just post to that same endpoint. Don't add a separate "acknowledged" column or notifications table for this — the existing cancelled-reservation-until-removed model already covers it.
- Match the existing banner/alert styling already used elsewhere (
.alert, .alert--error/.alert--success in css/style.css) rather than introducing a new visual style.
- If the user has more than one cancelled reservation at once, show all of them (not just the first).
|
|---|