-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor(iOS): Move stop details fetching into VM #599
Changes from 4 commits
9582f34
5655ffa
a6c0736
d998583
262fdd2
35910b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,16 +286,18 @@ struct ContentView: View { | |
viewportProvider: viewportProvider | ||
) | ||
.toolbar(.hidden, for: .tabBar) | ||
.onAppear { | ||
let filtered = stopFilter != nil | ||
screenTracker.track( | ||
screen: filtered ? .stopDetailsFiltered : .stopDetailsUnfiltered | ||
) | ||
} | ||
} | ||
// Set id per stop so that transitioning from one stop to another is handled by removing | ||
// the existing stop view & creating a new one | ||
.id(stopId) | ||
.onChange(of: stopId) { nextStopId in stopDetailsVM.handleStopChange(nextStopId) } | ||
.onAppear { | ||
stopDetailsVM.handleStopAppear(stopId) | ||
screenTracker.track( | ||
screen: stopFilter != nil ? .stopDetailsFiltered : .stopDetailsUnfiltered | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry @EmmaSimon one last thought - does this affect how visits to stop details are counted in GA? Wondering if it would alter the stats about how users progress through the funnel There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it might actually, I should move it back to where it was and add a second |
||
) | ||
} | ||
.onDisappear { stopDetailsVM.leaveStopPredictions() } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion(non-blocking): I think the calls to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my notes in the PR description, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh right, thank you, I wasn't connecting the dots on how this fit in with that. One other non-blocking thought that comes to mind based on that - it could help to clarify the behavior to add a new component to the stop details hierarchy to clarify w/ naming and/or comments that there is this stable stop details container that is unchanging and presented once, and that the inner piece is more volatile. Something like Page vs Container doesn't feel meaningfully distinctive as a name, but I think clarifying the difference between these layers could help with understandability down the line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I like that idea, I can try to fit that into one of the follow up PRs! |
||
.transition(transition) | ||
|
||
case let .legacyStopDetails(stop, filter): | ||
|
This file was deleted.
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.
question(non-blocking): can the
stopId
field be removed as a prop ofStopDetailsPage
entirely? That way it can't get out of sync with what is in the VM.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.
Oh interesting. That does seem temping, but I don't think it's possible, it might cause issues with the loading state and page transitions. The ID in
StopData
is only populated once the schedules have loaded, soStopDetailsPage
couldn't start checking auto filters until after the network request, and it uses the prop stop ID to make sure that it doesn't change the departures if it doesn't match the ID inStopData
, which I think was the fix for the issue I was seeing with double prediction loads.