Skip to content

Paparazzi RTL snapshots not respecting RTL configuration in Showkase version 1.0.3 #404

Open
@JakeSchnorr

Description

@JakeSchnorr

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(
            ...
        )
    }
}
  1. Ensure the Compose UI includes elements that respect RTL, such as text alignment or position-sensitive elements like icons or buttons.
  2. Run the snapshot test and compare the output.
  3. Observe that the snapshots are rendered in LTR, ignoring the RTL locale and layout direction.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions