This commit is contained in:
Forrest 2026-07-29 15:28:11 -04:00
parent d205277cdd
commit d1cab09a4f
9 changed files with 850 additions and 140 deletions

View file

@ -6,6 +6,7 @@ import '../screens/browser_screen.dart';
import '../screens/connect_sheet.dart';
import '../screens/home_screen.dart';
import '../screens/now_playing_screen.dart';
import '../screens/settings_screen.dart';
import '../state/providers.dart';
import '../theme/tokens.dart';
import '../widgets/mini_player.dart';
@ -52,6 +53,12 @@ class _AppShellState extends ConsumerState<AppShell> {
// Keep favorites alive from launch so its connect/disconnect listener runs
// and hydrates stars/ratings as soon as a server connects.
ref.watch(favoritesProvider);
// Instantiate the download + playlist stores at launch too, so their
// per-server manifests load from disk before the user can trigger
// playback — otherwise the first play right after a cold (offline) boot
// races the async manifest load and misses a downloaded file.
ref.watch(downloadManagerProvider);
ref.watch(playlistsProvider);
final index = ref.watch(selectedTabProvider);
return PopScope(
@ -189,27 +196,53 @@ class _StatusBar extends ConsumerWidget {
ConnStatus.disconnected => ('○', 'tap to connect', RatuneColors.dimmed),
};
return InkWell(
onTap: () => showConnectSheet(context),
child: Container(
height: 22,
padding: const EdgeInsets.symmetric(horizontal: RatuneSpacing.lg),
color: RatuneColors.surface,
child: Row(
children: [
Text('$glyph ', style: TextStyle(color: color)),
Expanded(
child: Text(
label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: color),
return Container(
height: 22,
color: RatuneColors.surface,
child: Row(
children: [
// Left: connection status — tap to open the connect sheet.
Expanded(
child: InkWell(
onTap: () => showConnectSheet(context),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: RatuneSpacing.lg),
child: Row(
children: [
Text('$glyph ', style: TextStyle(color: color)),
Expanded(
child: Text(
label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: color),
),
),
],
),
),
),
const SizedBox(width: RatuneSpacing.md),
const Text('i — help', style: TextStyle(color: RatuneColors.dimmed)),
],
),
),
// Right: settings — pushes over the whole shell (root navigator).
InkWell(
onTap: () => Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const SettingsScreen()),
),
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: RatuneSpacing.lg),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.settings, size: 12, color: RatuneColors.dimmed),
SizedBox(width: RatuneSpacing.xs),
Text('settings',
style: TextStyle(color: RatuneColors.dimmed)),
],
),
),
),
],
),
);
}