feat(flutter): refresh kebab on system playlist cards (#416 parity)
Closes the Flutter half of Fable #416. Web got a generalized system-playlist refresh kebab in d12afda; this brings Flutter to parity instead of leaving the affordance web-only. - PlaylistsApi.refreshSystem(variant): POST /api/playlists/system/{for-you|discover}/refresh, maps the underscore model variant to the hyphenated route segment, returns the rotated playlist id. - PlaylistCard: top-right PopupMenuButton on system playlists with a context-labelled "Refresh For You" / "Refresh Discover" item. Calls refreshSystem, invalidates playlistsListProvider (which reconciles the rotated UUID + new tracks), snackbars the result. ScaffoldMessenger captured pre-await. - Tests: kebab present for system, absent for user playlists. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -55,4 +55,24 @@ void main() {
|
||||
expect(find.text('For You'), findsOneWidget);
|
||||
expect(find.text('for you'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('shows refresh kebab on system playlists', (tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
theme: buildThemeData(),
|
||||
home: const Scaffold(
|
||||
body: PlaylistCard(playlist: _forYou),
|
||||
),
|
||||
));
|
||||
expect(find.byIcon(Icons.more_vert), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('no refresh kebab on user playlists', (tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
theme: buildThemeData(),
|
||||
home: const Scaffold(
|
||||
body: PlaylistCard(playlist: _userPlaylist),
|
||||
),
|
||||
));
|
||||
expect(find.byIcon(Icons.more_vert), findsNothing);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user