From a59967be20a5d456aeb8d7ea86e53c63bbe74ba1 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 15 May 2026 21:41:48 -0400 Subject: [PATCH] fix(offline): move Shuffle all from Home to Library only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Operator: Shuffle-all belongs in the Library view, not the Home app bar. Moved the shuffle IconButton to LibraryScreen's app bar (same behavior — online server-random / offline cache-union via shuffleSourceProvider); reverted Home's app bar to the original MainAppBarActions-only and dropped the now-unused imports. Co-Authored-By: Claude Opus 4.7 (1M context) --- flutter_client/lib/library/home_screen.dart | 25 +------------------ .../lib/library/library_screen.dart | 23 ++++++++++++++++- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/flutter_client/lib/library/home_screen.dart b/flutter_client/lib/library/home_screen.dart index c736a31f..968ed772 100644 --- a/flutter_client/lib/library/home_screen.dart +++ b/flutter_client/lib/library/home_screen.dart @@ -4,9 +4,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import '../api/errors.dart'; -import '../cache/shuffle_source.dart'; import '../cache/tile_providers.dart'; -import '../player/player_provider.dart'; import '../models/playlist.dart'; import '../models/system_playlists_status.dart'; import '../models/track.dart'; @@ -43,28 +41,7 @@ class HomeScreen extends ConsumerWidget { backgroundColor: fs.obsidian, elevation: 0, title: Text('Minstrel', style: TextStyle(color: fs.parchment)), - actions: [ - IconButton( - key: const Key('shuffle_all_button'), - tooltip: 'Shuffle all', - icon: Icon(Icons.shuffle, color: fs.parchment), - onPressed: () async { - final messenger = ScaffoldMessenger.of(context); - final refs = - await ref.read(shuffleSourceProvider).tracks(); - if (refs.isEmpty) { - messenger.showSnackBar(const SnackBar( - content: Text('Nothing to shuffle yet'), - )); - return; - } - await ref - .read(playerActionsProvider) - .playTracks(refs, shuffle: true); - }, - ), - const MainAppBarActions(currentRoute: '/home'), - ], + actions: const [MainAppBarActions(currentRoute: '/home')], ), body: SafeArea( child: index.when( diff --git a/flutter_client/lib/library/library_screen.dart b/flutter_client/lib/library/library_screen.dart index b3e64948..d6cb3a93 100644 --- a/flutter_client/lib/library/library_screen.dart +++ b/flutter_client/lib/library/library_screen.dart @@ -15,6 +15,7 @@ import '../cache/cache_first.dart'; import '../cache/connectivity_provider.dart'; import '../cache/db.dart'; import '../cache/metadata_prefetcher.dart'; +import '../cache/shuffle_source.dart'; import '../cache/tile_providers.dart'; import '../library/library_providers.dart' show dioProvider; import '../models/album.dart'; @@ -377,7 +378,27 @@ class _LibraryScreenState extends ConsumerState backgroundColor: fs.obsidian, elevation: 0, title: Text('Library', style: TextStyle(color: fs.parchment)), - actions: const [MainAppBarActions(currentRoute: '/library')], + actions: [ + IconButton( + key: const Key('shuffle_all_button'), + tooltip: 'Shuffle all', + icon: Icon(Icons.shuffle, color: fs.parchment), + onPressed: () async { + final messenger = ScaffoldMessenger.of(context); + final refs = await ref.read(shuffleSourceProvider).tracks(); + if (refs.isEmpty) { + messenger.showSnackBar(const SnackBar( + content: Text('Nothing to shuffle yet'), + )); + return; + } + await ref + .read(playerActionsProvider) + .playTracks(refs, shuffle: true); + }, + ), + const MainAppBarActions(currentRoute: '/library'), + ], bottom: TabBar( controller: _ctrl, isScrollable: true,