feat(feedback): Add screenshot attachment button to user feedback widget - #5828
Open
markushi wants to merge 17 commits into
Open
feat(feedback): Add screenshot attachment button to user feedback widget#5828markushi wants to merge 17 commits into
markushi wants to merge 17 commits into
Conversation
Contributor
|
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d8b6ce1 | 314.62 ms | 348.67 ms | 34.05 ms |
| 0d66c0b | 327.83 ms | 403.40 ms | 75.57 ms |
| fcec2f2 | 311.35 ms | 384.94 ms | 73.59 ms |
| c3ee041 | 310.64 ms | 361.90 ms | 51.26 ms |
| 22f4345 | 313.52 ms | 364.96 ms | 51.44 ms |
| 6b019b7 | 343.31 ms | 417.23 ms | 73.91 ms |
| b6cfb57 | 372.92 ms | 507.77 ms | 134.85 ms |
| b67bb28 | 307.59 ms | 341.24 ms | 33.65 ms |
| 5865051 | 319.74 ms | 365.60 ms | 45.86 ms |
| 80fd6ad | 321.06 ms | 375.79 ms | 54.73 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d8b6ce1 | 0 B | 0 B | 0 B |
| 0d66c0b | 1.58 MiB | 2.29 MiB | 720.89 KiB |
| fcec2f2 | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| c3ee041 | 0 B | 0 B | 0 B |
| 22f4345 | 1.58 MiB | 2.29 MiB | 719.83 KiB |
| 6b019b7 | 0 B | 0 B | 0 B |
| b6cfb57 | 1.58 MiB | 2.28 MiB | 718.80 KiB |
| b67bb28 | 0 B | 0 B | 0 B |
| 5865051 | 0 B | 0 B | 0 B |
| 80fd6ad | 0 B | 0 B | 0 B |
Previous results on branch: feat/feedback-screenshot-attachment
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 71243e7 | 313.69 ms | 370.22 ms | 56.54 ms |
| 37c6869 | 327.68 ms | 381.06 ms | 53.38 ms |
| 676848b | 367.87 ms | 443.02 ms | 75.15 ms |
| 86e5409 | 326.20 ms | 351.31 ms | 25.11 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 71243e7 | 0 B | 0 B | 0 B |
| 37c6869 | 0 B | 0 B | 0 B |
| 676848b | 0 B | 0 B | 0 B |
| 86e5409 | 0 B | 0 B | 0 B |
markushi
marked this pull request as ready for review
July 23, 2026 17:27
markushi
requested review from
0xadam-brown,
adinauer,
romtsn and
runningcode
as code owners
July 23, 2026 17:27
…entry/sentry-java into feat/feedback-screenshot-attachment
runningcode
reviewed
Jul 24, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
Thanks for adding this!
Use term "screenshot" everywhere Improve nullability handling
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0a3d51d. Configure here.
…hment paths Routes the three catch-all blocks around the screenshot picker through ExceptionUtils.rethrowIfFatal, so OOM, ThreadDeath and linkage errors propagate instead of being hidden, and logs the previously silent failure in getUriSize. Also moves the androidx.activity availability check out of SentryFeedbackScreenshotPicker, so the class is only loaded once the check passed, as its javadoc requires. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… buttons The form was not scrollable, so in landscape or at large font scales the send and cancel buttons were pushed off screen and the dialog could not be dismissed. Wraps it in a ScrollView. Also replaces the three full width buttons with the framework dialog button bar: cancel and send sit in a right aligned bar, and the screenshot button becomes a borderless full width action. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…istration ActivityResultRegistry.registerKey returns early for a key that is already registered, so re-registering would not have thrown. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…hot-attachment # Conflicts: # CHANGELOG.md # sentry-android-core/src/main/java/io/sentry/android/core/SentryUserFeedbackForm.java # sentry-android-core/src/test/java/io/sentry/android/core/SentryUserFeedbackFormTest.kt # sentry/api/sentry.api # sentry/src/main/java/io/sentry/SentryFeedbackOptions.java # sentry/src/main/java/io/sentry/SentryOptions.java # sentry/src/test/java/io/sentry/SentryFeedbackOptionsTest.kt
…ed types AGENTS.md now forbids new catch (Throwable). Replaces the three broad catches with the types the guarded code can actually throw: - launch() documents ActivityNotFoundException and the registry throws IllegalStateException for an unregistered launcher - the ContentResolver calls cross into the provider process, where Binder can only deliver the exceptions Parcel marshals, all RuntimeException Fatal throwables now propagate because they are never caught, so ExceptionUtils.rethrowIfFatal is no longer needed here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📜 Description
Adds an "Add a screenshot" button to the Android user feedback form that opens the
androidx photo picker (
ActivityResultContracts.PickVisualMedia, images only) and sendsthe picked image as an attachment in the same envelope as the feedback.
Screen_recording_20260813_202418.mp4
SentryFeedbackOptions:enableAttachScreenshot(defaulttrue, matching the JS SDK),addScreenshotButtonLabel,removeScreenshotButtonLabel,screenshotTooLargeMessageText, plus theio.sentry.feedback.enable-attach-screenshotmanifest flagandroidx.activity:activity:1.8.2is added as compileOnly — no new transitivedependency; the button is hidden (with a warning log) when androidx.activity is missing
or the host Activity is not a
ComponentActivitymaxAttachmentSizeat pick timeFixed along the way
The form was not scrollable, so in landscape or at large font scales the send and cancel
buttons were pushed off screen and the dialog could not be dismissed. It is now wrapped in
a
ScrollView, and the three full width buttons were replaced with the framework dialogbutton bar (cancel and send in a right aligned bar, screenshot as a borderless full width
action). No changelog entry, as it is bundled with this feature.
💡 Motivation and Context
💚 How did you test it?
Unit tests + Manual testing.
📝 Checklist
sendDefaultPIIis enabled.