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

(1) feat: Add Feedback Form Component #4328

Merged
merged 92 commits into from
Jan 10, 2025

Conversation

antonis
Copy link
Collaborator

@antonis antonis commented Nov 29, 2024

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds a basic feedback form with the following fields: name, email, description.
The form text and styles can be customised.

Feedback Form Sample Button Feedback Form iOS Feedback Form Android
Simulator Screenshot - iPhone SE (3rd generation) - 2024-11-29 at 23 16 21 Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 16 44 55 Screenshot_1733913880

Subtask PRs:

💡 Motivation and Context

Fixes #4336

💚 How did you test it?

CI, Manual testing (example)

📝 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

Copy link
Contributor

github-actions bot commented Nov 29, 2024

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 486.00 ms 475.61 ms -10.39 ms
Size 17.75 MiB 20.12 MiB 2.37 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8ae23a7 526.83 ms 513.38 ms -13.45 ms
61310e1 464.42 ms 452.47 ms -11.95 ms
13f280b 486.16 ms 472.45 ms -13.71 ms
c6f01ea 486.20 ms 486.98 ms 0.77 ms
1d86dd6 405.14 ms 411.06 ms 5.92 ms
cdf2bdf 448.42 ms 443.42 ms -5.00 ms
de59d3a 486.48 ms 495.66 ms 9.18 ms
f06c879 408.41 ms 424.54 ms 16.13 ms
d2c32bb 448.85 ms 450.19 ms 1.34 ms
8ab11b6 462.10 ms 450.40 ms -11.70 ms

App size

Revision Plain With Sentry Diff
8ae23a7 17.74 MiB 20.07 MiB 2.34 MiB
61310e1 17.74 MiB 20.08 MiB 2.35 MiB
13f280b 17.74 MiB 20.08 MiB 2.34 MiB
c6f01ea 17.74 MiB 20.10 MiB 2.36 MiB
1d86dd6 17.73 MiB 19.86 MiB 2.12 MiB
cdf2bdf 17.74 MiB 20.10 MiB 2.36 MiB
de59d3a 17.74 MiB 20.10 MiB 2.36 MiB
f06c879 17.73 MiB 19.85 MiB 2.12 MiB
d2c32bb 17.74 MiB 20.08 MiB 2.34 MiB
8ab11b6 17.74 MiB 20.09 MiB 2.35 MiB

Previous results on branch: antonis/3859-newCaptureFeedbackAPI-Form

Startup times

Revision Plain With Sentry Diff
41e9784 450.17 ms 448.69 ms -1.48 ms
cadf235 462.20 ms 463.34 ms 1.14 ms
d33790a 442.93 ms 439.94 ms -3.00 ms
a06f6ba 424.02 ms 415.82 ms -8.20 ms
e0624b6 447.67 ms 441.08 ms -6.59 ms
a3ba405 438.16 ms 435.78 ms -2.38 ms
50c70c0 496.82 ms 526.02 ms 29.20 ms
561640f 461.96 ms 458.11 ms -3.85 ms
0781f75 452.32 ms 457.22 ms 4.91 ms
38a278b 473.58 ms 468.76 ms -4.82 ms

App size

Revision Plain With Sentry Diff
41e9784 17.75 MiB 20.12 MiB 2.37 MiB
cadf235 17.74 MiB 20.09 MiB 2.35 MiB
d33790a 17.74 MiB 20.10 MiB 2.36 MiB
a06f6ba 17.74 MiB 20.09 MiB 2.35 MiB
e0624b6 17.74 MiB 20.10 MiB 2.36 MiB
a3ba405 17.74 MiB 20.09 MiB 2.35 MiB
50c70c0 17.74 MiB 20.10 MiB 2.36 MiB
561640f 17.74 MiB 20.09 MiB 2.35 MiB
0781f75 17.74 MiB 20.09 MiB 2.35 MiB
38a278b 17.74 MiB 20.10 MiB 2.37 MiB

Copy link
Contributor

github-actions bot commented Nov 29, 2024

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 427.72 ms 433.56 ms 5.85 ms
Size 7.15 MiB 8.38 MiB 1.23 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b1e8712+dirty 322.55 ms 331.84 ms 9.29 ms
07e58c9+dirty 391.00 ms 409.66 ms 18.66 ms
7bc4d75+dirty 420.96 ms 472.25 ms 51.29 ms
12427f4+dirty 379.48 ms 400.92 ms 21.44 ms
9282172+dirty 363.57 ms 399.78 ms 36.20 ms
43e66e0+dirty 378.20 ms 404.59 ms 26.40 ms
eb1e19f+dirty 391.37 ms 418.27 ms 26.90 ms
8e80789+dirty 464.48 ms 551.10 ms 86.63 ms
cdf2bdf+dirty 391.69 ms 461.14 ms 69.45 ms
e1ea4a8+dirty 451.98 ms 497.58 ms 45.60 ms

