Skip to content

ref(feedback): Extend Dialog instead of AlertDialog in SentryUserFeedbackForm - #6338

Draft
runningcode wants to merge 2 commits into
9.x.xfrom
no/feedback-form-extend-dialog
Draft

runningcode wants to merge 2 commits into
9.x.xfrom
no/feedback-form-extend-dialog

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

SentryUserFeedbackForm now extends android.app.Dialog instead of android.app.AlertDialog. The form never used AlertDialog's title, message, buttons or custom-view slots. It replaced the whole content with its own layout in onCreate.

The default theme does not change. For themeResId == 0, AlertDialog resolves android.R.attr.alertDialogTheme, but Dialog would fall back to android.R.attr.dialogTheme. The form now resolves alertDialogTheme itself, so SentryUserFeedbackForm.Builder(context) styles the form exactly as before.

This also drops the FLAG_ALT_FOCUSABLE_IM workaround from #5359. AlertDialog set that flag because it found no text input in its own content, which hid the soft keyboard. Dialog never sets it. The existing test that checks the flag is absent still passes.

💡 Motivation and Context

Changing the superclass breaks binary and source compatibility for anyone calling AlertDialog-only methods on the form (setButton, setMessage, setView, getButton, ...), so it waits for v9.

💚 How did you test it?

  • ./gradlew spotlessApply apiDump
  • ./gradlew :sentry-android-core:testReleaseUnitTest :sentry-samples:sentry-samples-android:compileReleaseKotlin :sentry-android-integration-tests:sentry-uitest-android:compileReleaseAndroidTestKotlin
  • Added unit tests for the default and explicit theme resolution.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the 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.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

  • Check the form on a device or emulator. The unit tests cover theme resolution, not how the form renders.
  • Mention the new superclass in the v8 → v9 migration guide (JAVA-732).

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

JAVA-494

@sentry

sentry Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.0 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode runningcode added the next-major This should only be merged in the next major version. label Oct 21, 2026
runningcode and others added 2 commits October 21, 2026 16:47
…backForm

The form never used AlertDialog's title, message, buttons or custom
view; it replaces the content with its own layout in onCreate.

Dialog falls back to dialogTheme for theme 0, while AlertDialog uses
alertDialogTheme, so the form now resolves alertDialogTheme itself to
keep the default look unchanged. The FLAG_ALT_FOCUSABLE_IM workaround
goes away because only AlertDialog set that flag.

Resolves JAVA-494

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/feedback-form-extend-dialog branch from 897030d to ced4589 Compare October 21, 2026 14:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next-major This should only be merged in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant