-
Notifications
You must be signed in to change notification settings - Fork 8
feat(iOS): Switch over to shared stop and trip VMs #1307
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
Conversation
| .onChange(of: nearbyVM.alerts) { _ in | ||
| handleGlobalMapDataChange(now: now) | ||
| } | ||
| .onChange(of: nearbyVM.routeCardData) { _ in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, nearbyVM.routeCardData was being set with the nearby route card data, but also, kinda inappropriately, with the stop details rcd. Since the map only cares about the stop details rcd, it was just doing this nav filtering to distinguish them. Now, this uses the molecule RouteCardDataViewModel directly, which is only updated with stop details rcd (the name isn't the best tbh). I could probably remove the stop details nav check now, not sure if it's really adding any additional safety, unless we start updating the RouteCardDataViewModel also with nearby rcd.
| } | ||
| .task { | ||
| for await model in stopDetailsVM.models { | ||
| alertSummaries = model.alertSummaries as? [String: AlertSummary?] ?? [:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model.alertSummaries has a type of [String: Any], which was slightly awkward to work around.
7f3a02b to
339caf7
Compare
boringcactus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
ec1f8db to
77fca68
Compare
Summary
Ticket: Move StopDetailsViewModel to shared code, follow up to #1273
This rips out the iOS specific
StopDetailsViewModeland replaces it with the shared stop and trip details VMs. I pulled out some VM specific handling out into modifiers, and had to rearrange a lot of the state and params in stop details, but functionality should be exactly the same.iOS
- [ ] If you added any user-facing strings on iOS, are they included in Localizable.xcstrings?- [ ] Add temporary machine translations, marked "Needs Review"Testing
Deleted iOS VM tests that are now covered by shared tests, and a few irrelevant tests that were testing VM functionality from the views. Got all existing tests passing with the new mock VMs