App size

Revision Plain With Sentry Diff
b1e8712+dirty 7.15 MiB 8.04 MiB 912.27 KiB
07e58c9+dirty 7.15 MiB 8.35 MiB 1.20 MiB
7bc4d75+dirty 7.15 MiB 8.35 MiB 1.20 MiB
12427f4+dirty 7.15 MiB 8.12 MiB 997.78 KiB
9282172+dirty 7.15 MiB 8.37 MiB 1.22 MiB
43e66e0+dirty 7.15 MiB 8.37 MiB 1.22 MiB
eb1e19f+dirty 7.15 MiB 8.35 MiB 1.20 MiB
8e80789+dirty 7.15 MiB 8.37 MiB 1.22 MiB
cdf2bdf+dirty 7.15 MiB 8.38 MiB 1.23 MiB
e1ea4a8+dirty 7.15 MiB 8.35 MiB 1.20 MiB

Previous results on branch: antonis/3859-newCaptureFeedbackAPI-Form

Startup times

Revision Plain With Sentry Diff
a3ba405+dirty 359.67 ms 436.86 ms 77.19 ms
e0624b6+dirty 359.30 ms 397.94 ms 38.64 ms
38a278b+dirty 392.43 ms 442.41 ms 49.97 ms
cadf235+dirty 455.51 ms 451.64 ms -3.87 ms
41e9784+dirty 372.23 ms 395.22 ms 22.99 ms
50c70c0+dirty 385.30 ms 433.06 ms 47.76 ms
edc8020+dirty 393.94 ms 407.87 ms 13.93 ms
03c9048+dirty 397.35 ms 417.73 ms 20.37 ms
f4a5053+dirty 391.02 ms 427.04 ms 36.02 ms
d33790a+dirty 404.87 ms 473.06 ms 68.19 ms

App size

Revision Plain With Sentry Diff
a3ba405+dirty 7.15 MiB 8.37 MiB 1.22 MiB
e0624b6+dirty 7.15 MiB 8.38 MiB 1.23 MiB
38a278b+dirty 7.15 MiB 8.38 MiB 1.23 MiB
cadf235+dirty 7.15 MiB 8.37 MiB 1.22 MiB
41e9784+dirty 7.15 MiB 8.38 MiB 1.23 MiB
50c70c0+dirty 7.15 MiB 8.38 MiB 1.23 MiB
edc8020+dirty 7.15 MiB 8.38 MiB 1.23 MiB
03c9048+dirty 7.15 MiB 8.38 MiB 1.23 MiB
f4a5053+dirty 7.15 MiB 8.38 MiB 1.23 MiB
d33790a+dirty 7.15 MiB 8.38 MiB 1.23 MiB

Copy link
Contributor

github-actions bot commented Nov 29, 2024

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1234.61 ms 1236.35 ms 1.73 ms
Size 3.19 MiB 4.26 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
484813b+dirty 1225.07 ms 1221.00 ms -4.07 ms
5a22220+dirty 1246.18 ms 1249.61 ms 3.43 ms
13f280b+dirty 1217.73 ms 1229.08 ms 11.35 ms
d7401ac+dirty 1288.10 ms 1289.54 ms 1.44 ms
8fe7c9d+dirty 1227.63 ms 1245.28 ms 17.65 ms
9385d74+dirty 1239.51 ms 1245.88 ms 6.37 ms
cdf2f33+dirty 1210.00 ms 1218.50 ms 8.50 ms
2534337+dirty 1220.87 ms 1221.47 ms 0.60 ms
4297324+dirty 1240.86 ms 1232.04 ms -8.81 ms
12427f4+dirty 1224.90 ms 1231.40 ms 6.50 ms

App size

Revision Plain With Sentry Diff
484813b+dirty 2.92 MiB 3.64 MiB 740.56 KiB
5a22220+dirty 2.92 MiB 3.48 MiB 575.81 KiB
13f280b+dirty 2.92 MiB 3.66 MiB 758.67 KiB
d7401ac+dirty 2.92 MiB 3.40 MiB 488.06 KiB
8fe7c9d+dirty 3.19 MiB 4.24 MiB 1.06 MiB
9385d74+dirty 2.92 MiB 3.67 MiB 772.40 KiB
cdf2f33+dirty 2.92 MiB 3.66 MiB 755.50 KiB
2534337+dirty 2.92 MiB 3.43 MiB 529.76 KiB
4297324+dirty 2.92 MiB 3.64 MiB 741.22 KiB
12427f4+dirty 2.92 MiB 3.44 MiB 533.29 KiB

Previous results on branch: antonis/3859-newCaptureFeedbackAPI-Form

Startup times

Revision Plain With Sentry Diff
d33790a+dirty 1247.14 ms 1242.86 ms -4.28 ms
0781f75+dirty 1247.90 ms 1237.11 ms -10.79 ms
edc8020+dirty 1245.50 ms 1241.70 ms -3.80 ms
561640f+dirty 1237.10 ms 1229.59 ms -7.51 ms
26fc306+dirty 1229.10 ms 1227.88 ms -1.22 ms
03c9048+dirty 1231.52 ms 1225.96 ms -5.56 ms
27e1bf3+dirty 1245.78 ms 1244.38 ms -1.40 ms
f4a5053+dirty 1233.04 ms 1240.02 ms 6.98 ms
e0624b6+dirty 1229.19 ms 1232.18 ms 3.00 ms
a06f6ba+dirty 1235.31 ms 1238.76 ms 3.45 ms

App size

Revision Plain With Sentry Diff
d33790a+dirty 2.92 MiB 3.67 MiB 773.59 KiB
0781f75+dirty 2.92 MiB 3.67 MiB 773.83 KiB
edc8020+dirty 2.92 MiB 3.69 MiB 793.89 KiB
561640f+dirty 2.92 MiB 3.67 MiB 773.72 KiB
26fc306+dirty 2.92 MiB 3.67 MiB 773.77 KiB
03c9048+dirty 2.92 MiB 3.67 MiB 774.29 KiB
27e1bf3+dirty 2.92 MiB 3.67 MiB 773.54 KiB
f4a5053+dirty 2.92 MiB 3.67 MiB 774.18 KiB
e0624b6+dirty 2.92 MiB 3.67 MiB 773.62 KiB
a06f6ba+dirty 2.92 MiB 3.67 MiB 773.87 KiB

@antonis antonis changed the title Add simple form UI Feedback form UI Nov 29, 2024
Copy link
Contributor

github-actions bot commented Nov 29, 2024

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1233.31 ms 1232.10 ms -1.20 ms
Size 2.63 MiB 3.69 MiB 1.06 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
484813b+dirty 1222.45 ms 1220.79 ms -1.66 ms
5a22220+dirty 1209.49 ms 1220.94 ms 11.45 ms
13f280b+dirty 1229.25 ms 1226.10 ms -3.15 ms
d7401ac+dirty 1252.38 ms 1275.04 ms 22.66 ms
8fe7c9d+dirty 1241.83 ms 1244.35 ms 2.51 ms
9385d74+dirty 1215.18 ms 1216.43 ms 1.25 ms
cdf2f33+dirty 1227.71 ms 1233.94 ms 6.22 ms
2534337+dirty 1225.08 ms 1230.26 ms 5.17 ms
4297324+dirty 1230.27 ms 1232.53 ms 2.27 ms
12427f4+dirty 1267.15 ms 1271.30 ms 4.15 ms

App size

Revision Plain With Sentry Diff
484813b+dirty 2.36 MiB 3.08 MiB 734.18 KiB
5a22220+dirty 2.36 MiB 2.92 MiB 570.21 KiB
13f280b+dirty 2.36 MiB 3.10 MiB 753.43 KiB
d7401ac+dirty 2.36 MiB 2.83 MiB 481.14 KiB
8fe7c9d+dirty 2.63 MiB 3.68 MiB 1.04 MiB
9385d74+dirty 2.36 MiB 3.10 MiB 759.78 KiB
cdf2f33+dirty 2.36 MiB 3.10 MiB 751.38 KiB
2534337+dirty 2.36 MiB 2.88 MiB 525.47 KiB
4297324+dirty 2.36 MiB 3.08 MiB 735.61 KiB
12427f4+dirty 2.36 MiB 2.88 MiB 530.38 KiB

Previous results on branch: antonis/3859-newCaptureFeedbackAPI-Form

Startup times

Revision Plain With Sentry Diff
d33790a+dirty 1234.19 ms 1231.76 ms -2.43 ms
0781f75+dirty 1222.19 ms 1222.11 ms -0.08 ms
edc8020+dirty 1235.24 ms 1236.69 ms 1.44 ms
561640f+dirty 1220.45 ms 1227.02 ms 6.57 ms
26fc306+dirty 1227.25 ms 1225.85 ms -1.40 ms
03c9048+dirty 1235.37 ms 1238.15 ms 2.77 ms
27e1bf3+dirty 1230.92 ms 1232.33 ms 1.41 ms
f4a5053+dirty 1225.32 ms 1231.47 ms 6.15 ms
e0624b6+dirty 1221.86 ms 1226.42 ms 4.57 ms
a06f6ba+dirty 1230.45 ms 1227.09 ms -3.36 ms

