Skip to content
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

Autoinject feedback widget #4483

Merged
merged 14 commits into from
Jan 29, 2025
Merged

Autoinject feedback widget #4483

merged 14 commits into from
Jan 29, 2025

Conversation

antonis
Copy link
Collaborator

@antonis antonis commented Jan 23, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds Sentry.showFeedbackForm() method that presents the feedback form in a Modal.

💡 Motivation and Context

Part of #4302

💚 How did you test it?

Manual, CI

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

#skip-changelog

Copy link
Contributor

github-actions bot commented Jan 23, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 457.52 ms 485.24 ms 27.72 ms
Size 17.75 MiB 20.12 MiB 2.37 MiB

Baseline results on branch: feedback-ui

Startup times

Revision Plain With Sentry Diff
e5d5735 452.70 ms 453.04 ms 0.34 ms
0459aee 491.48 ms 486.13 ms -5.35 ms
2646c98 429.98 ms 421.63 ms -8.35 ms
3e4cdf5 462.35 ms 474.96 ms 12.61 ms
0325426 477.32 ms 457.43 ms -19.89 ms
269c976 448.08 ms 428.86 ms -19.22 ms

App size

Revision Plain With Sentry Diff
e5d5735 17.75 MiB 20.12 MiB 2.37 MiB
0459aee 17.75 MiB 20.12 MiB 2.37 MiB
2646c98 17.75 MiB 20.12 MiB 2.37 MiB
3e4cdf5 17.75 MiB 20.12 MiB 2.37 MiB
0325426 17.75 MiB 20.12 MiB 2.37 MiB
269c976 17.75 MiB 20.12 MiB 2.37 MiB

Previous results on branch: antonis/feedback-autoinject

Startup times

Revision Plain With Sentry Diff
87cfc87 429.98 ms 435.54 ms 5.56 ms

App size

Revision Plain With Sentry Diff
87cfc87 17.75 MiB 20.12 MiB 2.37 MiB

Copy link
Contributor

github-actions bot commented Jan 23, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1237.16 ms 1229.56 ms -7.60 ms
Size 2.63 MiB 3.70 MiB 1.06 MiB

Baseline results on branch: feedback-ui

Startup times

Revision Plain With Sentry Diff
2646c98+dirty 1218.51 ms 1218.92 ms 0.41 ms
3e4cdf5+dirty 1222.53 ms 1224.42 ms 1.89 ms
e5d5735+dirty 1222.02 ms 1222.22 ms 0.20 ms
269c976+dirty 1210.02 ms 1204.46 ms -5.56 ms
0325426+dirty 1228.88 ms 1229.92 ms 1.04 ms
0459aee+dirty 1232.82 ms 1231.19 ms -1.63 ms

App size

Revision Plain With Sentry Diff
2646c98+dirty 2.63 MiB 3.69 MiB 1.06 MiB
3e4cdf5+dirty 2.63 MiB 3.69 MiB 1.06 MiB
e5d5735+dirty 2.63 MiB 3.69 MiB 1.06 MiB
269c976+dirty 2.63 MiB 3.69 MiB 1.06 MiB
0325426+dirty 2.63 MiB 3.69 MiB 1.06 MiB
0459aee+dirty 2.63 MiB 3.69 MiB 1.06 MiB

Previous results on branch: antonis/feedback-autoinject

Startup times

Revision Plain With Sentry Diff
87cfc87+dirty 1221.21 ms 1222.85 ms 1.64 ms

App size

Revision Plain With Sentry Diff
87cfc87+dirty 2.63 MiB 3.69 MiB 1.06 MiB

Copy link
Contributor

github-actions bot commented Jan 23, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 370.12 ms 415.44 ms 45.32 ms
Size 7.15 MiB 8.39 MiB 1.23 MiB

Baseline results on branch: feedback-ui

Startup times

Revision Plain With Sentry Diff
269c976+dirty 395.13 ms 438.37 ms 43.24 ms
e5d5735+dirty 377.37 ms 430.04 ms 52.67 ms
0325426+dirty 418.89 ms 485.00 ms 66.11 ms
0459aee+dirty 424.10 ms 466.63 ms 42.53 ms
3e4cdf5+dirty 642.13 ms 702.23 ms 60.10 ms
2646c98+dirty 415.13 ms 438.41 ms 23.28 ms

