getsentry / sentry-dart

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

Add screenshot to `SentryFeedbackWidget` #2369

Closed denrase closed 1 month ago

denrase commented 1 month ago

:scroll: Description

Add the option to add a screenshot SentryAttachment to the SentryFeedbackWidget

Bildschirmfoto 2024-10-22 um 17 20 47

:bulb: Motivation and Context

Closes to #1593

:green_heart: How did you test it?

Unit tests, example app.

:pencil: Checklist

github-actions[bot] commented 1 month 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 8d54f663b519a4c903e4bab95b8f90019e07136c

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 52.38095% with 10 lines in your changes missing coverage. Please review.

Project coverage is 84.84%. Comparing base (0479083) to head (8d54f66). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
flutter/lib/src/sentry_flutter.dart 0.00% 10 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2369 +/- ## ========================================== + Coverage 84.78% 84.84% +0.05% ========================================== Files 253 79 -174 Lines 9070 2804 -6266 ========================================== - Hits 7690 2379 -5311 + Misses 1380 425 -955 ```

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

denrase commented 1 month ago

@buenaflor I'm not sure if moving the code that takes the screenshot to the SentryScreenshotWidget is even neccessary, as the user facing API is SentryFlutter.captureFeedback. Pls add ur 2 cents.

github-actions[bot] commented 1 month ago

Android Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 467.14 ms 504.72 ms 37.58 ms
Size 6.49 MiB 7.57 MiB 1.08 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e2d89fc73b84c81801b638f4be7c488d53b7960d 323.84 ms 376.23 ms 52.39 ms
be173fa4303b8b6dbd940568953214b4f5e60992 375.94 ms 458.36 ms 82.42 ms
7b2e0ad54ee7a20e1ca24a40ee897000e52b5ae3 415.59 ms 457.26 ms 41.67 ms
322aa66508dd3f9d0f68edacb140bc1f9f53e3f5 284.98 ms 341.76 ms 56.78 ms
eecbbcabbbe00a5dcc7d42cd6334f771a20b547f 324.37 ms 352.49 ms 28.12 ms
f3a18f2c0b10fa183006697281d9c59440dc6cc6 456.29 ms 504.41 ms 48.12 ms
e0ba81fd379b8bac05a707e1984ed1582520a584 390.38 ms 465.40 ms 75.02 ms
33527b407fa3215a7497a0816c804acd85213992 403.58 ms 507.44 ms 103.86 ms
3334ac176f15a6d39b435960620ea9a4919aae79 303.98 ms 366.65 ms 62.67 ms
5e7abc5157b9e43973db9bc8e2a883d69d3fe136 360.82 ms 401.18 ms 40.37 ms

App size

Revision Plain With Sentry Diff
e2d89fc73b84c81801b638f4be7c488d53b7960d 6.06 MiB 7.03 MiB 989.37 KiB
be173fa4303b8b6dbd940568953214b4f5e60992 6.35 MiB 7.33 MiB 1005.54 KiB
7b2e0ad54ee7a20e1ca24a40ee897000e52b5ae3 6.52 MiB 7.61 MiB 1.08 MiB
322aa66508dd3f9d0f68edacb140bc1f9f53e3f5 5.94 MiB 6.92 MiB 1005.75 KiB
eecbbcabbbe00a5dcc7d42cd6334f771a20b547f 5.94 MiB 6.89 MiB 975.78 KiB
f3a18f2c0b10fa183006697281d9c59440dc6cc6 6.49 MiB 7.57 MiB 1.08 MiB
e0ba81fd379b8bac05a707e1984ed1582520a584 6.52 MiB 7.59 MiB 1.06 MiB
33527b407fa3215a7497a0816c804acd85213992 6.35 MiB 7.42 MiB 1.07 MiB
3334ac176f15a6d39b435960620ea9a4919aae79 6.06 MiB 7.03 MiB 993.54 KiB
5e7abc5157b9e43973db9bc8e2a883d69d3fe136 6.34 MiB 7.28 MiB 966.66 KiB

Previous results on branch: feat/add-screenshot-to-feedback-widget

Startup times

Revision Plain With Sentry Diff
10ecd8ca14cd418e6d536315a96b3dc8a6a50d75 461.74 ms 480.69 ms 18.95 ms
be5c6036f7427c8bf242e45111aae50415cc799f 465.50 ms 505.94 ms 40.44 ms
6a143926225df6d7f0c60b2a54b2461ab7dc4a22 514.13 ms 562.09 ms 47.96 ms

App size

Revision Plain With Sentry Diff
10ecd8ca14cd418e6d536315a96b3dc8a6a50d75 6.49 MiB 7.57 MiB 1.08 MiB
be5c6036f7427c8bf242e45111aae50415cc799f 6.49 MiB 7.57 MiB 1.08 MiB
6a143926225df6d7f0c60b2a54b2461ab7dc4a22 6.49 MiB 7.57 MiB 1.08 MiB
github-actions[bot] commented 1 month ago

iOS Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1216.82 ms 1257.36 ms 40.55 ms
Size 8.38 MiB 9.75 MiB 1.37 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8cb65572208ec7aa2e324de7cc642ae3104da349 1265.14 ms 1266.08 ms 0.94 ms
bc2976867b4472f1f1135d60b70bcca7d4d4eb39 1247.25 ms 1268.63 ms 21.38 ms
3e5078cc0f911ca923a0e1658ba37a2eb28419c6 1239.73 ms 1248.69 ms 8.96 ms
6957bfd77c4a7a9c90276a61f4814f494a146f3e 1283.80 ms 1289.00 ms 5.20 ms
0ceb89ca0b313636a4afdb0f3171e26d89b705e2 1252.02 ms 1271.78 ms 19.75 ms
d883d62345e5c21066faf14885eea7afd75b89e1 1221.39 ms 1230.18 ms 8.80 ms
1d47eb7abe33d581dd45627a4387ea6a5e47cc40 1212.57 ms 1222.00 ms 9.43 ms
21d4150814ba25a944c98452c814af5d9b49ef28 1252.86 ms 1280.55 ms 27.69 ms
6a5a65d1390ef72425d385815fbfb4c1b03ced8d 1237.22 ms 1250.29 ms 13.07 ms
b0811ccc76dccb91004b36b5f710163daf733d92 1238.23 ms 1255.82 ms 17.59 ms

App size

Revision Plain With Sentry Diff
8cb65572208ec7aa2e324de7cc642ae3104da349 8.10 MiB 9.18 MiB 1.08 MiB
bc2976867b4472f1f1135d60b70bcca7d4d4eb39 8.32 MiB 9.38 MiB 1.05 MiB
3e5078cc0f911ca923a0e1658ba37a2eb28419c6 8.28 MiB 9.34 MiB 1.06 MiB
6957bfd77c4a7a9c90276a61f4814f494a146f3e 8.15 MiB 9.15 MiB 1020.71 KiB
0ceb89ca0b313636a4afdb0f3171e26d89b705e2 8.15 MiB 9.12 MiB 989.78 KiB
d883d62345e5c21066faf14885eea7afd75b89e1 8.29 MiB 9.36 MiB 1.07 MiB
1d47eb7abe33d581dd45627a4387ea6a5e47cc40 8.29 MiB 9.39 MiB 1.09 MiB
21d4150814ba25a944c98452c814af5d9b49ef28 8.16 MiB 9.17 MiB 1.01 MiB
6a5a65d1390ef72425d385815fbfb4c1b03ced8d 8.34 MiB 9.65 MiB 1.31 MiB
b0811ccc76dccb91004b36b5f710163daf733d92 8.32 MiB 9.38 MiB 1.06 MiB

Previous results on branch: feat/add-screenshot-to-feedback-widget

Startup times

Revision Plain With Sentry Diff
6a143926225df6d7f0c60b2a54b2461ab7dc4a22 1250.48 ms 1264.91 ms 14.43 ms
be5c6036f7427c8bf242e45111aae50415cc799f 1242.40 ms 1265.90 ms 23.50 ms
10ecd8ca14cd418e6d536315a96b3dc8a6a50d75 1228.69 ms 1242.33 ms 13.63 ms

App size

Revision Plain With Sentry Diff
6a143926225df6d7f0c60b2a54b2461ab7dc4a22 8.38 MiB 9.75 MiB 1.37 MiB
be5c6036f7427c8bf242e45111aae50415cc799f 8.38 MiB 9.75 MiB 1.37 MiB
10ecd8ca14cd418e6d536315a96b3dc8a6a50d75 8.38 MiB 9.75 MiB 1.37 MiB
buenaflor commented 1 month ago

I'm not sure if moving the code that takes the screenshot to the SentryScreenshotWidget is even neccessary, as the user facing API is SentryFlutter.captureFeedback. Pls add ur 2 cents.

Can we keep it in the event processor but still capture the correct screen?

How does the JS user feedback behave in comparison

bruno-garcia commented 3 weeks ago

Let me start with: Thanks! Love this!

Is this on the docs? Does it support desktop and mobile? (rather: which platforms does it support?

We'd like to tell a holistic story about our feedback product and capabilities, and include all mobile support. @armcknight added support for iOS, and @romtsn had a PR for Android. More SDKs will come.

cc @jas-kas PM of User Feedback