You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: docs/platforms/android/snapshots/index.mdx
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Set up [Snapshots](/product/snapshots/) for your Android app with the Sentry And
13
13
14
14
## Step 1: Enable Snapshots
15
15
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.
17
17
18
18
Then enable snapshots in your `build.gradle`:
19
19
@@ -53,30 +53,36 @@ plugins {
53
53
54
54
#### Customize Preview Generation
55
55
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).
57
57
58
58
```kotlin
59
59
sentry {
60
60
snapshots {
61
61
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
|`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. |
|`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. |
72
76
73
77
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`:
74
78
75
79
```kotlin
76
80
sentry {
77
81
snapshots {
78
82
enabled =true
79
-
theme ="android:Theme.Translucent.NoTitleBar"
83
+
previews {
84
+
theme ="android:Theme.Translucent.NoTitleBar"
85
+
}
80
86
}
81
87
}
82
88
```
@@ -96,13 +102,15 @@ Use this path if you already generate snapshots with another tool. The configura
96
102
97
103
#### Paparazzi
98
104
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:
0 commit comments