Skip to content

Commit 9008ff9

Browse files
authored
Bump Compose BOM and Paparazzi, drop the snapshot diff threshold, re-record goldens (#1795)
* Bump Compose BOM and Paparazzi, drop the diff threshold, re-record goldens - androidxComposeBom 2024.11.00 -> 2025.08.01 and paparazzi 1.3.4 -> 1.3.5, matching the chat SDK. - Remove MAX_PERCENT_DIFFERENCE: the 0.5 threshold only existed because Paparazzi 1.3.4 antialiased fonts differently between macOS (recording) and Linux (CI verification). Paparazzi now runs with its default threshold. - Re-record all 159 goldens. Paparazzi 1.3.5 names snapshot files with underscores instead of spaces, so every file is deleted and re-added. The new images are pixel-identical to the old ones; the BOM bump caused no visual change. * Make the snapshot suite deterministic and cover both palettes per test The preview call's duration flow emits its first value after a one second delay, so the first test in a class captured either the title or "0s" in the call app bar, depending on JVM warm-up. previewCall now keeps the duration flow collected and waits for its first value once, so every composition sees the same value. Snapshot structure: - Full screens use two files (light and dark); the two-half helpers are for components only, since a full-screen composable takes the whole height and hides the second half. Applied to the call participants list. - The two-half helpers take a background color, used by the livestream overlay test to stand in for the video it is drawn over. - The livestream backstage pair is merged into one two-half snapshot. - The deprecated CallContent overload gets its dark variant.
1 parent b40bbe6 commit 9008ff9

201 files changed

Lines changed: 46 additions & 76 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ androidxActivity = "1.9.2"
2828
androidxDataStore = "1.1.1"
2929
googleService = "4.4.2"
3030

31-
androidxComposeBom = "2024.11.00"
31+
androidxComposeBom = "2025.08.01"
3232
androidxComposeTracing = "1.0.0-beta01"
3333
androidxHiltNavigation = "1.2.0"
3434
androidxComposeNavigation = "2.8.4"
@@ -69,7 +69,7 @@ androidxUiAutomator = "2.4.0-alpha01"
6969
androidxContraintLayout = "2.1.4"
7070
androidxEspresso = "3.5.1"
7171
androidxMedia = "1.7.0"
72-
paparazzi = "1.3.4"
72+
paparazzi = "1.3.5"
7373
robolectric = "4.11.1"
7474
junit = "4.13.2"
7575
truth = "1.1.3"

stream-video-android-previewdata/src/main/kotlin/io/getstream/video/android/mock/StreamPreviewDataUtils.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import io.getstream.video.android.core.model.MediaTrack
2727
import io.getstream.video.android.model.User
2828
import io.getstream.webrtc.VideoTrack
2929
import kotlinx.coroutines.flow.first
30+
import kotlinx.coroutines.launch
3031
import kotlinx.coroutines.runBlocking
3132
import kotlinx.coroutines.withTimeout
3233
import org.threeten.bp.OffsetDateTime
@@ -78,9 +79,13 @@ public val previewCall: Call = Call(
7879
state.upsertParticipants(participants)
7980
// The sorted participants state is filled asynchronously on the call scope. Wait for it so
8081
// composables that read call.state.participants never render the transient empty state.
82+
// The duration flow emits its first value after a one second delay. Keep it subscribed and
83+
// wait for that value once, so compositions never race between "no duration" and "0s".
84+
state.scope.launch { state.duration.collect {} }
8185
runBlocking {
8286
withTimeout(5_000) {
8387
state.participants.first { it.size == participants.size }
88+
state.duration.first { it != null }
8489
}
8590
}
8691
}

stream-video-android-ui-compose/api/stream-video-android-ui-compose.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ public final class io/getstream/video/android/compose/ui/components/call/diagnos
16191619
public final fun getLambda$-1813442361$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
16201620
public final fun getLambda$-2145781751$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
16211621
public final fun getLambda$-547082680$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function2;
1622-
public final fun getLambda$841979657$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
1622+
public final fun getLambda$1939297546$stream_video_android_ui_compose_release ()Lkotlin/jvm/functions/Function3;
16231623
}
16241624

