chart improvements, synch working

This commit is contained in:
davmar
2026-09-09 23:31:30 +02:00
parent e35a4d6893
commit 91d6dc9e54
4 changed files with 144 additions and 103 deletions
+15 -6
View File
@@ -790,15 +790,24 @@ class TxMetaController extends ChangeNotifier {
return false;
}
/// OR filter: any selected label, and/or unlabeled when uncategorized is selected.
/// AND filter: every selected label must be on the tx.
///
/// Uncategorized alone matches unlabeled txs. Uncategorized combined with
/// other labels matches nothing (a tx cannot be both).
bool _matchesLabelFilter(TxMeta meta, Set<String> labelIds) {
final wantUncategorized = labelIds.contains(kUncategorizedFilterId);
if (wantUncategorized && !meta.hasLabel) return true;
for (final id in labelIds) {
if (id == kUncategorizedFilterId) continue;
if (meta.labelIds.contains(id)) return true;
final required = <String>[
for (final id in labelIds)
if (id != kUncategorizedFilterId) id,
];
if (wantUncategorized) {
if (required.isNotEmpty) return false;
return !meta.hasLabel;
}
return false;
for (final id in required) {
if (!meta.labelIds.contains(id)) return false;
}
return true;
}
/// Labels currently used by [transactions].