feat(auto): page local-music folders instead of truncating at 50 [size:exception]
Folders over the 50-item cap now show a "Mas..." item that reveals the next page on tap, instead of silently dropping the rest. Paging slices the cheap raw list before building any MediaItem, so items beyond the requested page are never resolved (art, title) -- proven by a call-count test. Also swaps the raw SAF content:// URI shown in settings for a parsed, human-readable folder name with a localized fallback across all 13 locales. servicio_audio.dart is untouched; this stays entirely within the local-music tree/dispatch layer.
This commit is contained in:
@@ -511,6 +511,63 @@ void main() {
|
||||
expect(fakeDispositivo.solicitarPermisoBluetoothCalls, equals(1));
|
||||
});
|
||||
});
|
||||
|
||||
// ── android-auto-local-music-paging Phase 7: friendly folder name ────────
|
||||
|
||||
group('_SeccionMusicaLocal — friendly folder name (Phase 7)', () {
|
||||
testWidgets(
|
||||
'7.1-A: carpeta configurada muestra el nombre amigable derivado de '
|
||||
'la URI, nunca la URI cruda',
|
||||
(tester) async {
|
||||
SharedPreferences.setMockInitialValues({
|
||||
'musica_local_uri':
|
||||
'content://com.android.externalstorage.documents/tree/'
|
||||
'primary%3AMusic%2FMyFolder',
|
||||
});
|
||||
setLargeSurface(tester);
|
||||
_suppressListTileInkAssertion();
|
||||
final estado = await crearEstado();
|
||||
addTearDown(estado.dispose);
|
||||
|
||||
await tester.pumpWidget(buildAjustes(estado));
|
||||
await pumpStable(tester);
|
||||
|
||||
await tester.scrollUntilVisible(
|
||||
find.text('Local music folder'),
|
||||
300,
|
||||
scrollable: find.byType(Scrollable).first,
|
||||
);
|
||||
await pumpStable(tester);
|
||||
|
||||
expect(find.text('MyFolder'), findsOneWidget);
|
||||
expect(find.textContaining('content://'), findsNothing);
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets(
|
||||
'7.1-B: sin carpeta configurada mantiene el mensaje '
|
||||
'localMusicFolderNotConfigured',
|
||||
(tester) async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
setLargeSurface(tester);
|
||||
_suppressListTileInkAssertion();
|
||||
final estado = await crearEstado();
|
||||
addTearDown(estado.dispose);
|
||||
|
||||
await tester.pumpWidget(buildAjustes(estado));
|
||||
await pumpStable(tester);
|
||||
|
||||
await tester.scrollUntilVisible(
|
||||
find.text('Local music folder'),
|
||||
300,
|
||||
scrollable: find.byType(Scrollable).first,
|
||||
);
|
||||
await pumpStable(tester);
|
||||
|
||||
expect(find.text('No folder selected'), findsOneWidget);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// ── Infrastructure ──────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user