-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
iOS 16 Lock Screen Widgets: Today Views Widget #20435
Conversation
* Add new feature flag for widget in lock screen * Add new widget kind to widget configuration * Add empty lock screen widget * Add JETPACK_STATS_WIDGETS compilation condition To prevent lock screen widgets from displaying on WordPress target * Move LockScreenStatsWidgetsView to views folder group * Revert compilation condition, change to isJetpack of AppCondiguration
* Extract statsUrl from private to extension for reusable with lock screen widget * Implement single stat view for today views widget Add view provider for handling building view for site selected status Add ViewModelMapper for converting viewModel from home widget data * Update LockScreenStatsWidgetsView body to get the view from view provider * Add mapper test to verify the viewModel converting from widget data correctly Add mapper and viewModel to WordPress target because app extension is not able to run unitTest * Fix getStatsURL typo
* Add views in today localizable string for footer label * Remove dateRange and footer, only title is enough for existing feature
The root cause is the WidgetBundleBuilder body doesn't allow control flow statements, move it to supportedFamilies with feature flag to keep all control logic in the same place
* Update title of view provider from hardcoded to pass from config * Add lock screen stats widget config and implementation to include required information * Pass config to LockScreenStatsWidget Replaced the hardcoded data with config properties * Add associated type view for other status and TODO comments * Extract app configuration and feature flag check into config
…creen (#20368) * Add widget data and timeline entry for lock screen to separate concerns * Add lock screen time line provider for lock screen stats widget entry Update stats widgets service result type to consist of home widget and lock screen widget for reusable * Update to use LockScreenSiteListProvider in LockScreenStatsWidget Update associated type widget data to conform `LockScreenStatsWidgetData` more Update model mapper and view provider to based on lock screen widget data Remove unnecessary `disabled` status from `LockScreenStatsWidgetsView` Remove unnecessary `widgetKind` parameter from `LockScreenStatsWidget` Remove unused statsURL converter from the view model mapper Add home widget data conform lock screen widget data extension to WordPress target for unitTest * Extract widget load data to loader for sharing with lock screen time line provider * Update widget reader to extract the cache read from getSnapshot * Extract noData, noSite, loggedOut, disabled status checking logic to data reader with status callback * Add unitTest for widget data reader Extract cache reading to `HomeWidgetDataFileReader` for mocking the testing object Extract app configuration is jetpack to parameter for mocking the config * Remove multiple space lines * Update multiple callback to Result and enum Error
* Add unconfigured view for lockscreen widget * Add unconfigured view model to view provider and model mapper * Add unconfigured view model unit test * Add background to unconfigured view align with success status widget appearance * Remove todo comments
* Add event key to configuration and pass to trackers in lockscreen widget Expand tracks for lockscreen stats entry Add rectangular widgets count and widgets update of the new widget * Add lockscreen_widget source to deeplink tracked Update statsUrl to widgetUrl for separating the url from homescreen widgets * Update unitTests * Remove separate widget url, move widget source from widget data extension Add widget source type, assign the type in widgetURL in the view * Add widget url source test to verify the converting with DeepLinkSource
Note for reviewers:This is the work done by @tzef. I'm creating the PR due to limited permissions. All the PRs that went into this branch are already reviewed.
|
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr20435-3b8e679 | |
Version | 23.1 | |
Bundle ID | org.wordpress.alpha | |
Commit | 3b8e679 | |
App Center Build | WPiOS - One-Offs #6948 |
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr20435-3b8e679 | |
Version | 23.1 | |
Bundle ID | com.jetpack.alpha | |
Commit | 3b8e679 | |
App Center Build | jetpack-installable-builds #5988 |
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.
All test instructions worked for me. @staskus I noticed that the test Jetpack Build for Testing
still says expected
and has not passed.
👋 @staskus, does this need a review? |
@guarani, thanks for checking. Not now. Every single part of it is already reviewed. I will think if it makes sense to merge it now. It's under the disabled feature flag. Regarding finishing the project. There's a lot of valuable functionality implemented, it could be a small project to add the missing pieces and release it. |
Thanks @staskus! Let me know if I can help with anything. |
Generated by 🚫 dangerJS |
@guarani, I want to merge this PR but it looks like this PR requires another review, although this is already approved. Could you review it? This functionality is behind the feature flag. I want to merge it, and build upon it to include a few more configurations before releasing. |
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.
Hey @staskus, if I understand correctly, I can approve this without reviewing it because it's already been reviewed. Is that correct?
I'm leaving an approval, but if you'd like me to review it (go through the code, test it, etc.) before merging, I'd be happy to do that/
@guarani thanks! Yes, I think it's appropriate. It's all been reviewed and approved. You can test it once the feature flag will be enabled. |
Note:
Description
This is the PR to merge the feature branch into the trunk. All commits are simply merging sub PR into this branch without introducing any new changes. All sub PR have been reviewed and are listed below for reference.
Testing Instructions
Feature flag protect
Given
lockScreenWidget
feature flag disabled, note that this needs to be programmatically changed. It can't be overwritten in the app setting because the widget list updates along with the app installation.Enable
lockScreenWidget
feature flag the following testingsOnly for Jetpack
Build
Jetpack
target for the following testingsWidget Selection (Fresh install or Logged out)
Add to the lock screen
Logged-Out status
LocalizableStrings.unconfiguredViewJetpackTodayTitle
("Log in to Jetpack to see today's stats.") as the same as home screen today widgetRedirection for unconfigured status
No-Sites status
LocalizableStrings.noSiteViewTodayTitle
("Create or add a site to see today's stats.") as the same as home screen today widgetSite-Selected status
Widget Selection (Logged in)
Switch Website
Given the logged-in account with more than one website
Redirection for success status
Widget updated when stats data updated
Can temporarly change the
LockScreenSingleStatView
Text(viewModel.title)
toText(viewModel.updatedTime.mediumStringWithTime())
for easy verification of the update.Widget autorefreshed per 30 mins
Changing system time is not working from my test, and the laptop can't be in sleep mode.
Regression Notes
Potential unintended areas of impact
Home Screen Widgets
What I did to test those areas of impact (or what existing automated tests I relied on)
Add today, this week, and all time widgets to the home screen, all won't be impacted after app updated
After app updated, still able to add today, this week, and all time widgets to the home screen
No matter if
lockScreenWidget
is enabled or disabled, the above two test cases should't be impactedWidgetsViewModelMapperTests
test the view model is correctly converted from the stats data.WidgetDataReaderTests
test the widget status is correctly converted based on the account and website status.WidgetUrlSourceTests
test the widget URL is correct, and the source can be mapped to the right deep link source type for event tracking.PR submission checklist:
RELEASE-NOTES.txt
if necessary.