Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Android): Downstream disruptions/service changes #696

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

BrandonTR
Copy link
Contributor

Summary

Ticket: 🤖 | Stop + Trip Details | Show disruption downstream & handle service changes + unspecified stops

Add mini MVP card for downstream disruptions, service changes, and unspecified stops.

iOS
- [ ] If you added any user-facing strings on iOS, are they included in Localizable.xcstrings?
- [ ] Add temporary machine translations, marked "Needs Review"

android

  • All user-facing strings added to strings resource
    - [ ] Expensive calculations are run in withContext(Dispatchers.Default) where possible

Testing

Added tests for the various states.

@BrandonTR BrandonTR requested a review from a team as a code owner January 29, 2025 19:33
@BrandonTR BrandonTR requested a review from KaylaBrady January 29, 2025 19:33
@@ -205,4 +205,8 @@
<string name="waiting_to_depart">Waiting to depart</string>
<string name="weather">Weather</string>
<string name="westbound">Westbound</string>
<string name="effect_ahead">%1$s ahead</string>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: could you alphabetize these? I've been forgetting to do it myself, added a reminder to the PR template in #694

import com.mbta.tid.mbta_app.model.Alert

@Composable
fun StopDetailsDownstreamAlert(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BrandonTR this looks good for downstream alerts, but I'm not seeing the service change / unspecified stop behavior mentioned in the acceptance criteria that is covered in the iOS AlertCard implementation. I think the StopDetailsDowsntreamAlert is the component used in legacy stop details, but the linked AlertCard is what is used in combined stop details. Please follow up in the dev channel if you have any qs!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I misunderstood the scope between this ticket and this ticket I did start doing the full AlertCard impl as part of this ticket but thought it was going out of scope, going ahead and pushing it here!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense - these tickets were broken down based on how things were iterated on in iOS, but we probably could have broken it down more clearly for the fresh start in android where there wasn't an existing StopDetailsDownstreamAlert view that needed converting and we could go straight to the AlertCard. Sorry for the confusion! Please ask as scope boundary questions like this come up in the future!

Copy link
Collaborator

@KaylaBrady KaylaBrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! One question about elevator alerts since I wasn't able to reproduce it locally.

alerts.forEach { AlertCard(it) }
downstreamAlerts.forEach { AlertCard(it, AlertCardSpec.Downstream) }
if (showElevatorAccessibility) {
elevatorAlerts.forEach { AlertCard(it, AlertCardSpec.Elevator) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I see on mbta.com that there is an elevator alert at Davis, but I'm not seeing it on stop details with the elevator accessibility feature turned on, but I'm not sure why since this looks like what i'd expect to see. Any thoughts about what the issue might be? We can split that out from this PR though if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Briefly looked into this, the alert from the API seems to have the right effect and activities but we're still seeing 0 elevator alerts passed into this view. Not sure why.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into it! Non-blocking for this PR, I think it is OK to fix separately.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in the middle of the elevator alerts UI changes, I'll wait to put up the PR for that until after this is merged, since to be finalized it needs to use the AlertCard, and I can fix this as part of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to go ahead and rebase this PR and merge it to unblock you! I'll add the remaining suggested tests as a follow up PR with the rest of the "disruptions here" work.

import org.junit.Rule
import org.junit.Test

class AlertCardTests {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I think it would be worth copying the integration tests from StopDetailsFilteredDepartureDetailsTests as well that cover alerts cases

  • testShowsSuspension
  • testShowsDownstreamAlert
  • testShowsElevatorAlert

import com.mbta.tid.mbta_app.model.Alert

@Composable
fun StopDetailsDownstreamAlert(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense - these tickets were broken down based on how things were iterated on in iOS, but we probably could have broken it down more clearly for the fresh start in android where there wasn't an existing StopDetailsDownstreamAlert view that needed converting and we could go straight to the AlertCard. Sorry for the confusion! Please ask as scope boundary questions like this come up in the future!

@BrandonTR BrandonTR force-pushed the br-downstream-service-disruption branch from 1417d54 to f58236c Compare February 3, 2025 15:45
@BrandonTR BrandonTR merged commit dd6060c into main Feb 3, 2025
5 checks passed
@BrandonTR BrandonTR deleted the br-downstream-service-disruption branch February 3, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants