Skip to content

User Feedback followup #4494

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

Merged
merged 53 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
62e71ff
added Feedback class and extended Contexts with it
stefanosiano Mar 14, 2025
c9b4850
Added Sentry.captureFeedback API
stefanosiano Mar 25, 2025
813ff1d
updated changelog
stefanosiano Mar 25, 2025
dd2d6a8
added tests
stefanosiano Mar 27, 2025
6428dfa
added scope replay id and screen as url
stefanosiano Mar 31, 2025
144bcca
added feedback as DataCategory for rate limit and client report
stefanosiano Apr 16, 2025
509f992
Merge branch 'refs/heads/main' into feat/new-user-feedback-logic
stefanosiano Apr 16, 2025
3c0a6fb
merged main
stefanosiano Apr 16, 2025
9e1066e
added tests
stefanosiano Apr 17, 2025
eadb567
Merge branch 'refs/heads/main' into feat/new-user-feedback-logic
stefanosiano Apr 17, 2025
8feeadc
fixed tests
stefanosiano Apr 17, 2025
986772d
started adding resources for UF widget
stefanosiano Apr 29, 2025
e19d122
started SentryFeedbackOptions
stefanosiano Apr 30, 2025
79052ad
Merge branch 'feat/new-user-feedback-logic' into feat/user-feedback-w…
stefanosiano May 7, 2025
5a83bb8
added all form options
stefanosiano May 9, 2025
ee44b18
Merge branch 'main' into feat/new-user-feedback-logic
stefanosiano May 9, 2025
212ffbf
merged main
stefanosiano May 9, 2025
2bf99b5
Merge branch 'feat/new-user-feedback-logic' into feat/user-feedback-w…
stefanosiano May 9, 2025
6eb876c
user feedback dialog now uses dialogTheme
stefanosiano May 14, 2025
a33ae00
Merge branch 'main' into feat/user-feedback-widget
stefanosiano May 14, 2025
d47f374
merged main
stefanosiano May 14, 2025
1a758a2
removed java options for send button colors. Replaced with theme sett…
stefanosiano May 14, 2025
9315f7b
added tests and UI tests
stefanosiano May 16, 2025
62cea5e
added comments
stefanosiano May 16, 2025
794bd66
added comments
stefanosiano May 16, 2025
f16ac66
added replay capturing on feedback dialog open
stefanosiano May 16, 2025
5388b42
added cancel button ui test
stefanosiano May 19, 2025
8aacd36
added cancel button ui test
stefanosiano May 19, 2025
8750c8d
Merge branch 'refs/heads/main' into feat/user-feedback-widget
stefanosiano May 19, 2025
6d14499
added Feedback.toString() and default values in javadoc of SentryFeed…
stefanosiano May 19, 2025
fb88c1f
merged main
stefanosiano May 19, 2025
b5eb64d
skipping replay in test when running on gh
stefanosiano May 20, 2025
d0ba126
skipping replay in test when running on gh
stefanosiano May 20, 2025
202759f
Merge branch 'main' into feat/user-feedback-widget
markushi May 22, 2025
6253aca
added SentryUserFeedbackWidget, with styles and icon
stefanosiano May 26, 2025
c6d1919
updated changelog
stefanosiano May 26, 2025
7bc01eb
Merge branch 'main' into feat/user-feedback-widget
stefanosiano May 29, 2025
ce10336
Merge branch 'feat/user-feedback-widget' into feat/user-feedback-button
stefanosiano May 29, 2025
933371d
Update CHANGELOG.md
stefanosiano May 29, 2025
eebaaf3
removed rtl properties and supportsRtl flag
stefanosiano Jun 6, 2025
3fef7c4
updated changelog
stefanosiano Jun 6, 2025
536d522
Merge branch 'main' into feat/user-feedback-widget
stefanosiano Jun 6, 2025
6d9cee3
Merge branch 'feat/user-feedback-widget' into feat/user-feedback-button
stefanosiano Jun 6, 2025
1bb3095
merged main
stefanosiano Jun 6, 2025
67cbc0d
Merge branch 'main' into feat/user-feedback-button
stefanosiano Jun 13, 2025
4e5ad3a
merged main
stefanosiano Jun 13, 2025
5cdbaca
fixed ui tests
stefanosiano Jun 16, 2025
5d84125
Changed logo with vector drawable
stefanosiano Jun 17, 2025
8a1ef90
Renamed SentryUserFeedbackWidget to SentryUserFeedbackButton
stefanosiano Jun 17, 2025
b504f79
Merge branch 'main' into feat/user-feedback-button
stefanosiano Jun 17, 2025
d7cf58d
Merge branch 'feat/user-feedback-button' into feat/user-feedback-foll…
stefanosiano Jun 17, 2025
2af7422
Merge branch 'main' into feat/user-feedback-followup
stefanosiano Jun 17, 2025
cdf2e3f
updated changelog and tests
stefanosiano Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added comments
updated changelog
  • Loading branch information
stefanosiano committed May 16, 2025
commit 62cea5eb79c7a50faf0579aa49ccb7a38bd6eb6a
49 changes: 11 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,17 @@

