Skip to content

SentryFeedbackWidget Improvements #2964

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
10bb505
Read default values from options
denrase May 27, 2025
6b11be6
Add screenshot from camera roll
denrase May 27, 2025
dd42c1b
Implmenet „Take Screenshot“ functionality
denrase May 27, 2025
4f0c254
move things around
denrase May 27, 2025
d2d0bfe
only read from feedback options
denrase May 27, 2025
eaa3d72
remove unused import
denrase May 27, 2025
4df7bf5
revert sentry widget changes
denrase May 27, 2025
aebeceb
make final instead of late final
denrase May 27, 2025
9592079
removeredundant comments
denrase May 27, 2025
09c60a5
implement @ueman feedback
denrase May 28, 2025
62f0687
ui customization, logo, tests
denrase May 28, 2025
9db5ee9
update and fix tests
denrase May 28, 2025
039ccd1
set screenshot, fix button shape
denrase May 28, 2025
fc57265
cleanup, changelog
denrase May 28, 2025
221c6c9
revert
denrase May 28, 2025
f92dce8
cleanup
denrase May 28, 2025
938a717
move key to button
denrase May 28, 2025
60bf363
move key to button
denrase May 28, 2025
8726c8f
replace spacing with sizedbox
denrase Jun 2, 2025
23ff8a6
fix logo
denrase Jun 2, 2025
009f5fd
update cl
denrase Jun 2, 2025
2197299
Merge branch 'main' into feat/imporve-user-feedback-widget
buenaflor Jun 12, 2025
aee610b
Merge branch 'main' into feat/imporve-user-feedback-widget
denrase Jun 16, 2025
5848af1
Remove iamge picking for now
denrase Jun 16, 2025
6ede4c7
remove generated files when running example
denrase Jun 16, 2025
8435dc8
fix comment
denrase Jun 16, 2025
0cf2020
remove feature from cl
denrase Jun 16, 2025
27a756d
remove addScreenshotButtonLabel
denrase Jun 16, 2025
3687d4f
remove unneccessary call, which is also not available on lower sdk ve…
denrase Jun 16, 2025
184a5b2
Merge branch 'main' into feat/imporve-user-feedback-widget
denrase Jun 18, 2025
d99d55b
update cl
denrase Jun 18, 2025
224527c
Merge branch 'main' into feat/imporve-user-feedback-widget
buenaflor Jun 20, 2025
5242142
Fix spelling error
buenaflor Jun 20, 2025
2a151e2
Save and restore form data when taking a screenshot
denrase Jun 23, 2025
86380e2
Merge branch 'main' into feat/imporve-user-feedback-widget
denrase Jun 25, 2025
d5bfab8
fix cl
denrase Jun 25, 2025
a5ea1aa
Capture replay when feedback widget is opened
denrase Jun 25, 2025
f84f616
Merge branch 'main' into feat/imporve-user-feedback-widget
denrase Jun 27, 2025
ba266be
Add integration name when feedback options are accessed
denrase Jun 27, 2025
680f402
implement mock stub
denrase Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
## Features

