mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-29 04:42:02 +02:00
fix(metadata): clarify online autofill controls
This commit is contained in:
@@ -2415,20 +2415,20 @@ class _EditMetadataSheetState extends State<_EditMetadataSheet> {
|
||||
);
|
||||
},
|
||||
),
|
||||
Row(
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
_quickSelectButton(
|
||||
label: context.l10n.editMetadataSelectAll,
|
||||
onTap: _selectAllFields,
|
||||
cs: cs,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_quickSelectButton(
|
||||
label: context.l10n.editMetadataSelectEmpty,
|
||||
onTap: _selectEmptyFields,
|
||||
cs: cs,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_quickSelectButton(
|
||||
label: context.l10n.editMetadataSelectNone,
|
||||
onTap: _selectNoFields,
|
||||
@@ -2438,8 +2438,8 @@ class _EditMetadataSheetState extends State<_EditMetadataSheet> {
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Wrap(
|
||||
spacing: 6,
|
||||
runSpacing: 4,
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: _fieldDefs.keys.map((key) {
|
||||
final selected = _autoFillFields.contains(key);
|
||||
if (context.isMornye) {
|
||||
@@ -2447,8 +2447,9 @@ class _EditMetadataSheetState extends State<_EditMetadataSheet> {
|
||||
label: _fieldLabel(key),
|
||||
selected: selected,
|
||||
glass: false,
|
||||
tonal: false,
|
||||
icon: selected ? CupertinoIcons.checkmark : null,
|
||||
icon: selected
|
||||
? CupertinoIcons.checkmark_circle_fill
|
||||
: CupertinoIcons.circle,
|
||||
onTap: _fetching
|
||||
? null
|
||||
: () => setState(() {
|
||||
@@ -2476,13 +2477,12 @@ class _EditMetadataSheetState extends State<_EditMetadataSheet> {
|
||||
}
|
||||
});
|
||||
},
|
||||
backgroundColor: cs.surfaceContainerHigh,
|
||||
selectedColor: cs.primaryContainer,
|
||||
checkmarkColor: cs.onPrimaryContainer,
|
||||
labelStyle: Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||
labelStyle: Theme.of(context).textTheme.labelMedium?.copyWith(
|
||||
color: selected ? cs.onPrimaryContainer : cs.onSurfaceVariant,
|
||||
),
|
||||
visualDensity: VisualDensity.compact,
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
@@ -2490,7 +2490,6 @@ class _EditMetadataSheetState extends State<_EditMetadataSheet> {
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: AppActionButton(
|
||||
outlined: context.isMornye,
|
||||
glass: false,
|
||||
onPressed: (_fetching || _saving || _autoFillFields.isEmpty)
|
||||
? null
|
||||
@@ -2528,10 +2527,12 @@ class _EditMetadataSheetState extends State<_EditMetadataSheet> {
|
||||
child: AppActionButton(
|
||||
outlined: true,
|
||||
glass: false,
|
||||
tonal: true,
|
||||
onPressed: (_fetching || _fetchingMusicBrainz || _saving)
|
||||
? null
|
||||
: _fetchFromMusicBrainz,
|
||||
style: OutlinedButton.styleFrom(
|
||||
backgroundColor: cs.surfaceContainerHigh,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
|
||||
@@ -20,6 +20,7 @@ import 'package:spotiflac_android/widgets/app_alert_dialog.dart';
|
||||
import 'package:spotiflac_android/widgets/app_switch.dart';
|
||||
import 'package:spotiflac_android/widgets/batch_convert_sheet.dart';
|
||||
import 'package:spotiflac_android/widgets/mornye_context_menu.dart';
|
||||
import 'package:spotiflac_android/widgets/mornye_chrome.dart';
|
||||
import 'package:spotiflac_android/widgets/re_enrich_field_dialog.dart';
|
||||
import 'package:spotiflac_android/widgets/selection_action_button.dart';
|
||||
import 'package:spotiflac_android/widgets/selection_bottom_bar.dart';
|
||||
@@ -339,6 +340,28 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Edited track'), findsOneWidget);
|
||||
expect(find.widgetWithText(AppActionButton, 'Save'), findsOneWidget);
|
||||
await tester.scrollUntilVisible(
|
||||
find.text('Auto-fill from online'),
|
||||
-250,
|
||||
scrollable: find
|
||||
.descendant(
|
||||
of: find.byType(ListView).last,
|
||||
matching: find.byType(Scrollable),
|
||||
)
|
||||
.first,
|
||||
);
|
||||
await _tapVisible(tester, find.text('Auto-fill from online'));
|
||||
await _tapVisible(tester, find.text('None'));
|
||||
final search = find.widgetWithText(AppActionButton, 'Find metadata');
|
||||
expect(tester.widget<AppActionButton>(search).onPressed, isNull);
|
||||
await _tapVisible(tester, find.text('All'));
|
||||
expect(tester.widget<AppActionButton>(search).onPressed, isNotNull);
|
||||
expect(
|
||||
tester
|
||||
.widgetList<MornyeFilterChip>(find.byType(MornyeFilterChip))
|
||||
.every((chip) => chip.selected),
|
||||
isTrue,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user