16251625
public final class io/getstream/video/android/compose/ui/components/call/lobby/CallLobbyKt {

stream-video-android-ui-compose/src/test/kotlin/io/getstream/video/android/compose/ui/PaparazziComposeTest.kt

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ import io.getstream.video.android.compose.ui.components.avatar.LocalAvatarPrevie
4343
import io.getstream.video.android.mock.StreamPreviewDataUtils
4444
import org.junit.Rule
4545

46-
/**
47-
* Goldens are recorded on developer machines (macOS) and verified on Linux CI. On the
48-
* Paparazzi version this repo can use with Kotlin 1.9 (1.3.4), font antialiasing differs
49-
* slightly between the two platforms: CI measured diffs of 0.10% to 0.30% on goldens that
50-
* are pixel-identical intent-wise, against a default threshold of 0.1%. Real visual changes
51-
* are far above 0.5%. Revisit after the Kotlin 2 / Paparazzi 1.3.5 upgrade (the chat repo
52-
* runs that stack with the default threshold).
53-
*/
54-
internal const val MAX_PERCENT_DIFFERENCE = 0.5
55-
5646
/**
5747
* [DeviceConfig.PIXEL_2] geometry (411x731dp) at hdpi. The dp layout is identical to the
5848
* Pixel 2, but rendering at 1.5x keeps the golden files small, which speeds up comparisons.
@@ -99,7 +89,7 @@ internal interface PaparazziComposeTest {
9989
Box(
10090
modifier = Modifier
10191
.background(
102-
backgroundColor.takeOrElse { VideoTheme.colors.baseSheetPrimary },
92+
backgroundColor.takeOrElse(VideoTheme.colors::baseSheetPrimary),
10393
),
10494
contentAlignment = contentAlignment,
10595
) {
@@ -110,8 +100,13 @@ internal interface PaparazziComposeTest {
110100
}
111101
}
112102

103+
/**
104+
* Renders [composable] twice, dark above light. For components only: a full-screen composable
105+
* takes the whole height and hides the second half; snapshot those in two files with [snapshot].
106+
*/
113107
fun snapshotWithDarkMode(
114108
contentAlignment: Alignment = Alignment.TopStart,
109+
backgroundColor: Color = Color.Unspecified,
115110
composable: @Composable () -> Unit,
116111
) {
117112
paparazzi.snapshot {
@@ -121,7 +116,9 @@ internal interface PaparazziComposeTest {
121116
Box(
122117
modifier = Modifier
123118
.weight(weight = .5f, fill = false)
124-
.background(VideoTheme.colors.baseSheetPrimary),
119+
.background(
120+
backgroundColor.takeOrElse(VideoTheme.colors::baseSheetPrimary),
121+
),
125122
contentAlignment = contentAlignment,
126123
) {
127124
composable()
@@ -131,7 +128,9 @@ internal interface PaparazziComposeTest {
131128
Box(
132129
modifier = Modifier
133130
.weight(weight = .5f, fill = false)
134-
.background(VideoTheme.colors.baseSheetPrimary),
131+
.background(
132+
backgroundColor.takeOrElse(VideoTheme.colors::baseSheetPrimary),
133+
),
135134
contentAlignment = contentAlignment,
136135
) {
137136
composable()
@@ -144,6 +143,7 @@ internal interface PaparazziComposeTest {
144143

145144
fun snapshotWithDarkModeRow(
146145
contentAlignment: Alignment = Alignment.TopStart,
146+
backgroundColor: Color = Color.Unspecified,
147147
composable: @Composable () -> Unit,
148148
) {
149149
paparazzi.snapshot {
@@ -153,7 +153,9 @@ internal interface PaparazziComposeTest {
153153
Box(
154154
modifier = Modifier
155155
.weight(weight = .5f, fill = false)
156-
.background(VideoTheme.colors.baseSheetPrimary),
156+
.background(
157+
backgroundColor.takeOrElse(VideoTheme.colors::baseSheetPrimary),
158+
),
157159
contentAlignment = contentAlignment,
158160
) {
159161
composable()
@@ -163,7 +165,9 @@ internal interface PaparazziComposeTest {
163165
Box(
164166
modifier = Modifier
165167
.weight(weight = .5f, fill = false)
166-
.background(VideoTheme.colors.baseSheetPrimary),
168+
.background(
169+
backgroundColor.takeOrElse(VideoTheme.colors::baseSheetPrimary),
170+
),
167171
contentAlignment = contentAlignment,
168172
) {
169173
composable()

stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_CompoundComponentFactoryTest_compound component factory overrides a single component.png renamed to stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_CompoundComponentFactoryTest_compound_component_factory_overrides_a_single_component.png

File renamed without changes.

stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory call app bar with default title.png renamed to stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory_call_app_bar_with_default_title.png

File renamed without changes.

stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory call lobby controls.png renamed to stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory_call_lobby_controls.png

File renamed without changes.

stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory control actions with default handler.png renamed to stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory_control_actions_with_default_handler.png

File renamed without changes.

stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory empty defaults.png renamed to stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory_empty_defaults.png

File renamed without changes.

stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory incoming call content in dark mode.png renamed to stream-video-android-ui-compose/src/test/snapshots/images/io.getstream.video.android.compose.theme_VideoComponentFactoryTest_factory_incoming_call_content.png

File renamed without changes.

0 commit comments

Comments
 (0)