Fix preview build#6093
Open
SeniorZhai wants to merge 17 commits into
Open
Conversation
# Conflicts: # app/src/main/java/one/mixin/android/ui/landing/components/MnemonicPhraseInput.kt
# Conflicts: # app/build.gradle
- Review.kt: SolanaParsedTxTokenNullPreview now calls stateless ParsedTxPreviewContent - SessionRequestPage.kt: hoist viewModel.getContent and viewModel.rejectRequest as lambda parameters so SessionRequestPageContent compiles without a ViewModel
- move resourceConfigurations to androidResources.localeFilters - replace java/assets.srcDirs(...) with directories.add(...) - drop deprecated composeCompiler.enableStrongSkippingMode (default on) - replace stabilityConfigurationFile with stabilityConfigurationFiles.add(...)
- Theme.kt: import extension.isNightMode (was missing after merge) - PinKeyBoard.kt / AboutPage.kt / AccountPage.kt: revert to master versions; the cherry-picked older copies referenced renamed R.string/R.drawable and outdated method signatures
…rry-pick The compose-preview refactor commits left these pages referencing removed/renamed APIs (MixinResponse, MemberOrderPlan, SafeWallet, SettingTile/showAppAuthPrompt signatures, R.string.Minutes plural, SessionRequestUI, etc.) and a literal `...` placeholder in SecurityPage. Restoring the master versions clears the compileKotlin errors; the preview-support rework for these pages can be redone against the current APIs later.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on fixing issues that prevent Compose previews (and related builds) from working reliably by making preview-safe theme usage and isolating UI content from DI/runtime-only dependencies. It also includes build/dependency adjustments and adds an instrumentation test to validate Room migrations across all historical DB versions.
Changes:
- Wrapped multiple
@Previewcomposables withMixinAppThemeand refactored some pages into*Contentcomposables to avoidhiltViewModel()/ runtime dependencies in previews. - Updated
MixinAppThemeand dialogs to behave safely underLocalInspectionMode(Compose preview). - Build/test hardening: updated Gradle resource locale filtering + protobuf dependencies/exclusions, added a “migrate all versions to current” Room migration instrumentation test, and made several null-safety cleanups.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/java/one/mixin/android/ui/transfer/compose/SelectDatePage.kt | Wrap preview in MixinAppTheme to avoid preview-time crashes/missing locals. |
| app/src/main/java/one/mixin/android/ui/setting/ui/page/ConversationSettingPage.kt | Split into ConversationSettingPageContent to decouple UI from hiltViewModel() for previewability/testability. |
| app/src/main/java/one/mixin/android/ui/setting/ui/page/BlockedPage.kt | Refactor to BlockedPageContent and add themed preview. |
| app/src/main/java/one/mixin/android/ui/setting/ui/page/AuthenticationsPage.kt | Refactor to AuthenticationsPageContent and add themed preview. |
| app/src/main/java/one/mixin/android/ui/media/pager/transcript/TranscriptMediaPagerActivity.kt | Add API-aware exit transition helper (API 34+ vs legacy). |
| app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerActivity.kt | Add file-level deprecation suppression (see comment). |
| app/src/main/java/one/mixin/android/ui/landing/components/MnemonicPhraseInput.kt | Wrap preview in MixinAppTheme. |
| app/src/main/java/one/mixin/android/ui/landing/components/CreateAccountPage.kt | Wrap preview in MixinAppTheme. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/SwapTokenPage.kt | Wrap preview in MixinAppTheme. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/SwapSlippagePage.kt | Wrap previews in MixinAppTheme. |
| app/src/main/java/one/mixin/android/ui/home/web3/stake/ValidatorsPage.kt | Wrap previews in MixinAppTheme. |
| app/src/main/java/one/mixin/android/ui/home/web3/stake/StakePage.kt | Wrap previews in MixinAppTheme. |
| app/src/main/java/one/mixin/android/ui/home/web3/components/SlippageInfo.kt | Wrap previews in MixinAppTheme. |
| app/src/main/java/one/mixin/android/ui/home/web3/components/Review.kt | Extract content composables so previews don’t require Hilt/viewmodels; pass prices into item content. |
| app/src/main/java/one/mixin/android/ui/home/web3/components/InputAction.kt | Wrap preview in MixinAppTheme. |
| app/src/main/java/one/mixin/android/ui/home/inscription/component/ShareCard.kt | Add missing MixinAppTheme import and wrap preview in theme. |
| app/src/main/java/one/mixin/android/ui/auth/compose/AuthBottomSheetDialogCompose.kt | Wrap preview in MixinAppTheme. |
| app/src/main/java/one/mixin/android/pay/Lighting.kt | Small null-safety refactor when reading assetId/chainId. |
| app/src/main/java/one/mixin/android/net/Diagnosis.kt | Adjust OkHttp body parsing with blank checks (behavioral hardening). |
| app/src/main/java/one/mixin/android/job/TranscriptAttachmentDownloadJob.kt | Tighten success/cancel checks and remove unsafe !! usage. |
| app/src/main/java/one/mixin/android/job/SendMessageJob.kt | Avoid potential NPE by early-returning if participant public key is null. |
| app/src/main/java/one/mixin/android/job/RefreshAddressJob.kt | Simplify insert using requireNotNull after success checks. |
| app/src/main/java/one/mixin/android/job/AttachmentDownloadJob.kt | Tighten success/cancel checks and remove unsafe !! usage. |
| app/src/main/java/one/mixin/android/extension/ViewExtension.kt | Replace deprecated/compat animation helpers and improve null/exception handling in extensions. |
| app/src/main/java/one/mixin/android/compose/theme/Theme.kt | Make theme preview-safe via LocalInspectionMode and compute P3 support from LocalContext outside previews. |
| app/src/main/java/one/mixin/android/compose/Dialogs.kt | Avoid showing legacy ProgressDialog during previews. |
| app/src/main/java/one/mixin/android/compose/AppBar.kt | Wrap preview in MixinAppTheme. |
| app/src/androidTest/java/one/mixin/android/db/MigrationCurrentVersionTest.kt | New instrumentation test migrating all historical DB versions to current. |
| app/src/androidTest/java/one/mixin/android/db/BaseMigrationTest.kt | Centralize all migrations and add helpers to create DB + run migration validation. |
| app/build.gradle.kts | Update locale filters DSL, protobuf dependency/exclusions, compose compiler config, and test source set configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1
to
+2
| @file:Suppress("DEPRECATION") | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.