8000 feat(Android): departure tiles by boringcactus · Pull Request #714 · mbta/mobile_app · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(Android): departure tiles #714

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

Merged
merged 7 commits into from
Feb 6, 2025
Merged

feat(Android): departure tiles #714

merged 7 commits into from
Feb 6, 2025

Conversation

boringcactus
Copy link
Member

Summary

Ticket: 🤖 | stop + trip details | departure tiles

TileData probably belongs in the shared code, but we can worry about that later.

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 in alphabetical order
  • Expensive calculations are run in withContext(Dispatchers.Default) where possible

Testing

Manually verified that the tiles behave properly when on the Green Line and when headsigns all match. Ported unit tests over from iOS.

@boringcactus boringcactus requested a review from a team as a code owner February 5, 2025 22:10
# Conflicts:
#	androidApp/src/main/java/com/mbta/tid/mbta_app/android/stopDetails/StopDetailsFilteredDeparturesView.kt
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.

Amazing 🎉

import androidx.compose.ui.semantics.SemanticsActions
import androidx.compose.ui.test.SemanticsMatcher

fun hasClickActionLabel(expected: String?) =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

< 8000 div data-view-component="true" class="comment-reactions js-reactions-container js-reaction-buttons-container social-reactions reactions-container d-flex">
Comment on lines 86 to 88
// If you can figure out a better way to make the pill left aligned to the text and the
// status right aligned to the text whether the text is wider or narrower than the pill
// + status, please do.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Messing around with it a bit locally, I think width(IntrinsicSize.Max) on the Column and fillMaxWidth() on the headsign text will have the effect you're looking for

Copy link
Member Author

Choose a reason for hiding this comment

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

That did it, thanks! I don't think I'd used IntrinsicSize before; I'll definitely have to remember that.

Comment on lines +110 to +114
LaunchedEffect(tripFilter) {
if (tripFilter != null) {
bringIntoViewRequesters[tripFilter.tripId]?.bringIntoView()
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed that after scrolling the list a bit and selecting a tile in the middle of the scroll view, it is scrolled so that the selected tile is at the end of the view which felt a little unexpected. Is there a way around that?

Screen_Recording_20250206_094256.mp4

Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated but noticed from the video that the tiles should also scroll from edge to edge, without getting cut off by side padding. But that'll involve broader padding/layout changes, so maybe it would be best to save it for a final QA pass where we tweak the padding of everything to get it to play nice in different states and match the spec.

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 know why the scroll position is being reset like that. I thought it might be that the rememberScrollState was too far down in the hierarchy and it was being forgotten when the DepartureTiles helper component's identity was changing somehow, but moving it further up didn't appear to help.

Scrolling from edge to edge isn't all that much work, though, I can sneak that in here.

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 was right, I just didn't hoist it high enough. Since the trip filter is an argument to everything from the stop details page on down, I think the component identity of every single thing in the sheet resets when the trip filter changes. That's going to be annoying for the rest of the time we spend working on the app, so it might be worth considering other approaches, but certainly not now.

@boringcactus boringcactus merged commit 2e9bfd0 into main Feb 6, 2025
7 checks passed
@boringcactus boringcactus deleted the mth-departure-tiles branch February 6, 2025 22:09
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
0