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 16 commits into
base: main
Choose a base branch
from
Draft

feat: Feedback Widget for React Native #4435

wants to merge 16 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 dbdfceb

@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 438.83 ms 420.58 ms -18.25 ms
Size 17.75 MiB 20.12 MiB 2.37 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
31fcca2 391.22 ms 414.78 ms 23.56 ms
ee4aab8 418.63 ms 435.63 ms 17.01 ms
86d6d2c+dirty 332.90 ms 352.45 ms 19.55 ms
eb1e19f 433.55 ms 444.90 ms 11.35 ms
80b2ce3 385.02 ms 387.36 ms 2.34 ms
9f0f6c8 433.91 ms 429.16 ms -4.75 ms
dadc233+dirty 333.78 ms 343.94 ms 10.16 ms
3853f43 329.68 ms 346.32 ms 16.64 ms
1c9e040 325.02 ms 311.57 ms -13.45 ms
457e29f 398.10 ms 421.39 ms 23.29 ms

App size

Revision Plain With Sentry Diff
31fcca2 17.73 MiB 19.90 MiB 2.17 MiB
ee4aab8 17.75 MiB 20.11 MiB 2.37 MiB
86d6d2c+dirty 17.73 MiB 20.04 MiB 2.31 MiB
eb1e19f 17.74 MiB 20.08 MiB 2.34 MiB
80b2ce3 17.73 MiB 19.75 MiB 2.02 MiB
9f0f6c8 17.74 MiB 20.08 MiB 2.35 MiB
dadc233+dirty 17.73 MiB 19.75 MiB 2.02 MiB
3853f43 17.73 MiB 19.81 MiB 2.08 MiB
1c9e040 17.75 MiB 20.11 MiB 2.37 MiB
457e29f 17.73 MiB 19.84 MiB 2.10 MiB

Previous 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

Copy link
Contributor

github-actions bot commented Jan 10, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 393.33 ms 416.20 ms 22.87 ms
Size 7.15 MiB 8.39 MiB 1.24 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e73d82f+dirty 377.67 ms 407.06 ms 29.39 ms
e22745e+dirty 415.50 ms 448.76 ms 33.26 ms
76d1baf+dirty 339.02 ms 408.65 ms 69.63 ms
3aecc61+dirty 375.18 ms 442.58 ms 67.40 ms
cdf2bdf+dirty 391.69 ms 461.14 ms 69.45 ms
5a22220+dirty 384.61 ms 419.06 ms 34.45 ms
c639edf+dirty 363.39 ms 414.78 ms 51.39 ms
57448c5+dirty 397.05 ms 462.65 ms 65.60 ms
27ef4ee+dirty 296.71 ms 351.00 ms 54.29 ms
ae7b03d+dirty 403.26 ms 456.78 ms 53.52 ms

App size

Revision Plain With Sentry Diff
e73d82f+dirty 7.15 MiB 8.34 MiB 1.19 MiB
e22745e+dirty 7.15 MiB 8.35 MiB 1.20 MiB
76d1baf+dirty 7.15 MiB 8.09 MiB 964.41 KiB
3aecc61+dirty 7.15 MiB 8.38 MiB 1.23 MiB
cdf2bdf+dirty 7.15 MiB 8.38 MiB 1.23 MiB
5a22220+dirty 7.15 MiB 8.21 MiB 1.06 MiB
c639edf+dirty 7.15 MiB 8.35 MiB 1.20 MiB
57448c5+dirty 7.15 MiB 8.35 MiB 1.20 MiB
27ef4ee+dirty 7.15 MiB 8.08 MiB 959.49 KiB
ae7b03d+dirty 7.15 MiB 8.38 MiB 1.23 MiB

Previous 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

Copy link
Contributor

github-actions bot commented Jan 10, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1221.40 ms 1231.78 ms 10.37 ms
Size 2.63 MiB 3.71 MiB 1.08 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0ebca77+dirty 1220.75 ms 1222.81 ms 2.06 ms
8ae23a7+dirty 1230.02 ms 1227.62 ms -2.40 ms
18ce5e8+dirty 1247.78 ms 1242.85 ms -4.92 ms
9385d74+dirty 1215.18 ms 1216.43 ms 1.25 ms
b6f8ea2+dirty 1236.08 ms 1228.58 ms -7.50 ms
d8e8c67+dirty 1222.57 ms 1226.22 ms 3.65 ms
f54118b+dirty 1232.98 ms 1235.73 ms 2.76 ms
ae7b03d+dirty 1221.19 ms 1224.69 ms 3.50 ms
3261206+dirty 1219.49 ms 1224.10 ms 4.61 ms
6e8584e+dirty 1274.50 ms 1296.82 ms 22.32 ms

App size

Revision Plain With Sentry Diff
0ebca77+dirty 2.36 MiB 3.04 MiB 698.33 KiB
8ae23a7+dirty 2.36 MiB 3.10 MiB 752.42 KiB
18ce5e8+dirty 2.36 MiB 3.12 MiB 778.65 KiB
9385d74+dirty 2.36 MiB 3.10 MiB 759.78 KiB
b6f8ea2+dirty 2.63 MiB 3.68 MiB 1.05 MiB
d8e8c67+dirty 2.36 MiB 3.12 MiB 779.40 KiB
f54118b+dirty 2.36 MiB 3.10 MiB 757.51 KiB
ae7b03d+dirty 2.63 MiB 3.69 MiB 1.05 MiB
3261206+dirty 2.63 MiB 3.69 MiB 1.06 MiB
6e8584e+dirty 2.36 MiB 2.88 MiB 533.17 KiB

Previous 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

Copy link
Contributor

github-actions bot commented Jan 10, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1209.39 ms 1207.57 ms -1.82 ms
Size 3.19 MiB 4.28 MiB 1.09 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0ebca77+dirty 1209.30 ms 1220.33 ms 11.03 ms
8ae23a7+dirty 1233.67 ms 1229.52 ms -4.15 ms
18ce5e8+dirty 1244.67 ms 1242.96 ms -1.72 ms
9385d74+dirty 1239.51 ms 1245.88 ms 6.37 ms
b6f8ea2+dirty 1254.10 ms 1236.67 ms -17.43 ms
d8e8c67+dirty 1235.58 ms 1233.44 ms -2.15 ms
f54118b+dirty 1235.42 ms 1236.80 ms 1.38 ms
ae7b03d+dirty 1223.71 ms 1227.69 ms 3.98 ms
3261206+dirty 1223.00 ms 1226.06 ms 3.06 ms
6e8584e+dirty 1271.71 ms 1281.26 ms 9.55 ms

App size

Revision Plain With Sentry Diff
0ebca77+dirty 2.92 MiB 3.61 MiB 705.12 KiB
8ae23a7+dirty 2.92 MiB 3.66 MiB 757.67 KiB
18ce5e8+dirty 2.92 MiB 3.69 MiB 789.94 KiB
9385d74+dirty 2.92 MiB 3.67 MiB 772.40 KiB
b6f8ea2+dirty 3.19 MiB 4.25 MiB 1.06 MiB
d8e8c67+dirty 2.92 MiB 3.69 MiB 790.53 KiB
f54118b+dirty 2.92 MiB 3.67 MiB 770.05 KiB
ae7b03d+dirty 3.19 MiB 4.25 MiB 1.06 MiB
3261206+dirty 3.19 MiB 4.25 MiB 1.07 MiB
6e8584e+dirty 2.92 MiB 3.44 MiB 536.52 KiB

Previous results on branch: feedback-ui

Startup times

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

App size

Revision Plain With Sentry Diff
2646c98+dirty 3.19 MiB 4.26 MiB 1.07 MiB
3e4cdf5+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
0325426+dirty 3.19 MiB 4.26 MiB 1.07 MiB
0459aee+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