Lock Screen Widgets: Create Two Field Widget - #21493
Conversation
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21493-b1f1f23 | |
| Version | 23.1 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | b1f1f23 | |
| App Center Build | WPiOS - One-Offs #6957 |
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21493-b1f1f23 | |
| Version | 23.1 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | b1f1f23 | |
| App Center Build | jetpack-installable-builds #5999 |
|
You can see in this draft PR #21495 how more configurations are added, and how they would look. I provided the video. With more configurations, I also found some issues with labels fitting when both numbers are in the hundreds of thousands, and titles do not always fit as well. I will look for more clever ways to ensure they fit since setting lower |
guarani
left a comment
There was a problem hiding this comment.
I couldn't get the widgets to show up on my device and I'm not sure why. I enabled the feature flag.
However, since I also tried a brand new test project with a sample lock screen widget and it didn't show up there, it might be an issue with my setup. I ran the Jetpack target but no luck today.
I'll come back to this tomorrow 👋
Generated by 🚫 dangerJS |
- Using allowsTightening flag to fit more text for the same font size - Adding Spacers so widgets with different font sizes have elements aligned at the same positions - Adding manual font size calculation for multi-field widget so both Text fields would have same font size when the value is longer
|
Made additional improvements to make sure widget elements are aligned and consistent with different font sizes switch.between.widget.sizes.mov |
guarani
left a comment
There was a problem hiding this comment.
👋 I was able to get this working by removing the feature flag (see discussion in p1694005726199069-slack-C441E3YTS where we found that feature flags were not working in extensions).
Happy Path testing
This worked great 👍 I tested with a couple of sites.
Logged Out testing
I saw the message asking me to log in here.
No Sites testing
(There might be a typo because this is called "Logged out" testing above). Otherwise this worked and I saw the message asking me to create a site.
I noticed a few scenarios where the widgets got "stuck" showing an outdated message. For example:
- Log out of the app and notice the app shows the "Log in..." message as expected
- Log in again and the Views widget shows data but the Likes & Comments one is stuck on the log in message
- Log out and log in to a different account with no sites, notice both widgets showing incorrect info: the Views one shows data for the previously logged in site (although this seems to correct itself after a minute) and the Likes & Comments one shows a Log in message
These are all fixed by re-adding the widgets, and I'm not sure they're blockers for this PR but may be good to look into before shipping.
|
@guarani thanks for testing!
Adding it to the todo list to check! |


Fixes #21489
Description
LockScreenMultiStatViewto show two fields, reusing elements fromLockScreenSingleStatViewLockScreenMultiStatWidgetViewProviderthat configures all the states of the multi-stat widget, made providers more generic to support different types ofHomeWidgetDataLockScreenTodayLikesCommentsStatWidgetConfig, to addLikes and CommentswidgetI plan to add more single and multi-field widgets in other PRs. For now, added one for Likes and Comments
To test:
Happy Path
Logged out
No site
Regression Notes
Breaking single stat widget
Manual testing, running unit-tests
None
PR submission checklist:
RELEASE-NOTES.txtif necessary.UI Changes testing checklist:
Images