feat(journey-planner): alight-alert bell on each result row - #221
Merged
Merged
Conversation
Each journey option row gets the run-pattern bell (issue #201): one tap follows the run and arms the "I'm getting off here" alert at the journey's destination stop, skipping the tap-through to the pattern timeline. The trip is built from planner data alone — completesAtUtc is seeded with the destination arrival and corrected to the terminus by AlightAlertService's first poll — so arming costs no network fetch. Replace-confirmation, contextual notification/location prompts, and the armed-state derivation all mirror the run-pattern screen. Closes #220 Co-Authored-By: ai-tiro <ai-tiro@jfx.ac> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Debug APK: app-debug-1f6e0928355da8481b3f0d9c6d768265d5a85c25.apk (built from Requires GitHub login. Artifact expires after 3 days. |
Collaborator
Author
|
Uploaded via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Closes #220
What
Adds the alight-alert bell (🔔) to every journey option row on the journey planner results list. Tapping it follows that run and arms the "I'm getting off here" alert (#201) at the journey's destination stop — the one-tap version of opening the run pattern and belling the destination stop. Tapping the armed bell stops tracking. The armed state is derived reactively from
FollowedTripRepository, so it stays consistent with arming/disarming done on the run-pattern screen or from the ongoing notification.How / why it's built this way
FollowedTripnormally wants the run's terminus arrival forcompletesAtUtc, which only the pattern knows — but most journey options are derived from a departures join without ever fetching a pattern. Instead the trip is built from planner-local data (runRef/route/direction from theJourneyOption, alert stop id/name/coordinates from the destinationStop) andcompletesAtUtcis seeded with the arrival at the destination. That's safe becauseAlightAlertServicestarts the moment an alert is stored and refreshescompletesAtUtcfrom the pattern terminus on its first poll (and every poll after), and the 5-minute completion grace covers the gap. Arming is instant and costs zero network.JourneyPlannerRouteis theRunPatternRouterecipe verbatim: contextual POST_NOTIFICATIONS request on arm (snackbar on denial), contextual location request when the armed run is schedule-only.routeType == Tram(trams never carry real-time on the pattern endpoint the service polls, even though their departures feeds do — CLAUDE.md quirk) or when the option has no estimate at either end.Decisions worth reviewing
completesAtUtcseeding (above) is a deliberate, self-correcting approximation. If every pattern poll failed for the whole trip, the follow would auto-clear 5 min after the destination arrival instead of the terminus — by which point the user has alighted anyway.Testing
followedAtUtcand resets alert latches, disarm/no-op paths, replace confirm/dismiss, tram + schedule-only location prompt, armed-state derivation incl. a trip armed from the run-pattern screen). 41/41 green, detekt/lint clean.Notes
TooManyFunctionson the ViewModel (public methods are one-per-screen-event by convention) andLargeClasson the test (same trade asNearbyViewModelTest).FollowedTripshape untouched.🤖 Generated with Claude Code