Skip to content

fix: slow loading Puzzle Themes for offline users#2854

Merged
veloce merged 3 commits into
lichess-org:mainfrom
freebeartogoodhome:freebeartogoodhome-puzzlethemes
Mar 30, 2026
Merged

fix: slow loading Puzzle Themes for offline users#2854
veloce merged 3 commits into
lichess-org:mainfrom
freebeartogoodhome:freebeartogoodhome-puzzlethemes

Conversation

@freebeartogoodhome

Copy link
Copy Markdown
Contributor

Load Puzzle Themes faster for offline users.

Avoid this:
puzzlethemes.webm

Load Puzzle Themes faster for offline users.
I forgot dart format.
@freebeartogoodhome freebeartogoodhome changed the title Update puzzle_themes_screen.dart fix: slow loading Puzzle Themes for offline users Mar 28, 2026

@veloce veloce left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I need more context to understand what is going on here.

Why is it slow when offline? because of a request that times out? then I don't get how this fix would work.

A screen recording where I can see the app offline loads theme fast would be useful too.

Thanks!

}
}

final themesProvider =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's no reason to make it public here.

final connectivity = await ref.watch(connectivityChangesProvider.future);
final savedThemes = await ref.watch(savedThemeBatchesProvider.future);
IMap<PuzzleThemeKey, PuzzleThemeData>? onlineThemes;
class ThemesNotifier

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't understand how turning this in to an AsyncNotifier that has no method would change anything here.

Correcting for PR comments.
@freebeartogoodhome

Copy link
Copy Markdown
Contributor Author

Sorry, about that. I have been gone several years. I am learning flutter and dart. I was playing around with a lot. I fixed it now to just the simple change. I wanted to skip all of those network calls when we knew we were offline. Here is a new video.

newvideo.webm

final connectivity = await ref.watch(connectivityChangesProvider.future);
final savedThemes = await ref.watch(savedThemeBatchesProvider.future);
IMap<PuzzleThemeKey, PuzzleThemeData>? onlineThemes;
if (connectivity.isOnline) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was really just this that I wanted.

@veloce veloce merged commit 4aae3fb into lichess-org:main Mar 30, 2026
1 check passed
@veloce

veloce commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@freebeartogoodhome freebeartogoodhome deleted the freebeartogoodhome-puzzlethemes branch April 13, 2026 21:52
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