-
Notifications
You must be signed in to change notification settings - Fork 138
[WOOMOB-1980] Add Learn more CTA to Mobile Announcements #15272
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
base: trunk
Are you sure you want to change the base?
[WOOMOB-1980] Add Learn more CTA to Mobile Announcements #15272
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
...rce/src/main/kotlin/com/woocommerce/android/ui/whatsnew/FeatureAnnouncementDialogFragment.kt
Fixed
Show fixed
Hide fixed
...mmerce/src/main/kotlin/com/woocommerce/android/ui/whatsnew/FeatureAnnouncementListAdapter.kt
Fixed
Show fixed
Hide fixed
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #15272 +/- ##
=========================================
Coverage 38.81% 38.82%
- Complexity 10667 10669 +2
=========================================
Files 2205 2205
Lines 125374 125407 +33
Branches 17394 17397 +3
=========================================
+ Hits 48670 48683 +13
- Misses 71759 71780 +21
+ Partials 4945 4944 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add database support for storing the detailsUrl field in WhatsNewAnnouncementEntity to ensure cached announcements display Learn more links consistently across all entry points.
Remove feature-level detailsUrl since the API only provides a single URL at the announcement level. The UI now shows two states: - With detailsUrl: "Learn more" primary CTA + "Not now" secondary - Without detailsUrl: "Continue" primary CTA only
- Mark announcement as viewed and close dialog when Learn more is tapped - Make detailsUrl nullable in API response to handle missing field - Add logging when URL fails to open
| val imageData: ByteArray | ||
| try { | ||
| val sanitizedBase64String = base64ImageData.replace("data:image/png;base64,", "") | ||
| val sanitizedBase64String = base64ImageData.replace(Regex("^data:image/[^;]+;base64,"), "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Claude:
The original code only stripped the PNG data URI prefix. But base64 image data can come with different MIME types:
- data:image/png;base64,
- data:image/jpeg;base64,
- data:image/gif;base64,
- data:image/webp;base64,
- data:image/svg+xml;base64,
The regex ^data:image/[^;]+;base64, matches:
- ^data:image/ — starts with "data:image/"
- [^;]+ — one or more characters that are NOT a semicolon (captures the image type)
- ;base64, — followed by ";base64,"
This makes the code more robust—if the API returns a JPEG or any other image format, it will be handled correctly instead of
failing to decode because the prefix wasn't stripped.
|
@kidinov @malinajirka not urgent, one review is enough. Thanks |
Description
Context: pdfdoF-8Ff-p2
iOS PR: woocommerce/woocommerce-ios#16591
WOOMOB-1980
Mobile announcements tool supports passing a learn more URL. However, it is not used in the app. Add optional "Learn more" link support for What's New feature announcements with two display states:
Announcement Display States
detailsUrlprovideddetailsUrlprovidedFor easier testing:
Testing
Live Test via Developer Options
Ensure test announcement is enabled:
APP VERSION = 999.0and forWoo Androidis enabled (Wait a minute or two after enabling, disable after testing)Fetch and display the announcement:
Screenshots & Videos
No announcement link
With announcement link
announcement.android.mov
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.