From 852f9da7030d76d26f4cb351949df2bb8caf057d Mon Sep 17 00:00:00 2001 From: flemming-it Date: Thu, 18 Jun 2026 13:18:30 +0200 Subject: [PATCH] =?UTF-8?q?fix(ui):=20sort=20evaluations=20by=20SKM=20?= =?UTF-8?q?=E2=82=AC/year=20descending?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repository.list() now hands the UI a list sorted by the harm proxy (Studie §6 SKM-€/Jahr). Most-harmful first, deterministic across launches and across mock-vs-hub repositories. Removes the perceived non-determinism in the Norms list and gives the heatmap chip-wrap a politically meaningful first row. Signed-off-by: flemming-it --- app/lib/data/repository.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/lib/data/repository.dart b/app/lib/data/repository.dart index 1ef272b..9dabf48 100644 --- a/app/lib/data/repository.dart +++ b/app/lib/data/repository.dart @@ -19,8 +19,17 @@ abstract class EvaluationRepository { class MockRepository implements EvaluationRepository { const MockRepository(); + /// Sorted copy of [Fixtures.evaluations], most-harmful first + /// (Studie §6 SKM-€/Jahr as harm proxy). The sort is in + /// repository.list() rather than the fixture declaration so + /// future Hub-fed lists stay consistent without re-tuning the + /// UI. @override - Future> list() async => Fixtures.evaluations; + Future> list() async { + final sorted = [...Fixtures.evaluations]; + sorted.sort((a, b) => b.skmEurPerYear.compareTo(a.skmEurPerYear)); + return sorted; + } @override Future byEli(String eli) async {