- Add New User Feedback form ([#4384](https://github.com/getsentry/sentry-java/pull/4384))
- We now introduce SentryUserFeedbackDialog, which extends AlertDialog, inheriting the show() and cancel() methods, among others.
- The dialog integrates with the current dialog theme, so it's compatible with dark mode, and can be customized with a custom xml style.
- ```styles.xml or themes.xml
<!-- Application theme. -->
<style name="MyAppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
...
current theme customizations
...
<!-- Set a dialog theme if not already done. -->
<item name="android:dialogTheme">@style/MyAppDialogTheme</item>
</style>

<!-- Edit application dialog theme. -->
<style name="MyAppDialogTheme" parent="Theme.AppCompat.DayNight.Dialog">
<!-- Set the style of the feedback dialog title. -->
<item name="android:windowTitleStyle">@style/FeedbackFormTitleStyle</item>

<!-- Set the color of title, cancel button text, and non editable texts. -->
<item name="android:textColor">@color/colorPrimary</item>
<!-- Set the color of editable texts. -->
<item name="android:editTextColor">@color/colorPrimaryDark</item>
<!-- Set the color of the hint of editable texts. -->
<item name="android:textColorHint">@color/colorPrimaryDark</item>
<!-- Set the color of the send button text. -->
<item name="android:textColorPrimaryInverse">@android:color/white</item>

<!-- Set the background color of the send button. -->
<item name="android:colorPrimary">@color/colorPrimary</item>
<!-- Set the background color of the cancel button. -->
<item name="android:colorBackground">@android:color/black</item>
<!-- Set the color tint of the image logo. -->
<item name="android:colorForeground">@color/colorPrimary</item>
</style>

<style name="FeedbackFormTitleStyle">
<!-- Customize your theme here. -->
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Title</item>
</style>
```
To use it, just instantiate it and call show() on the instance (Sentry must be previously initialized).
```java
import io.sentry.android.core.SentryUserFeedbackDialog;

new SentryUserFeedbackDialog(context).show();
```
```kotlin
import io.sentry.android.core.SentryUserFeedbackDialog

SentryUserFeedbackDialog(context).show()
```

## 8.12.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ protected void onCreate(Bundle savedInstanceState) {
imgLogo.setVisibility(View.GONE);
}

// If name is required, ignore showName flag
if (!feedbackOptions.isShowName() && !feedbackOptions.isNameRequired()) {
lblName.setVisibility(View.GONE);
edtName.setVisibility(View.GONE);
Expand All @@ -86,6 +87,7 @@ protected void onCreate(Bundle savedInstanceState) {
}
}

// If email is required, ignore showEmail flag
if (!feedbackOptions.isShowEmail() && !feedbackOptions.isEmailRequired()) {
lblEmail.setVisibility(View.GONE);
edtEmail.setVisibility(View.GONE);
Expand All @@ -99,6 +101,7 @@ protected void onCreate(Bundle savedInstanceState) {
}
}

// If Sentry user is set, and useSentryUser is true, populate the name and email
if (feedbackOptions.isUseSentryUser()) {
final @Nullable User user = Sentry.getCurrentScopes().getScope().getUser();
if (user != null) {
Expand All @@ -115,11 +118,12 @@ protected void onCreate(Bundle savedInstanceState) {
btnSend.setText(feedbackOptions.getSubmitButtonLabel());
btnSend.setOnClickListener(
v -> {
// Gather fields and trim them
final @NotNull String name = edtName.getText().toString().trim();
final @NotNull String email = edtEmail.getText().toString().trim();
final @NotNull String message = edtMessage.getText().toString().trim();
final @NotNull Feedback feedback = new Feedback(message);

// If a required field is missing, shows the error label
if (name.isEmpty() && feedbackOptions.isNameRequired()) {
edtName.setError(lblName.getText());
return;
Expand All @@ -135,10 +139,13 @@ protected void onCreate(Bundle savedInstanceState) {
return;
}

// Create the feedback object
final @NotNull Feedback feedback = new Feedback(message);
feedback.setName(name);
feedback.setContactEmail(email);

SentryId id = Sentry.captureFeedback(feedback);
// Capture the feedback. If the ID is empty, it means that the feedback was not sent
final @NotNull SentryId id = Sentry.captureFeedback(feedback);
if (!id.equals(SentryId.EMPTY_ID)) {
Toast.makeText(
getContext(), feedbackOptions.getSuccessMessageText(), Toast.LENGTH_SHORT)
Expand Down Expand Up @@ -180,6 +187,7 @@ protected void onStart() {

@Override
public void show() {
// If Sentry is disabled, don't show the dialog, but log a warning
final @NotNull IScopes scopes = Sentry.getCurrentScopes();
final @NotNull SentryOptions options = scopes.getOptions();
if (!scopes.isEnabled() || !options.isEnabled()) {
Expand All @@ -188,6 +196,7 @@ public void show() {
.log(SentryLevel.WARNING, "Sentry is disabled. Feedback dialog won't be shown.");
return;
}
// Otherwise, show the dialog
super.show();
}
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy