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

feat: Feedback Widget for React Native #4435

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft

feat: Feedback Widget for React Native #4435

wants to merge 22 commits into from

Conversation

antonis
Copy link
Collaborator

@antonis antonis commented Jan 10, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This PR contains reviewed PRs for the feedback widget:

Documentation

💡 Motivation and Context

Fixes #4302

💚 How did you test it?

CI and manual testing of individual PRs

📝 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

* Update the client implementation to use the new capture feedback js api

* Updates SDK API

* Adds new feedback button in the sample

* Adds changelog

* Removes unused mock

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Directly use captureFeedback from sentry/core

* Use import from core

* Fixes imports order lint issue

* Fixes build issue

* Adds captureFeedback tests from sentry-javascript

* Update CHANGELOG.md

* Only deprecate client captureUserFeedback

* Add simple form UI

* Adds basic form functionality

* Update imports

* Update imports

* Remove useState hook to avoid multiple react instances issues

* Move types and styles in different files

* Removes attachment button to be added back separately along with the implementation

* Add basic field validation

* Adds changelog

* Updates changelog

* Updates changelog

* Trim whitespaces from the submitted feedback

* Adds tests

* Renames FeedbackFormScreen to FeedbackForm

* Add beta label

* Extract default text to constants

* Moves constant to a separate file and aligns naming with JS

* Adds input text labels

* Close screen before sending the feedback to minimise wait time

Co-authored-by: LucasZF <[email protected]>

* Rename file for consistency

* Flatten configuration hierarchy and clean up

* Align required values with JS

* Use Sentry user email and name when set

* Simplifies email validation

* Show success alert message

* Aligns naming with JS and unmounts the form by default

* Use the minimum config without props in the changelog

* Adds development not for unimplemented function

* Show email and name conditionally

* Adds sentry branding (png logo)

* Adds sentry logo resource

* Add assets in module exports

* Revert "Add assets in module exports"

This reverts commit 5292475.

* Revert "Adds sentry logo resource"

This reverts commit d6e9229.

* Revert "Adds sentry branding (png logo)"

This reverts commit 8c56753.

* Add last event id

* Mock lastEventId

* Adds beta note in the changelog

* Updates changelog

* Align colors with JS

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Use regular fonts for both buttons

* Handle keyboard properly

* Adds an option on whether the email should be validated

* Merge properties only once

* Loads current user data on form construction

* Remove unneeded extra padding

* Fix background color issue

* Fixes changelog typo

* Updates styles background color

Co-authored-by: Krystof Woldrich <[email protected]>

* Use defaultProps

* Correct defaultProps

* Adds test to verify when getUser is called

* (2.2) feat: Add Feedback Form UI Branding logo (#4357)

* Adds sentry branding logo as a base64 encoded png

---------

Co-authored-by: LucasZF <[email protected]>

* Autoinject feedback form (#4370)

* Align changelog entry

* Update changelog

* Revert "Autoinject feedback form (#4370)"

This reverts commit da0e3ea.

---------

Co-authored-by: Krystof Woldrich <[email protected]>
Co-authored-by: LucasZF <[email protected]>
Copy link
Contributor

github-actions bot commented Jan 10, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 22cde46

@antonis antonis mentioned this pull request Jan 10, 2025
10 tasks
@antonis antonis changed the title Feedback Widget for React Native feat: Feedback Widget for React Native Jan 10, 2025
Copy link
Contributor

github-actions bot commented Jan 10, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 477.62 ms 491.63 ms 14.00 ms
Size 17.75 MiB 20.12 MiB 2.37 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
416f465 446.96 ms 454.22 ms 7.26 ms
e4d9fe0 416.82 ms 435.54 ms 18.73 ms
9672577 416.34 ms 421.26 ms 4.92 ms
d43a46b 454.22 ms 477.79 ms 23.57 ms
b1e8712 462.11 ms 465.71 ms 3.60 ms
5dff5ee 462.32 ms 456.26 ms -6.06 ms
b95b8af 454.05 ms 454.53 ms 0.48 ms
52a8031+dirty 311.55 ms 321.37 ms 9.82 ms
5446992 403.40 ms 426.70 ms 23.30 ms
d361d38 354.10 ms 381.69 ms 27.59 ms

App size

Revision Plain With Sentry Diff
416f465 17.74 MiB 20.09 MiB 2.35 MiB
e4d9fe0 17.75 MiB 20.11 MiB 2.36 MiB
9672577 17.75 MiB 20.11 MiB 2.36 MiB
d43a46b 17.73 MiB 20.06 MiB 2.33 MiB
b1e8712 17.73 MiB 19.75 MiB 2.02 MiB
5dff5ee 17.75 MiB 20.11 MiB 2.36 MiB
b95b8af 17.73 MiB 20.11 MiB 2.37 MiB
52a8031+dirty 17.73 MiB 20.04 MiB 2.31 MiB
5446992 17.73 MiB 19.85 MiB 2.12 MiB
d361d38 17.73 MiB 19.81 MiB 2.08 MiB

Previous results on branch: feedback-ui

Startup times

Revision Plain With Sentry Diff
6b1624f 462.78 ms 465.13 ms 2.35 ms
3e4cdf5 462.35 ms 474.96 ms 12.61 ms
e5d5735 452.70 ms 453.04 ms 0.34 ms
0459aee 491.48 ms 486.13 ms -5.35 ms
9402883 448.53 ms 468.73 ms 20.20 ms
894ebb0 497.45 ms 545.04 ms 47.60 ms
0325426 477.32 ms 457.43 ms -19.89 ms
269c976 448.08 ms 428.86 ms -19.22 ms
2646c98 429.98 ms 421.63 ms -8.35 ms
8cb898b 438.83 ms 420.58 ms -18.25 ms

App size

Revision Plain With Sentry Diff
6b1624f 17.75 MiB 20.12 MiB 2.37 MiB
3e4cdf5 17.75 MiB 20.12 MiB 2.37 MiB
e5d5735 17.75 MiB 20.12 MiB 2.37 MiB
0459aee 17.75 MiB 20.12 MiB 2.37 MiB
9402883 17.75 MiB 20.12 MiB 2.37 MiB
894ebb0 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
2646c98 17.75 MiB 20.12 MiB 2.37 MiB
8cb898b 17.75 MiB 20.12 MiB 2.37 MiB

Copy link
Contributor

github-actions bot commented Jan 10, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 395.08 ms 430.38 ms 35.30 ms
Size 7.15 MiB 8.39 MiB 1.23 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
baa882f+dirty 449.30 ms 540.40 ms 91.10 ms
7f6950b+dirty 432.72 ms 476.91 ms 44.19 ms
8d251c2+dirty 376.67 ms 417.91 ms 41.24 ms
4a6664f+dirty 357.02 ms 394.91 ms 37.89 ms
4161236+dirty 429.89 ms 498.74 ms 68.85 ms
31fcca2+dirty 366.64 ms 395.78 ms 29.14 ms
e4d9fe0+dirty 368.38 ms 415.44 ms 47.05 ms
75774ea+dirty 426.80 ms 455.43 ms 28.62 ms
76d1baf+dirty 339.02 ms 408.65 ms 69.63 ms
a5d86e1+dirty 380.86 ms 466.42 ms 85.56 ms

App size

Revision Plain With Sentry Diff
baa882f+dirty 7.15 MiB 8.34 MiB 1.19 MiB
7f6950b+dirty 7.15 MiB 8.37 MiB 1.22 MiB
8d251c2+dirty 7.15 MiB 8.38 MiB 1.23 MiB
4a6664f+dirty 7.15 MiB 8.22 MiB 1.07 MiB
4161236+dirty 7.15 MiB 8.38 MiB 1.23 MiB
31fcca2+dirty 7.15 MiB 8.18 MiB 1.03 MiB
e4d9fe0+dirty 7.15 MiB 8.38 MiB 1.23 MiB
75774ea+dirty 7.15 MiB 8.36 MiB 1.21 MiB
76d1baf+dirty 7.15 MiB 8.09 MiB 964.41 KiB
a5d86e1+dirty 7.15 MiB 8.35 MiB 1.20 MiB

Previous results on branch: feedback-ui

Startup times

Revision Plain With Sentry Diff
0325426+dirty 418.89 ms 485.00 ms 66.11 ms
894ebb0+dirty 417.81 ms 499.74 ms 81.93 ms
269c976+dirty 395.13 ms 438.37 ms 43.24 ms
8cb898b+dirty 393.33 ms 416.20 ms 22.87 ms
9402883+dirty 436.49 ms 518.94 ms 82.45 ms
0459aee+dirty 424.10 ms 466.63 ms 42.53 ms
2646c98+dirty 415.13 ms 438.41 ms 23.28 ms
e5d5735+dirty 377.37 ms 430.04 ms 52.67 ms
3e4cdf5+dirty 642.13 ms 702.23 ms 60.10 ms
6b1624f+dirty 382.17 ms 441.00 ms 58.83 ms

App size

Revision Plain With Sentry Diff
0325426+dirty 7.15 MiB 8.38 MiB 1.23 MiB
894ebb0+dirty 7.15 MiB 8.39 MiB 1.23 MiB
269c976+dirty 7.15 MiB 8.39 MiB 1.23 MiB
8cb898b+dirty 7.15 MiB 8.39 MiB 1.24 MiB
9402883+dirty 7.15 MiB 8.39 MiB 1.23 MiB
0459aee+dirty 7.15 MiB 8.38 MiB 1.23 MiB
2646c98+dirty 7.15 MiB 8.38 MiB 1.23 MiB
e5d5735+dirty 7.15 MiB 8.39 MiB 1.23 MiB
3e4cdf5+dirty 7.15 MiB 8.39 MiB 1.23 MiB
6b1624f+dirty 7.15 MiB 8.39 MiB 1.23 MiB

Copy link
Contributor

github-actions bot commented Jan 10, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1209.92 ms 1216.55 ms 6.63 ms
Size 2.63 MiB 3.71 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d361d38+dirty 1246.04 ms 1267.12 ms 21.08 ms
cdf2f33+dirty 1227.71 ms 1233.94 ms 6.22 ms
cdf2bdf+dirty 1230.10 ms 1238.08 ms 7.98 ms
9672577+dirty 1230.46 ms 1237.43 ms 6.97 ms
40c35c5+dirty 1211.31 ms 1217.71 ms 6.40 ms
7f6950b+dirty 1235.53 ms 1227.30 ms -8.23 ms
c398f67+dirty 1219.67 ms 1225.66 ms 5.99 ms
c6f01ea+dirty 1227.10 ms 1235.35 ms 8.24 ms
13f280b+dirty 1229.25 ms 1226.10 ms -3.15 ms
d7401ac+dirty 1252.38 ms 1275.04 ms 22.66 ms

App size

Revision Plain With Sentry Diff
d361d38+dirty 2.36 MiB 2.85 MiB 499.84 KiB
cdf2f33+dirty 2.36 MiB 3.10 MiB 751.38 KiB
cdf2bdf+dirty 2.36 MiB 3.12 MiB 779.40 KiB
9672577+dirty 2.63 MiB 3.70 MiB 1.06 MiB
40c35c5+dirty 2.63 MiB 3.70 MiB 1.07 MiB
7f6950b+dirty 2.36 MiB 3.11 MiB 760.04 KiB
c398f67+dirty 2.36 MiB 3.04 MiB 696.27 KiB
c6f01ea+dirty 2.36 MiB 3.12 MiB 778.61 KiB
13f280b+dirty 2.36 MiB 3.10 MiB 753.43 KiB
d7401ac+dirty 2.36 MiB 2.83 MiB 481.14 KiB

Previous results on branch: feedback-ui

Startup times

Revision Plain With Sentry Diff
9402883+dirty 1219.65 ms 1217.94 ms -1.72 ms
894ebb0+dirty 1224.33 ms 1214.45 ms -9.89 ms
3e4cdf5+dirty 1222.53 ms 1224.42 ms 1.89 ms
8cb898b+dirty 1221.40 ms 1231.78 ms 10.37 ms
2646c98+dirty 1218.51 ms 1218.92 ms 0.41 ms
6b1624f+dirty 1224.65 ms 1225.65 ms 1.00 ms
0459aee+dirty 1232.82 ms 1231.19 ms -1.63 ms
0325426+dirty 1228.88 ms 1229.92 ms 1.04 ms
e5d5735+dirty 1222.02 ms 1222.22 ms 0.20 ms
269c976+dirty 1210.02 ms 1204.46 ms -5.56 ms

App size

Revision Plain With Sentry Diff
9402883+dirty 2.63 MiB 3.71 MiB 1.07 MiB
894ebb0+dirty 2.63 MiB 3.71 MiB 1.07 MiB
3e4cdf5+dirty 2.63 MiB 3.69 MiB 1.06 MiB
8cb898b+dirty 2.63 MiB 3.71 MiB 1.08 MiB
2646c98+dirty 2.63 MiB 3.69 MiB 1.06 MiB
6b1624f+dirty 2.63 MiB 3.71 MiB 1.07 MiB
0459aee+dirty 2.63 MiB 3.69 MiB 1.06 MiB
0325426+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

Copy link
Contributor

github-actions bot commented Jan 10, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1221.14 ms 1216.60 ms -4.55 ms
Size 3.19 MiB 4.27 MiB 1.09 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d361d38+dirty 1272.96 ms 1291.70 ms 18.74 ms
cdf2f33+dirty 1210.00 ms 1218.50 ms 8.50 ms
cdf2bdf+dirty 1237.04 ms 1237.86 ms 0.82 ms
9672577+dirty 1215.21 ms 1214.08 ms -1.13 ms
40c35c5+dirty 1223.90 ms 1217.19 ms -6.71 ms
7f6950b+dirty 1250.94 ms 1252.92 ms 1.98 ms
c398f67+dirty 1227.31 ms 1230.00 ms 2.69 ms
c6f01ea+dirty 1229.52 ms 1237.16 ms 7.64 ms
13f280b+dirty 1217.73 ms 1229.08 ms 11.35 ms
d7401ac+dirty 1288.10 ms 1289.54 ms 1.44 ms

App size

Revision Plain With Sentry Diff
d361d38+dirty 2.92 MiB 3.41 MiB 503.57 KiB
cdf2f33+dirty 2.92 MiB 3.66 MiB 755.50 KiB
cdf2bdf+dirty 2.92 MiB 3.69 MiB 790.57 KiB
9672577+dirty 3.19 MiB 4.26 MiB 1.08 MiB
40c35c5+dirty 3.19 MiB 4.27 MiB 1.08 MiB
7f6950b+dirty 2.92 MiB 3.67 MiB 772.53 KiB
c398f67+dirty 2.92 MiB 3.60 MiB 701.89 KiB
c6f01ea+dirty 2.92 MiB 3.69 MiB 789.94 KiB
13f280b+dirty 2.92 MiB 3.66 MiB 758.67 KiB
d7401ac+dirty 2.92 MiB 3.40 MiB 488.06 KiB

Previous results on branch: feedback-ui

Startup times

Revision Plain With Sentry Diff
9402883+dirty 1217.71 ms 1213.02 ms -4.69 ms
894ebb0+dirty 1210.94 ms 1202.08 ms -8.85 ms
3e4cdf5+dirty 1213.36 ms 1221.31 ms 7.95 ms
8cb898b+dirty 1209.39 ms 1207.57 ms -1.82 ms
2646c98+dirty 1239.94 ms 1246.90 ms 6.96 ms
6b1624f+dirty 1224.12 ms 1220.73 ms -3.39 ms
0459aee+dirty 1233.67 ms 1239.80 ms 6.12 ms
0325426+dirty 1210.17 ms 1216.37 ms 6.20 ms
e5d5735+dirty 1217.78 ms 1221.80 ms 4.02 ms
269c976+dirty 1223.29 ms 1222.90 ms -0.39 ms

App size

Revision Plain With Sentry Diff
9402883+dirty 3.19 MiB 4.27 MiB 1.09 MiB
894ebb0+dirty 3.19 MiB 4.27 MiB 1.09 MiB
3e4cdf5+dirty 3.19 MiB 4.26 MiB 1.07 MiB
8cb898b+dirty 3.19 MiB 4.28 MiB 1.09 MiB
2646c98+dirty 3.19 MiB 4.26 MiB 1.07 MiB
6b1624f+dirty 3.19 MiB 4.27 MiB 1.09 MiB
0459aee+dirty 3.19 MiB 4.26 MiB 1.07 MiB
0325426+dirty 3.19 MiB 4.26 MiB 1.07 MiB
e5d5735+dirty 3.19 MiB 4.26 MiB 1.07 MiB
269c976+dirty 3.19 MiB 4.26 MiB 1.07 MiB

antonis and others added 11 commits January 14, 2025 11:00
* Update the client implementation to use the new capture feedback js api

* Updates SDK API

* Adds new feedback button in the sample

* Adds changelog

* Removes unused mock

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Directly use captureFeedback from sentry/core

* Use import from core

* Fixes imports order lint issue

* Fixes build issue

* Adds captureFeedback tests from sentry-javascript

* Update CHANGELOG.md

* Only deprecate client captureUserFeedback

* Add simple form UI

* Adds basic form functionality

* Update imports

* Update imports

* Remove useState hook to avoid multiple react instances issues

* Move types and styles in different files

* Removes attachment button to be added back separately along with the implementation

* Add basic field validation

* Adds changelog

* Updates changelog

* Updates changelog

* Trim whitespaces from the submitted feedback

* Adds tests

* Adds attachment button UI

* Adds changelog

* Add attachment handling based on the client implementation

* Reduce render method complexity

* Adds test for attachment button visibility

* Format code

* Pick image with react-native-image-picker

* Convert base64 string to Uint8Array before sending

* Updates changelog

* Renames FeedbackFormScreen to FeedbackForm

* Add beta label

* Extract default text to constants

* Moves constant to a separate file and aligns naming with JS

* Adds input text labels

* Close screen before sending the feedback to minimise wait time

Co-authored-by: LucasZF <[email protected]>

* Rename file for consistency

* Flatten configuration hierarchy and clean up

* Align required values with JS

* Use Sentry user email and name when set

* Simplifies email validation

* Show success alert message

* Aligns naming with JS and unmounts the form by default

* Use the minimum config without props in the changelog

* Adds development not for unimplemented function

* Show email and name conditionally

* Adds sentry branding (png logo)

* Adds sentry logo resource

* Add assets in module exports

* Revert "Add assets in module exports"

This reverts commit 5292475.

* Revert "Adds sentry logo resource"

This reverts commit d6e9229.

* Revert "Adds sentry branding (png logo)"

This reverts commit 8c56753.

* Add last event id

* Mock lastEventId

* Remove changelog

* Reverse unrelated change

* Adds beta note in the changelog

* Updates changelog

* Align colors with JS

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Use regular fonts for both buttons

* Handle keyboard properly

* Adds an option on whether the email should be validated

* Merge properties only once

* Loads current user data on form construction

* Remove unneeded extra padding

* Fix background color issue

* Fixes changelog typo

* Updates styles background color

Co-authored-by: Krystof Woldrich <[email protected]>

* Use defaultProps

* Correct defaultProps

* Adds test to verify when getUser is called

* Add default value in doc comment

Co-authored-by: LucasZF <[email protected]>

* Add a more clear doc comment

Co-authored-by: LucasZF <[email protected]>

* (2.2) feat: Add Feedback Form UI Branding logo (#4357)

* Adds sentry branding logo as a base64 encoded png

---------

Co-authored-by: LucasZF <[email protected]>

* Autoinject feedback form (#4370)

* Align changelog entry

* Update changelog

* Use AddScreenshot naming

* Allow only Uint8Array for screenshots

* Rename callback parameter

* Adds snapshot tests for screenshot button

* Rename screenshot button for clarity

* Use a library to get the Uint8Array

---------

Co-authored-by: Krystof Woldrich <[email protected]>
Co-authored-by: LucasZF <[email protected]>
# Conflicts:
#	CHANGELOG.md
* Auto-inject feedback form

* Temporarily disable sample rotating indicator

* Revert "Temporarily disable sample rotating indicator"

This reverts commit db407ce.

* Wrap Modal in a View

* Handles Android back button

* Make modal style configurable

* Print an error when the modal is not supported

* Add changelog

* Adds tests

* Get major, minor version with deconstruct declaration

Co-authored-by: LucasZF <[email protected]>

* Remove if condition

Co-authored-by: LucasZF <[email protected]>

* Prettier

* Fix test import

---------

Co-authored-by: LucasZF <[email protected]>
@antonis antonis mentioned this pull request Jan 30, 2025
10 tasks
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.

[EPIC] Feedback Widget for React Native
1 participant