feat(ui): show SKM component-tier summary on the Normen list

Each Evaluation grows a componentSummary field — a small list of
plain strings, one per SKM ingredient (P / F / T / h), tagged
with its tier in the form 'P · T1 — DESTATIS Gewerbeanzeigen'.
The fixtures fill it in for all five pilot norms; the field
defaults to an empty list so flow-produced Evaluations remain
backwards-compatible until a future flow step writes one.

NormsListPage re-arranges the row to make use of the wide-screen
real-estate on the right that used to sit empty:

  ┌─────────────────────────────────────────────────────────────┐
  │  GewO § 14 — Anzeigepflicht  │ Schaden    │ Komponenten      │
  │  eli/bund/gewo/14             │ 2.8 Mio €  │ P · T1 …         │
  │  [T1 · amtlich]               │ Nutzen     │ F · T1 …         │
  │                               │ 2.5 / 5    │ T · T1 …         │
  │                               │ Betroffene │ h · T3 …         │
  │                               │ 180 k      │                  │
  └─────────────────────────────────────────────────────────────┘

The TierBadge moved into the title column (right under the eli)
so the eye lands on the tier of the figure right where the
figure's identity is named. The three metric columns stack
vertically (no more horizontal-only row) which leaves the right
third of the row free for the componentSummary lines — the
information a reviewer was always asking for ('which Komponente
is the bottleneck here?') is now visible without opening the
detail page.

Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
flemming-it 2026-06-18 15:06:33 +02:00
parent c6400302dd
commit ae9fc45177
3 changed files with 104 additions and 15 deletions

View file

@ -107,31 +107,42 @@ class _NormRow extends StatelessWidget {
color: ReclaimColors.mute,
),
),
const SizedBox(height: ReclaimSpace.sm),
TierBadge(tier: evaluation.tierLowest),
],
),
),
const SizedBox(width: ReclaimSpace.lg),
Expanded(
child: _MetricColumn(
label: 'Schaden / Jahr',
value: _eur(evaluation.skmEurPerYear),
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_MetricColumn(
label: 'Schaden / Jahr',
value: _eur(evaluation.skmEurPerYear),
),
const SizedBox(height: ReclaimSpace.sm),
_MetricColumn(
label: 'Nutzen',
value:
'${evaluation.benefitScore.toStringAsFixed(1)} / 5',
),
const SizedBox(height: ReclaimSpace.sm),
_MetricColumn(
label: 'Betroffene',
value: _kmu(evaluation.affectedCount),
),
],
),
),
const SizedBox(width: ReclaimSpace.lg),
Expanded(
child: _MetricColumn(
label: 'Nutzen',
value:
'${evaluation.benefitScore.toStringAsFixed(1)} / 5',
flex: 3,
child: _ComponentSummary(
summary: evaluation.componentSummary,
),
),
Expanded(
child: _MetricColumn(
label: 'Betroffene',
value: _kmu(evaluation.affectedCount),
),
),
const SizedBox(width: ReclaimSpace.md),
TierBadge(tier: evaluation.tierLowest),
],
),
),
@ -152,6 +163,44 @@ class _NormRow extends StatelessWidget {
}
}
class _ComponentSummary extends StatelessWidget {
const _ComponentSummary({required this.summary});
final List<String> summary;
@override
Widget build(BuildContext context) {
final t = Theme.of(context).textTheme;
if (summary.isEmpty) {
return Text(
'',
style: t.labelSmall?.copyWith(color: ReclaimColors.mute),
);
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Komponenten',
style: t.labelSmall?.copyWith(color: ReclaimColors.mute),
),
const SizedBox(height: 4),
for (final line in summary)
Padding(
padding: const EdgeInsets.only(bottom: 2),
child: Text(
line,
style: t.bodyLarge?.copyWith(
height: 1.35,
fontSize: 12.5,
),
),
),
],
);
}
}
class _MetricColumn extends StatelessWidget {
const _MetricColumn({required this.label, required this.value});