Add a Settings option to reorder the selection action bar's actions
NooSelectionBar's fixed inline slots (3 mobile / 4 desktop, the rest behind "More") previously just took the first N actions in whatever order each screen happened to build them in. Give bulk actions a stable SelectionActionKind identity (independent of their dynamic icon/label, e.g. favorite vs. unfavorite) so Settings can offer a drag-to-reorder list - mirroring the existing Tabs section, minus the pin/hide concept, which doesn't apply here - and each screen applies that saved priority order via orderSelectionActions before handing its action list to the bar.
This commit is contained in:
@@ -14,12 +14,15 @@ import 'package:noo/widgets/noo/lists/noo_tab_order_row.dart';
|
||||
import 'noo_test_utils.dart';
|
||||
|
||||
/// [n] actions labelled A, B, C, ... each incrementing an entry in [taps]
|
||||
/// keyed by its own label when tapped.
|
||||
/// keyed by its own label when tapped. [n] must be at most
|
||||
/// `SelectionActionKind.values.length` - each generated action needs its
|
||||
/// own distinct kind.
|
||||
List<SelectionAction> _actions(int n, Map<String, int> taps) =>
|
||||
List.generate(n, (i) {
|
||||
final label = String.fromCharCode(65 + i);
|
||||
taps[label] = 0;
|
||||
return SelectionAction(
|
||||
kind: SelectionActionKind.values[i],
|
||||
icon: LucideIcons.star,
|
||||
label: label,
|
||||
onTap: () => taps[label] = taps[label]! + 1,
|
||||
|
||||
Reference in New Issue
Block a user