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

fix(Android): minimize issues when updating map global data #600

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

boringcactus
Copy link
Member

Summary

Ticket: 🤖 | Nearby Transit | Initial load jank

The acceptance criteria mention this too and I entirely forgot about it when implementing #598 so here it is as a separate PR. More details in the Asana comments.

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

Testing

Verified that the alerts are correctly drawn as they arrive and that the UI does not hang while the global data is recalculating.

@boringcactus boringcactus requested a review from a team as a code owner December 18, 2024 22:12

@Composable
override fun rememberGlobalMapData(now: Instant): GlobalMapData? {
var result by remember { mutableStateOf<GlobalMapData?>(null) }
Copy link
Collaborator

@KaylaBrady KaylaBrady Dec 19, 2024

Choose a reason for hiding this comment

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

suggestion(non-blocking): For consistency with the refresh functions below, this could update a mutable state property of the VM rather than remembering the result within the function

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it works the same way as those refresh functions - it's a @Composable called from the UI thread and not a suspend fun called from a LaunchedEffect, and even if I made globalMapData() update some mutable state it'd still need to return the value to avoid uglier code or less up-to-date output of the refresh functions.

@boringcactus boringcactus merged commit 46d2461 into main Dec 19, 2024
5 checks passed
@boringcactus boringcactus deleted the mth-global-map-jank branch December 19, 2024 16:51
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