feat: add tip to customize home screen widgets#2571
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a dismissible tip widget to the home screen to help users discover the home screen customization feature (quick game matrix, widgets, etc.). The tip appears for new users during the first few app starts and can be dismissed either by interacting with it or by tapping "Dismiss." The PR also includes fixes to ensure the welcome screen elements are only shown when not in edit mode.
Changes:
- Adds app start counter to LichessBinding to track cold app starts
- Implements _HomeCustomizationTip widget that shows for up to 3 app starts
- Adds two new localization strings (mobileCustomizeHomeTip and mobileCustomizeHomeTipDismiss)
- Fixes welcome screen to hide certain elements when in edit mode
Reviewed changes
Copilot reviewed 56 out of 56 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/binding.dart | Adds numAppStarts getter and app start counter implementation |
| test/binding.dart | Overrides numAppStarts to return 0 for tests |
| lib/src/view/home/home_tab_screen.dart | Implements _HomeCustomizationTip widget and integrates it into home screen; fixes edit mode visibility issues |
| translation/source/mobile.xml | Adds source strings for the customization tip |
| lib/l10n/app_en.arb | Adds English translations for tip strings |
| lib/l10n/l10n.dart | Adds abstract getters for new localization strings |
| lib/l10n/l10n_*.dart (48 files) | Adds placeholder English text for all language localizations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8a39170 to
eab5582
Compare
eab5582 to
5fc078c
Compare
|
I rebased the branch to main to fix tests @tom-anders |
veloce
left a comment
There was a problem hiding this comment.
This is nice, thank you!
I'd like to have tests for this, since it should be easy to write them (you can override the number of cold app start in testBindings easily).
Test scenarios to check:
- in case cold app starts < 3:
- should be shown when not logged in
- should be shown even if the welcome message is not shown anymore (games were played or logged in)
- should be shown when logged in
- should be dismissed after going to settings
- when cold app start >= 3
- should not be shown
|
|
||
| if (shouldShowWelcomeScreen) { | ||
| final welcomeWidgets = [ | ||
| const _GreetingWidget(), |
There was a problem hiding this comment.
Don't get the reason of the changes in this block, can you explain? thx
There was a problem hiding this comment.
These are two separate bugfixes/commits:
- a4b7560 -> The "Hello XY" widget is editable when logged in, but not if you're logged out. The commit makes it editable when logged out as well
- d1c90cb -> The welcome widgets ("lichess is a free...", sign-in-button, about-button) are currently shown when the home screen is in edit mode. I think this is a bit confusing, especially when new users enter this screen via the new tip widget. So this commits hides them in edit mode.
Ah sorry, should've added these right away. I think I covered all scenarios you mentioned now 👍 |
b323fe8 to
ae2cfb9
Compare
ae2cfb9 to
b9c039c
Compare
| final prefs = LichessBinding.instance.sharedPreferences; | ||
|
|
||
| return prefs.getBool(kHideHomeWidgetCustomizationTip) != true && | ||
| LichessBinding.instance.numAppStarts <= 3; |
There was a problem hiding this comment.
Can you extract this to a kColdAppStartsHideCustomizationTipThreshold (or better name if you have) constant?
Then you can use this constant in tests and we can change it. Perhaps we should set it to 5, wdyt?
There was a problem hiding this comment.
ah looks like I wasn't fast enough, thanks for taking care of it :D
(Plus two small fixes to the "edit home" screen when not logged it.)
Main intention is to make the quick game matrix more discoverable, especially for users coming from the website or the old app. But in general this feature is too cool for it to be hidden in the settings, so I think it's a good thing to make it more discoverable :)
If the user does not interact with this widget for more than 3 cold app starts, we do not show it anymore.
Otherwise, pressing the "Settings" or "Dismiss" button hides it forever as well.
customize.webm