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: put nearby transit in sheet #108

Merged
merged 1 commit into from
Apr 1, 2024
Merged

Conversation

BrandonTR
Copy link
Contributor

@BrandonTR BrandonTR commented Mar 28, 2024

Summary

Simulator Screenshot - iPhone 15 Pro - 2024-03-28 at 11 26 10

Ticket: Put nearby transit in a sheet over the map

Putting the existing nearby transit view into a sheet. With SwiftUI's partial sheet implementations only being available in iOS 16+ we needed to backport some functionality from UIKit where it's been available since iOS 15. The only thing not available in iOS 15 is the custom detent option, we are left with just having .medium and .large.

Testing

Mostly manual testing and accessibility audit. Not sure how to best test this change from an automated standpoint as it's mostly native API interfacing.

@BrandonTR BrandonTR force-pushed the br-nearby-transit-sheet branch from c318942 to fac048e Compare March 29, 2024 14:00
@BrandonTR BrandonTR marked this pull request as ready for review March 29, 2024 14:17
@BrandonTR BrandonTR requested a review from a team as a code owner March 29, 2024 14:17
@BrandonTR BrandonTR requested a review from KaylaBrady March 29, 2024 14:17
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.

Looks good! Tried it out locally. This does seem tricky to test - potentially UITests would be appropriate for testing this, but we also don't have the foundation in place for writing those tests yet, so I think it is appropriate to hold off on writing an automated test for it.

Potentially one thing to look into - I'm noticing === AttributeGraph: cycle detected through attribute [number] in the logs when switching between detents.

Replaces the use of the presentationDetents & presentationBackgroundInteraction modifiers
as they're only available in iOS 16+ for SwiftUI
**/
func partialSheetDetents(
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 cool approach of making this a modifier!


controller.animateChanges {
controller.detents = detents.map(\.uiKitDetent)
controller.prefersScrollingExpandsWhenScrolledToEdge = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion (non-blocking): testing locally, it was a bit unexpected that scrolling made the sheet bigger. Since there isn't anything in the acceptance criteria about how to handle scrolling, may be worth sharing a video with product & design in our slack channel to get their input! I don't see that as needing to block merging of this PR though, if they do want to see any changes it could be addressed separately as a follow-up.

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.

👍 thanks for looking into those logs!

@BrandonTR BrandonTR force-pushed the br-nearby-transit-sheet branch from 5269dd1 to 5c577b8 Compare April 1, 2024 19:50
@BrandonTR BrandonTR merged commit 5c577b8 into main Apr 1, 2024
5 checks passed
@BrandonTR BrandonTR deleted the br-nearby-transit-sheet branch April 1, 2024 21:07
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.

2 participants