Skip to content

Conversation

@EmmaSimon
Copy link
Contributor

@EmmaSimon EmmaSimon commented Sep 3, 2025

Summary

Ticket: Prep for Move StopDetailsViewModel to shared code

Now that the global data will no longer be included in the stop details VM, we need a new way to get it in the stop/trip details views that use it. This introduces a .global modifier which takes a GlobalResponse binding and handles loading and updating global data. This gets rid of a bunch of repeated code for doing this which was scattered across a bunch of views.

I'm also planning to do the same thing for favorites data, since that's also in the iOS stop details VM, and follows a similarly repetitive pattern to the global data (except in fewer places).

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

Testing

Updated existing tests to pass, except for a skipped StopDetailsVM test that was being difficult which will be wiped out in the follow up PR anyway.

@EmmaSimon EmmaSimon requested a review from a team as a code owner September 3, 2025 21:17
@EmmaSimon EmmaSimon requested a review from KaylaBrady September 3, 2025 21:17
self.stopDetailsVM = stopDetailsVM

leafFormat = leaf.format(now: now, globalData: stopDetailsVM.global)
leafFormat = leaf.format(now: now, globalData: nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

question(non-blocking): Is this init of leafFormat needed? As long as there are onChange calls to set it when now or global changes, then I think this isn't 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.

Unfortunately it is, because it's not nullable and won't compile if it isn't initialized in the constructor. We could probably make it nullable, but that seemed more difficult.

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.

Awesome!

@EmmaSimon EmmaSimon enabled auto-merge September 4, 2025 15:18
Split out extensions and modifiers into separate directories.
@EmmaSimon EmmaSimon force-pushed the es-ios-global-load-modifier branch 3 times, most recently from c76e5aa to c2ec305 Compare September 4, 2025 19:40
@EmmaSimon EmmaSimon force-pushed the es-ios-global-load-modifier branch from c2ec305 to afcdf9b Compare September 4, 2025 20:00
@EmmaSimon EmmaSimon added this pull request to the merge queue Sep 4, 2025
Merged via the queue into main with commit e9583ed Sep 4, 2025
11 checks passed
@EmmaSimon EmmaSimon deleted the es-ios-global-load-modifier branch September 4, 2025 20:32
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