Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.mbta.tid.mbta_app.model

fun ObjectCollectionBuilder() = ObjectCollectionBuilder("test")
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private fun AlertFooter(updatedAt: EasternTimeInstant) {
@Composable
private fun AlertDetailsPreview() {
MyApplicationTheme {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("AlertDetailsPreview")
val route =
objects.route {
color = "ED8B00"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private fun DirectionRowViewPreview() {
MyApplicationTheme {
Column {
val now = EasternTimeInstant.now()
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("DirectionRowViewPreview")
val trip1 = objects.trip()
val prediction1 =
objects.prediction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fun PredictionRowView(
@Preview
@Composable
private fun PredictionRowViewPreview() {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("PredictionRowViewPreview")
val green = objects.line()
val greenB =
objects.route {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fun Departures(
@Composable
private fun DeparturesPreview() {
val now = EasternTimeInstant.now()
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("DeparturesPreview")
val redLine =
objects.route {
id = "Red"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private fun <T> haloPulseSpec() =
@Preview
@Composable
private fun VehiclePuckPreview() {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("VehiclePuckPreview")
val route =
objects.route {
color = "DA291C"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fun LoadingRouteStopListView(
toastViewModel: IToastViewModel = koinInject(),
) {
CompositionLocalProvider(IsLoadingSheetContents provides true) {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("LoadingRouteStopListView")
val mockRoute = LineOrRoute.Route(objects.route {})

RouteStopListView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fun DepartureTile(
@Preview
@Composable
private fun DepartureTilePreview() {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("DepartureTilePreview")
val route1 = objects.route()
val routeB =
objects.route {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fun DirectionPicker(
@Preview
@Composable
private fun DirectionPickerPreview() {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("DirectionPickerPreview")
val red =
objects.route {
color = "DA291C"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fun StopDetailsFilteredHeader(
@Preview
@Composable
private fun StopDetailsFilteredHeaderPreview() {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("StopDetailsFilteredHeaderPreview")
val route =
objects.route {
color = "ED8B00"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fun StopDetailsUnfilteredRoutesView(
@Composable
private fun StopDetailsRoutesViewPreview() {
val now = EasternTimeInstant.now()
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("StopDetailsRoutesViewPreview")

val route1 =
objects.route {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ fun TripDetailsView(
placeholderTripStops,
now,
emptyMap(),
globalResponse ?: GlobalResponse(ObjectCollectionBuilder()),
globalResponse
?: GlobalResponse(ObjectCollectionBuilder("TripDetailsView.loading")),
isTripDetailsPage,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ private fun upcomingTripViewState(
@Preview
@Composable
private fun TripHeaderCardPreview() {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("TripHeaderCardPreview")
val red =
objects.route {
id = "Red"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private fun TripStopRowPreview() {
val koin = koinApplication {
modules(module { single { SettingsCache(MockSettingsRepository()) } })
}
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("TripStopRowPreview")
val trip = objects.trip()
val now = EasternTimeInstant.now()
val red =
Expand Down Expand Up @@ -249,7 +249,7 @@ private fun TripStopRowDisruptionsPreview() {
val koin = koinApplication {
modules(module { single { SettingsCache(MockSettingsRepository()) } })
}
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("TripStopRowDisruptionsPreview")
val trip = objects.trip()
val now = EasternTimeInstant.now()
val red =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private fun StopList(
@Preview
@Composable
private fun TripStopsPreview() {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("TripStopsPreview")
val route =
objects.route {
color = "FFC72C"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// ObjectCollectionBuilderExtension.swift
// iosApp
//
// Created by Melody Horn on 10/16/25.
// Copyright © 2025 MBTA. All rights reserved.
//

import Shared

extension ObjectCollectionBuilder {
convenience init(fileID: String = #fileID, line: Int = #line) {
self.init(namespace: "\(fileID):\(line)")
}

func clone(fileID: String = #fileID, line: Int = #line) -> ObjectCollectionBuilder {
clone(namespace: "\(fileID):\(line)")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.mbta.tid.mbta_app

import io.ktor.client.engine.HttpClientEngine
import io.ktor.client.engine.okhttp.OkHttp
import java.util.UUID

internal class AndroidPlatform : Platform {
override val name: String = "Android ${android.os.Build.VERSION.SDK_INT}"
Expand All @@ -13,5 +12,3 @@ internal class AndroidPlatform : Platform {
}

internal actual fun getPlatform(): Platform = AndroidPlatform()

internal actual fun uuid(): String = UUID.randomUUID().toString()
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ internal interface Platform {

internal expect fun getPlatform(): Platform

internal expect fun uuid(): String

public enum class PlatformType {
iOS,
Android,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import org.koin.dsl.module

internal fun endToEndModule(): Module {
val now = EasternTimeInstant.now()
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("endToEndModule")
val lineRed = objects.line()
val routeRed =
objects.route {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public object LoadingPlaceholders {
context: RouteCardData.Context,
now: EasternTimeInstant,
): RouteCardData {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("LoadingPlaceholders.routeCardData")
val line =
if (routeId is Line.Id) {
objects.line {
Expand Down Expand Up @@ -115,7 +115,7 @@ public object LoadingPlaceholders {
}

public fun routeDetailsStops(lineOrRoute: LineOrRoute, directionId: Int): RouteDetailsStopList {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("LoadingPlaceholders.routeDetailsStops")
val fixedRand = Random("${lineOrRoute.id}-$directionId".hashCode())
fun randString(from: Int, until: Int) =
(1..fixedRand.nextInt(from, until)).joinToString("") { " " }
Expand Down Expand Up @@ -188,7 +188,7 @@ public object LoadingPlaceholders {
)

public fun tripDetailsInfo(): TripDetailsInfo {
val objects = ObjectCollectionBuilder()
val objects = ObjectCollectionBuilder("LoadingPlaceholders.tripDetailsInfo")
val route =
objects.route {
color = "8A9199"
Expand Down
Loading
Loading