Skip to content

Conversation

@irfano
Copy link
Contributor

@irfano irfano commented Mar 27, 2025

Closes: #13843

Description

This fixes the layout issue in the Woo update dialog, which was broken on tablets. I migrated the dialog to Compose and resolved the issue. This PR also updates the dialog’s style to align with the current design used in the app.

Steps to reproduce

The tests that have been performed

Steps above and screens below.

Images/gif

Before After
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

irfano added 4 commits March 27, 2025 03:09
This commit introduces the `WooUpgradeRequiredDialogFragment`, which is a custom DialogFragment used to display a dialog that informs the user about a required WooCommerce upgrade. This dialog is implemented using Jetpack Compose, and it allows the user to navigate to the WooCommerce upgrade instructions using a custom Chrome tab. It also includes an option to dismiss the dialog.
@irfano irfano added the category: design Layout and style elements in the UI or user interface, including color and animations. label Mar 27, 2025
@irfano irfano added this to the 22.1 milestone Mar 27, 2025
@irfano irfano changed the title Issue/13843 fix layout of update woo dialog Fix the layout issue in the Woo update dialog Mar 27, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Mar 27, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitbaad7f0
Direct Downloadwoocommerce-wear-prototype-build-pr13851-baad7f0.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Mar 27, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitbaad7f0
Direct Downloadwoocommerce-prototype-build-pr13851-baad7f0.apk

@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 7.50000% with 37 lines in your changes missing coverage. Please review.

Project coverage is 38.12%. Comparing base (e7bbff9) to head (baad7f0).
Report is 110 commits behind head on trunk.

Files with missing lines Patch % Lines
.../android/ui/sitepicker/WooUpgradeRequiredDialog.kt 0.00% 35 Missing ⚠️
...merce/android/ui/sitepicker/SitePickerViewModel.kt 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #13851      +/-   ##
============================================
- Coverage     38.14%   38.12%   -0.02%     
- Complexity     9296     9297       +1     
============================================
  Files          2082     2083       +1     
  Lines        114936   114976      +40     
  Branches      14651    14662      +11     
============================================
  Hits          43839    43839              
- Misses        67105    67144      +39     
- Partials       3992     3993       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 35 to 37
return Dialog(requireContext()).apply {
setContentView(composeView)
setCancelable(false)
Copy link
Member

Choose a reason for hiding this comment

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

np, this would create two dialogs (ie two windows), Compose's AlertDialog will create its own dialog, and we are creating another one here.

I'm just sharing this, I don't think it's a blocker, and I think the simplicity of the current solution.
Also, since this dialog is rarely (if at all) is shown, it's not an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch @hichamboushaba! I’ve implemented a better solution by using a ComposeView in the SitePickerFragment. The WooUpgradeDialog remains the same, I simply removed the dialog fragment and integrated this composable dialog directly into the SitePickerFragment.

Copy link
Member

@hichamboushaba hichamboushaba left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @irfano 👍

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@irfano irfano enabled auto-merge March 28, 2025 11:15
@irfano irfano merged commit 7b73c77 into trunk Mar 28, 2025
17 checks passed
@irfano irfano deleted the issue/13843-fix-layout-of-update-woo-dialog branch March 28, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: design Layout and style elements in the UI or user interface, including color and animations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Woo dialog UI is broken

6 participants