App size

Revision Plain With Sentry Diff
d33790a+dirty 2.36 MiB 3.11 MiB 761.06 KiB
0781f75+dirty 2.36 MiB 3.11 MiB 761.35 KiB
edc8020+dirty 2.36 MiB 3.13 MiB 782.76 KiB
561640f+dirty 2.36 MiB 3.11 MiB 761.19 KiB
26fc306+dirty 2.36 MiB 3.11 MiB 761.18 KiB
03c9048+dirty 2.36 MiB 3.11 MiB 761.74 KiB
27e1bf3+dirty 2.36 MiB 3.11 MiB 761.03 KiB
f4a5053+dirty 2.36 MiB 3.11 MiB 761.72 KiB
e0624b6+dirty 2.36 MiB 3.11 MiB 761.16 KiB
a06f6ba+dirty 2.36 MiB 3.11 MiB 761.35 KiB

Base automatically changed from antonis/3859-newCaptureFeedbackAPI to main December 2, 2024 10:46
An error occurred while trying to automatically change base from antonis/3859-newCaptureFeedbackAPI to main December 2, 2024 10:46
CHANGELOG.md Outdated
@@ -62,6 +62,27 @@

To learn how to attach context data to the feedback visit [the documentation](https://docs.sentry.io/platforms/react-native/user-feedback/).

- User Feedback Form Component Beta ([#4320](https://github.com/getsentry/sentry-react-native/pull/4328))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed with 9853630

Comment on lines 24 to 47
let feedbackFormHandler: (() => void) | null = null;

const setFeedbackFormHandler = (handler: () => void): void => {
feedbackFormHandler = handler;
};

const clearFeedbackFormHandler = (): void => {
feedbackFormHandler = null;
};

type Navigation = {
navigate: (screen: string, params?: Record<string, unknown>) => void;
};

export const showFeedbackForm = (navigation: Navigation): void => {
setFeedbackFormHandler(() => {
navigation?.navigate?.('FeedbackForm');
});
if (feedbackFormHandler) {
feedbackFormHandler();
} else {
logger.error('FeedbackForm handler is not set. Please ensure it is initialized.');
}
};
Copy link
Member

Choose a reason for hiding this comment

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

This was merged from #4370


I would keep the auto inject out of the this PR.

I think we should not export this helper, because to use it user still have to create a screen which will present the FeedbackForm component. Only then the helper shows the form.


The auto inject should work without manually specifying the FeedbackForm component and should be independent of any nav library. (We can create helper for specific bav libs later...)

I imagine when I call showFeedbackForm() the form will just show, no need to setup anything besides Sentry.init/Sentry.wrap(since we can't inject to dom as on web).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense @krystofwoldrich 👍
I reverted the change with e7a9484 and will iterate on the auto inject on a separate PR.

@krystofwoldrich krystofwoldrich changed the base branch from main to feedback-ui January 10, 2025 09:27
@krystofwoldrich
Copy link
Member

To avoid blocking the chain of the feedback PRs, I changed the target to https://github.com/getsentry/sentry-react-native/tree/feedback-ui

Where we can merge all the current PRs after they are reviewed and then we can merge https://github.com/getsentry/sentry-react-native/tree/feedback-ui to main and release the first feedback beta.


public handleFeedbackSubmit: () => void = () => {
const { name, email, description } = this.state;
const { onFormClose } = this.props;
Copy link
Member

Choose a reason for hiding this comment

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

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, just did a last check and run the sample, looks great!

@antonis antonis merged commit bda351c into feedback-ui Jan 10, 2025
72 checks passed
@antonis antonis deleted the antonis/3859-newCaptureFeedbackAPI-Form branch January 10, 2025 10:32
@antonis
Copy link
Collaborator Author

antonis commented Jan 10, 2025

To avoid blocking the chain of the feedback PRs, I changed the target to https://github.com/getsentry/sentry-react-native/tree/feedback-ui

Where we can merge all the current PRs after they are reviewed and then we can merge https://github.com/getsentry/sentry-react-native/tree/feedback-ui to main and release the first feedback beta.

Thank you @krystofwoldrich 🙇
I've drafted a PR #4435 to keep track of the changes merged on the feedback-ui branch.

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.

Implement basic capture feedback form UI
3 participants