Skip to content

Commit cfd61ba

Browse files
runningcodeclaude
andauthored
docs(snapshots): Align Android DSL with plugin restructuring (#17565)
## DESCRIBE YOUR PR Aligns Android Snapshots docs with the DSL restructuring from sentry-android-gradle-plugin [PR #1167](getsentry/sentry-android-gradle-plugin#1167): - Nest `theme`, `includePrivatePreviews`, and `generateTests` under the new `previews {}` block - Rename `generateSnapshotTests` → `generateTests` - Document the new `packageTrees` option ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1d4a0ae commit cfd61ba

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

docs/platforms/android/snapshots/index.mdx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Set up [Snapshots](/product/snapshots/) for your Android app with the Sentry And
1313

1414
## Step 1: Enable Snapshots
1515

16-
Ensure the [Sentry Android Gradle Plugin](/platforms/android/configuration/gradle/) version 6.5.0 or higher is applied and configured.
16+
Ensure the [Sentry Android Gradle Plugin](/platforms/android/configuration/gradle/) version 6.6.0 or higher is applied and configured.
1717

1818
Then enable snapshots in your `build.gradle`:
1919

@@ -53,30 +53,36 @@ plugins {
5353

5454
#### Customize Preview Generation
5555

56-
The `snapshots` block on the Sentry extension exposes two options that shape the generated Paparazzi tests. Both only apply when `generateSnapshotTests` is `true` (the default).
56+
The `previews` block inside `snapshots` exposes options that shape the generated Paparazzi tests. These only apply when `generateTests` is `true` (the default).
5757

5858
```kotlin
5959
sentry {
6060
snapshots {
6161
enabled = true
62-
theme = "@style/Theme.MyApp" // optional
63-
includePrivatePreviews = false // optional, defaults to true
62+
previews {
63+
theme = "@style/Theme.MyApp" // optional
64+
includePrivatePreviews = false // optional, defaults to true
65+
packageTrees = listOf("com.example") // optional, defaults to Android namespace
66+
}
6467
}
6568
}
6669
```
6770

68-
| Option | Default | Description |
69-
| ------------------------ | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
70-
| `theme` | Paparazzi default (`android:Theme.Material.NoActionBar.Fullscreen`) | Android theme resource used when rendering previews. Set this if your previews rely on a specific theme. |
71-
| `includePrivatePreviews` | `true` | Whether `@Preview` composables declared `private` are snapshotted. Set to `false` to exclude in-progress or internal-only previews. |
71+
| Option | Default | Description |
72+
| ------------------------ | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
73+
| `theme` | Paparazzi default (`android:Theme.Material.NoActionBar.Fullscreen`) | Android theme resource used when rendering previews. Set this if your previews rely on a specific theme. |
74+
| `includePrivatePreviews` | `true` | Whether `@Preview` composables declared `private` are snapshotted. Set to `false` to exclude in-progress or internal-only previews. |
75+
| `packageTrees` | `[]` (falls back to Android namespace) | Package prefixes to scan for `@Preview` composables. When empty, the plugin uses the Android namespace from the build variant. |
7276

7377
If you don't set a `theme`, Paparazzi uses its own default (`android:Theme.Material.NoActionBar.Fullscreen`). If the background of your previews isn't important — for example, when you just want to compare component geometry — you can use a translucent platform theme such as `android:Theme.Translucent.NoTitleBar`:
7478

7579
```kotlin
7680
sentry {
7781
snapshots {
7882
enabled = true
79-
theme = "android:Theme.Translucent.NoTitleBar"
83+
previews {
84+
theme = "android:Theme.Translucent.NoTitleBar"
85+
}
8086
}
8187
}
8288
```
@@ -96,13 +102,15 @@ Use this path if you already generate snapshots with another tool. The configura
96102

97103
#### Paparazzi
98104

99-
If you already have [Paparazzi](https://github.com/cashapp/paparazzi) configured, set `generateSnapshotTests = false` so Sentry uses your existing tests instead of auto-generating preview-based ones:
105+
If you already have [Paparazzi](https://github.com/cashapp/paparazzi) configured, set `generateTests = false` inside the `previews` block so Sentry uses your existing tests instead of auto-generating preview-based ones:
100106

101107
```kotlin
102108
sentry {
103109
snapshots {
104110
enabled = true
105-
generateSnapshotTests = false
111+
previews {
112+
generateTests = false
113+
}
106114
}
107115
}
108116
```

0 commit comments

Comments
 (0)