- Add os and device attributes to Flutter logs ([#2978](https://github.com/getsentry/sentry-dart/pull/2978))
- String templating for structured logs #3002 ([#3002](https://github.com/getsentry/sentry-dart/pull/3002))
- SentryFeedbackWidget Improvements ([#2964](https://github.com/getsentry/sentry-dart/pull/2964))
- Capture a device screenshot for feedback
- Customize tests and required fields
- Customization moved from the `SentryFeedbackWidget` constructor to `SentryFlutterOptions`:
```dart
options.feedback.showBranding = false;
```
- String templating for structured logs ([#3002](https://github.com/getsentry/sentry-dart/pull/3002))
- Add user attributes to Dart/Flutter logs ([#3014](https://github.com/getsentry/sentry-dart/pull/3002))

Expand Down Expand Up @@ -50,6 +58,7 @@ void initState() {
```
- Add `message` parameter to `captureException()` ([#2882](https://github.com/getsentry/sentry-dart/pull/2882))
- Add module in SentryStackFrame ([#2931](https://github.com/getsentry/sentry-dart/pull/2931))
- Set `SentryOptions.includeModuleInStackTrace = true` to enable this. This may change grouping of exceptions.
- Set `SentryOptions.includeModuleInStackTrace = true` to enable this. This may change grouping of exceptions.

### Dependencies
Expand Down
9 changes: 6 additions & 3 deletions dart/lib/src/sentry_attachment/sentry_attachment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ class SentryAttachment {
);

SentryAttachment.fromScreenshotData(Uint8List bytes)
: this.fromUint8List(bytes, 'screenshot.png',
contentType: 'image/png',
attachmentType: SentryAttachment.typeAttachmentDefault);
: this.fromUint8List(
bytes,
'screenshot.png',
contentType: 'image/png',
attachmentType: SentryAttachment.typeAttachmentDefault,
);

SentryAttachment.fromViewHierarchy(SentryViewHierarchy sentryViewHierarchy)
: this.fromLoader(
Expand Down
10 changes: 2 additions & 8 deletions flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -513,16 +513,10 @@ class MainScaffold extends StatelessWidget {
TooltipButton(
onPressed: () async {
final id = await Sentry.captureMessage('UserFeedback');
final screenshot = await SentryFlutter.captureScreenshot();

if (!context.mounted) return;
Navigator.push(
SentryFeedbackWidget.show(
context,
MaterialPageRoute(
builder: (context) => SentryFeedbackWidget(
associatedEventId: id, screenshot: screenshot),
fullscreenDialog: true,
),
associatedEventId: id,
);
},
text:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ class ReplayEventProcessor implements EventProcessor {

@override
Future<SentryEvent?> apply(SentryEvent event, Hint hint) async {
final hasException = event.eventId != SentryId.empty() &&
final shouldCaptureReplay = event.eventId != SentryId.empty() &&
event.exceptions?.isNotEmpty == true;
final isFeedback =
event.eventId != SentryId.empty() && event.type == 'feedback';
final shouldCaptureReplay = hasException || isFeedback;

if (shouldCaptureReplay) {
final isCrash =
Expand Down
74 changes: 74 additions & 0 deletions flutter/lib/src/feedback/sentry_feedback_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
class SentryFeedbackOptions {
// Form Configuration

/// The title of the feedback form.
var title = 'Report a Bug';

/// Requires the name field on the feedback form to be filled in.
var isNameRequired = false;

/// Displays the name field on the feedback form. Ignored if `isNameRequired` is `true`.
var showName = true;

/// Requires the email field on the feedback form to be filled in.
var isEmailRequired = false;

/// Displays the email field on the feedback form. Ignored if `isEmailRequired` is `true`.
var showEmail = true;

/// Sets the `email` and `name` fields to the corresponding Sentry SDK user fields that were called with `SentrySDK.setUser`.
var useSentryUser = true;

/// Displays the Sentry logo inside the form
var showBranding = true;

/// Displays the capture screenshot button on the feedback form
var showCaptureScreenshot = true;

// Form Labels Configuration

/// The title of the feedback form.
String formTitle = 'Report a Bug';

/// The label of the feedback description input field.
String messageLabel = 'Description';

/// The placeholder in the feedback description input field.
String messagePlaceholder = 'What\'s the bug? What did you expect?';

/// The text to attach to the title label for a required field.
String isRequiredLabel = ' (Required)';

/// The message displayed after a successful feedback submission.
String successMessageText = 'Thank you for your report!';

/// The label next to the name input field.
String nameLabel = 'Name';

/// The placeholder in the name input field.
String namePlaceholder = 'Your Name';

/// The label next to the email input field.
String emailLabel = 'Email';

/// The placeholder in the email input field.
String emailPlaceholder = '[email protected]';

/// The label of the submit button.
String submitButtonLabel = 'Send Bug Report';

/// The label of the cancel button.
String cancelButtonLabel = 'Cancel';

/// The label of the validation error message.
String validationErrorLabel = 'Can\'t be empty';

/// The label of the capture screenshot button.
String captureScreenshotButtonLabel = 'Capture a screenshot';

/// The label of the remove screenshot button.
String removeScreenshotButtonLabel = 'Remove screenshot';

/// The label of the take screenshot button shown outside of the feedback widget.
String takeScreenshotButtonLabel = 'Take Screenshot';
}
Loading
Loading