feat: Add settings to control play button visibility on home shelves

This commit introduces new functionality to customize the visibility of the
play button on home page shelves.

Key changes:

- Added `HomePageSettings` to `AppSettings` to store your preferences:
    - `showPlayButtonOnContinueShelves`: Controls visibility on "Continue Listening" and "Continue Series" shelves (default: true).
    - `showPlayButtonOnAllShelves`: Controls visibility on other shelves (default: false).
- Modified `BookHomeShelf` to respect these settings when rendering books.
- Created a new "Home Page Settings" page under "Appearance" in App Settings, allowing you to toggle these two options.
- Added comprehensive unit and widget tests to cover the new settings model, the conditional logic in `BookHomeShelf`, and the functionality of the new settings page.
This commit is contained in:
google-labs-jules[bot] 2025-05-22 00:44:06 +00:00
parent 23e5d73bea
commit cc9a94de62
9 changed files with 457 additions and 0 deletions

View file

@ -32,6 +32,16 @@ class BookHomeShelf extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final appSettings = ref.watch(appSettingsProvider);
final homePageSettings = appSettings.homePageSettings;
final bool showPlayButton;
if (title == 'Continue Listening' || title == 'Continue Series') {
showPlayButton = homePageSettings.showPlayButtonOnContinueShelves;
} else {
showPlayButton = homePageSettings.showPlayButtonOnAllShelves;
}
return SimpleHomeShelf(
title: title,
children: shelf.entities
@ -41,6 +51,7 @@ class BookHomeShelf extends HookConsumerWidget {
item: item,
key: ValueKey(shelf.id + item.id),
heroTagSuffix: shelf.id,
showPlayButton: showPlayButton,
),
_ => Container(),
},