Skip to content
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

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

Open
JakeSchnorr opened this issue Jan 27, 2025 · 0 comments

Comments

@JakeSchnorr
Copy link

JakeSchnorr commented Jan 27, 2025

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.

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

No branches or pull requests

1 participant