Skip to content

Comments

feat: add tip to customize home screen widgets#2571

Merged
veloce merged 4 commits intolichess-org:mainfrom
tom-anders:customizeHomeWidgetsTile
Jan 27, 2026
Merged

feat: add tip to customize home screen widgets#2571
veloce merged 4 commits intolichess-org:mainfrom
tom-anders:customizeHomeWidgetsTile

Conversation

@tom-anders
Copy link
Collaborator

(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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@tom-anders tom-anders force-pushed the customizeHomeWidgetsTile branch from 8a39170 to eab5582 Compare January 25, 2026 13:17
@veloce veloce force-pushed the customizeHomeWidgetsTile branch from eab5582 to 5fc078c Compare January 26, 2026 10:19
@veloce
Copy link
Contributor

veloce commented Jan 26, 2026

I rebased the branch to main to fix tests @tom-anders

Copy link
Contributor

@veloce veloce left a comment

Choose a reason for hiding this comment

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

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(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't get the reason of the changes in this block, can you explain? thx

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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.

@tom-anders
Copy link
Collaborator Author

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

Ah sorry, should've added these right away. I think I covered all scenarios you mentioned now 👍

@tom-anders tom-anders force-pushed the customizeHomeWidgetsTile branch from b323fe8 to ae2cfb9 Compare January 26, 2026 15:32
@tom-anders tom-anders force-pushed the customizeHomeWidgetsTile branch from ae2cfb9 to b9c039c Compare January 26, 2026 15:41
final prefs = LichessBinding.instance.sharedPreferences;

return prefs.getBool(kHideHomeWidgetCustomizationTip) != true &&
LichessBinding.instance.numAppStarts <= 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah looks like I wasn't fast enough, thanks for taking care of it :D

@veloce veloce merged commit 66d4ad4 into lichess-org:main Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants