Skip to content

Commit e63ad34

Browse files
romtsnclaude
andauthored
ref(feedback): Deprecate SentryUserFeedbackButton (#5350)
* ref(feedback): Rename Dialog to Form across feedback APIs Rename SentryUserFeedbackDialog to SentryUserFeedbackForm as the primary class. Keep SentryUserFeedbackDialog as a deprecated subclass for backward compatibility. Also rename internal APIs to use Form naming consistently: - IDialogHandler -> IFormHandler - showDialog -> showForm - setDialogHandler/getDialogHandler -> setFormHandler/getFormHandler - AndroidUserFeedbackIDialogHandler -> AndroidUserFeedbackFormHandler Add deprecated Sentry.showUserFeedbackDialog() overloads that delegate to the new Sentry.showUserFeedbackForm() methods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(feedback): Preserve binary compatibility for deprecated Builder constructors Use SentryUserFeedbackDialog.OptionsConfiguration as the parameter type in the deprecated Builder constructors so old compiled code looking for the original descriptor still resolves correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Make internal ctor package-private * Add missing deprecated annotaiton * Fix api * docs(changelog): Add deprecation entry for feedback Dialog to Form rename Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(changelog): Note removal in next major version Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(feedback): Add Sentry.feedback() API Introduce IFeedbackApi with showForm() and capture() methods, accessible via Sentry.feedback(). This consolidates all feedback operations under a single API entry point. Deprecate Sentry.showUserFeedbackForm(), Sentry.showUserFeedbackDialog(), Sentry.captureFeedback(), and Sentry.captureUserFeedback() in favor of the new Sentry.feedback() API. All deprecated methods will be removed in the next major version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(changelog): Update section to Features and remove unpublished API Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ref(feedback): Move FeedbackApi to IScopes Add feedback() method to IScopes, matching the pattern used by logger() and metrics(). FeedbackApi takes an IScopes reference instead of using Sentry.getCurrentScopes() statically. Implemented in Scopes, NoOpScopes, NoOpHub, HubAdapter, HubScopesWrapper, and ScopesAdapter. Sentry.feedback() now delegates to getCurrentScopes().feedback(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ref: Rename showForm() to show() on IFeedbackApi Since the method is already namespaced under feedback(), the extra "Form" suffix is redundant. This aligns with the convention used by logger() and metrics(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: Deprecate UserFeedback and captureUserFeedback, delete showUserFeedbackForm Deprecate the old `UserFeedback` class and `captureUserFeedback()` across IScopes, ISentryClient, and all implementations in favor of `Sentry.feedback().capture()` with the new `Feedback` type. Delete `Sentry.showUserFeedbackForm()` (3 overloads) as it was never published. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: Deprecate SentryEnvelopeItem.fromUserFeedback() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: Deprecate SentryClient.buildEnvelope(UserFeedback) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ref: Remove unnecessary SuppressWarnings("deprecation") Deprecated methods don't need to suppress deprecation warnings for referencing other deprecated types — the deprecation annotation itself is sufficient. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix test * remove redudndant deprecated annotations * fix test * ref(feedback): Deprecate SentryUserFeedbackButton * Changelog * chore: Deprecate SentryUserFeedbackButton in sentry-compose Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * changelog * message --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7659fe5 commit e63ad34

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- `Sentry.captureUserFeedback()` and `UserFeedback` are deprecated in favor of `Sentry.feedback().capture()` with the new `Feedback` type
1111
- `SentryUserFeedbackDialog` is deprecated in favor of `SentryUserFeedbackForm`
1212
- All deprecated APIs will be removed in the next major version
13+
- Deprecate `SentryUserFeedbackButton` (View-based and Compose-based) ([#5350](https://github.com/getsentry/sentry-java/pull/5350))
14+
- It will be removed in the next major version
1315

1416
### Dependencies
1517

sentry-android-core/src/main/java/io/sentry/android/core/SentryUserFeedbackButton.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,33 @@
1010
import org.jetbrains.annotations.NotNull;
1111
import org.jetbrains.annotations.Nullable;
1212

13+
/**
14+
* @deprecated `SentryUserFeedbackButton` will be removed in the next major version
15+
*/
16+
@Deprecated
1317
public class SentryUserFeedbackButton extends Button {
1418

1519
private @Nullable OnClickListener delegate;
1620

21+
@Deprecated
1722
public SentryUserFeedbackButton(Context context) {
1823
super(context);
1924
init(context, null, 0, 0);
2025
}
2126

27+
@Deprecated
2228
public SentryUserFeedbackButton(Context context, AttributeSet attrs) {
2329
super(context, attrs);
2430
init(context, attrs, 0, 0);
2531
}
2632

33+
@Deprecated
2734
public SentryUserFeedbackButton(Context context, AttributeSet attrs, int defStyleAttr) {
2835
super(context, attrs, defStyleAttr);
2936
init(context, attrs, defStyleAttr, 0);
3037
}
3138

39+
@Deprecated
3240
public SentryUserFeedbackButton(
3341
Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
3442
super(context, attrs, defStyleAttr, defStyleRes);

sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryUserFeedbackButton.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import androidx.compose.ui.unit.dp
1515
import io.sentry.Sentry
1616
import io.sentry.SentryFeedbackOptions
1717

18+
@Deprecated("`SentryUserFeedbackButton` will be removed in the next major version")
1819
@Composable
1920
public fun SentryUserFeedbackButton(
2021
modifier: Modifier = Modifier,

0 commit comments

Comments
 (0)