App size

Revision Plain With Sentry Diff
269c976+dirty 7.15 MiB 8.39 MiB 1.23 MiB
e5d5735+dirty 7.15 MiB 8.39 MiB 1.23 MiB
0325426+dirty 7.15 MiB 8.38 MiB 1.23 MiB
0459aee+dirty 7.15 MiB 8.38 MiB 1.23 MiB
3e4cdf5+dirty 7.15 MiB 8.39 MiB 1.23 MiB
2646c98+dirty 7.15 MiB 8.38 MiB 1.23 MiB

Previous results on branch: antonis/feedback-autoinject

Startup times

Revision Plain With Sentry Diff
87cfc87+dirty 390.11 ms 422.92 ms 32.81 ms

App size

Revision Plain With Sentry Diff
87cfc87+dirty 7.15 MiB 8.39 MiB 1.23 MiB

Copy link
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1211.35 ms 1216.47 ms 5.12 ms
Size 3.19 MiB 4.26 MiB 1.07 MiB

Baseline results on branch: feedback-ui

Startup times

Revision Plain With Sentry Diff
269c976+dirty 1223.29 ms 1222.90 ms -0.39 ms
0459aee+dirty 1233.67 ms 1239.80 ms 6.12 ms
0325426+dirty 1210.17 ms 1216.37 ms 6.20 ms
2646c98+dirty 1239.94 ms 1246.90 ms 6.96 ms
e5d5735+dirty 1217.78 ms 1221.80 ms 4.02 ms

App size

Revision Plain With Sentry Diff
269c976+dirty 3.19 MiB 4.26 MiB 1.07 MiB
0459aee+dirty 3.19 MiB 4.26 MiB 1.07 MiB
0325426+dirty 3.19 MiB 4.26 MiB 1.07 MiB
2646c98+dirty 3.19 MiB 4.26 MiB 1.07 MiB
e5d5735+dirty 3.19 MiB 4.26 MiB 1.07 MiB

@krystofwoldrich
Copy link
Member

I know this is still a draft, but after the modal is working let's add a test for the public function to ensure calling it displays the form when provider is used and doesn't throw error when provider is not used.

@krystofwoldrich
Copy link
Member

We should also enable users to change the forms options/props. Similar to JS setting them in the integration options feedbackIntegration({}). But that can be a follow up PR to keep this consise.

@krystofwoldrich
Copy link
Member

Modal is implemented in the legacy architecture for all versions the SDK supports.

But for new architecture only for RN 0.71 and up -> facebook/react-native#33652 (comment)

I think we could print error when we notice RN 0.70 and older and Fabric renderer (new arch).

I'm also adding this comment so we include this information in the docs.

@antonis
Copy link
Collaborator Author

antonis commented Jan 27, 2025

Thank you for bringing this to my attention @krystofwoldrich 🙇

I think we could print error when we notice RN 0.70 and older and Fabric renderer (new arch).

I've added a check with 84108f1

@antonis
Copy link
Collaborator Author

antonis commented Jan 27, 2025

Thank you for your help and feedback @krystofwoldrich 🙇

I know this is still a draft, but after the modal is working let's add a test for the public function to ensure calling it displays the form when provider is used and doesn't throw error when provider is not used.

Added tests with f4df57c

We should also enable users to change the forms options/props. Similar to JS setting them in the integration options feedbackIntegration({}). But that can be a follow up PR to keep this consise.

Makes sense 👍 I'll follow up with a separate PR for this.

@antonis antonis marked this pull request as ready for review January 27, 2025 11:52
Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the PR Looks good! Added a few suggestions but they are non-blocking


describe('FeedbackFormManager', () => {
it('showFeedbackForm displays the form when FeedbackFormProvider is used', () => {
require('../../src/js/feedback/utils').isModalSupported.mockReturnValue(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: import { isModalSupported } from ''../../src/js/feedback/utils''; and then (isModalSupported as jest.MockedFunction<typeof isModalSupported>) should also work and it will be typesafe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea Krystof 👍
Updated with d8ab914

Copy link
Member

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Looks good.

I left one small TS improvement comment in the test file.

@antonis antonis merged commit eda1cb7 into feedback-ui Jan 29, 2025
64 of 66 checks passed
@antonis antonis deleted the antonis/feedback-autoinject branch January 29, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants