getsentry / sentry-dart

Sentry SDK for Dart and Flutter
https://sentry.io/for/flutter/
MIT License
754 stars 237 forks source link

Add `SentryFeedbackWidget` #2240

Closed denrase closed 1 month ago

denrase commented 2 months ago

:scroll: Description

Feedback Widget
feedback

:bulb: Motivation and Context

Relates to #1593

:green_heart: How did you test it?

:pencil: Checklist

:crystal_ball: Next steps

With sentry-javascrip we can also add a screenshot of the browser window as an attachment. What makes sense here?

github-actions[bot] commented 2 months ago
Messages
:book: Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by :no_entry_sign: dangerJS against 9645324a7e60b16ac2165498279e65bb504d03c7

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 95.91837% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.92%. Comparing base (55c6870) to head (9645324). Report is 1 commits behind head on feat/capture-feedback.

Files with missing lines Patch % Lines
...utter/lib/src/feedback/sentry_feedback_widget.dart 95.91% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## feat/capture-feedback #2240 +/- ## ========================================================= + Coverage 88.03% 90.92% +2.88% ========================================================= Files 248 74 -174 Lines 8653 2468 -6185 ========================================================= - Hits 7618 2244 -5374 + Misses 1035 224 -811 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ueman commented 2 months ago

With sentry-javascrip we can also add a screenshot of the browser window as an attachment. What makes sense here?

Maybe the screenshot can be taken right before the feedback form is triggered?

It could work something like this:

Future<void> showSentryFeedbackForm(BuildContext context) {
  await takeScreenshot();
  await Navigator.push(
    context,
    MaterialPageRoute(
      builder: (context) => SentryFeedbackWidget(associatedEventId: id),
      fullscreenDialog: true,
    ),
  );
}

This follows the patter as to what Flutter provides out of the box with showDialog(), showBottomSheet() etc.

I doubt it's possible to do while the feedback from is active, since the form would be captured by the screenshot widget too.

buenaflor commented 2 months ago

With sentry-javascript we can also add a screenshot of the browser window as an attachment

afaik js browser sdk doesn't support screenshots, don't we support screenshot on web anyway?

denrase commented 1 month ago

@ueman I will merge this PR into the other. Let's tackle auto-screenshots in another PR.