Description
Overview
We are encountering an issue where Paparazzi golden snapshots generated through Showkase do not properly render in RTL (Right-to-Left) configurations. Despite configuring the device locale to RTL (e.g., locale = "ar"
) or setting LayoutDirection.RTL
for the device in PaparazziShowkaseDeviceConfig
, the snapshots are still rendered as LTR (Left-to-Right).
Note
- The Compose Previews render correctly in RTL when using
@Preview(locale = "ar")
. - The issue is isolated to Paparazzi-generated snapshots with Showkase.
- The correct strings for the locale are used int he snapshot, but the UI alignment is still LTR
Steps to Reproduce
Configure a Showkase snapshot test using Paparazzi with an RTL locale.
PaparazziShowkaseDeviceConfig(
uniqueIdentifier = "RTL",
deviceConfig = DeviceConfig.PIXEL_5.copy(
locale = "ar",
layoutDirection = LayoutDirection.RTL,
),
)
-- OR --
Configure a Showkase snapshot test using Paparazzi with a Compose preview with an RTL locale
@Preview(locale = "ar")
@Composable
fun FooComposableSnapshot() {
FooTheme {
ComposableContent(
...
)
}
}
- Ensure the Compose UI includes elements that respect RTL, such as text alignment or position-sensitive elements like icons or buttons.
- Run the snapshot test and compare the output.
- Observe that the snapshots are rendered in LTR, ignoring the RTL locale and layout direction.
- Observe that Compose Previews render correctly in RTL when using
@Preview(locale = "ar")
.
Environment
- Showkase Version: 1.0.3
- Paparazzi Version: (matching dependencies)
Additional Context
It seems like Paparazzi may not be correctly applying LayoutDirection.RTL
or locale configurations during snapshot generation. This issue could potentially originate in the interaction between Paparazzi and Showkase when generating golden snapshots for RTL locales.