feat(ui): inline the normative text + open-source URL

Adds the actual paragraphs of the law right next to the
evaluation panel on the norm-detail page. A reviewer no longer
has to leave the app to confirm what a score is about; the
canonical source URL stays one click away via 'Im Browser
öffnen' (url_launcher) and one click away as a clipboard copy.

Schema

  models.dart gains a NormParagraph (number + text). Norm carries
  a List<NormParagraph> paragraphs, defaulted to const [] so
  norms harvested by text.akoma_normalize@^0 in live mode slot
  in without breaking the Mock path.

Demo data

  fixtures.dart embeds the public source paragraphs verbatim
  under §5 UrhG (amtliche Werke) for the five pilot norms.

Plumbing

  NormTextCard (lib/widgets/norm_text_card.dart) is the renderer:
  per-paragraph hanging label, selectable body text, source URL
  in mono at the bottom, two action buttons. NormDetailPage
  drops the card between the metric row and the duties card so
  the eye lands on it during a 'why this score?' read-through.

macOS sandbox

  The Release entitlement file gains
  com.apple.security.network.client so url_launcher's NSWorkspace
  call and the HubRepository's gRPC channel can both reach the
  network. The DebugProfile already had server; client matches
  the production posture.

  GeneratedPluginRegistrant.swift was re-generated by
  flutter pub get after url_launcher was added — no hand edits.

flutter analyze: clean. flutter test: 2/2 passing. The macOS
build via build-macos.sh launches and the new card renders the
GewO § 14, KassenSichV, DSGVO Art. 30, BauO Bln § 60 ff and
MiLoG § 17 fixtures with their actual normative text.

Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
flemming-it 2026-06-18 13:43:22 +02:00
parent e08cedcd3f
commit 116310b65b
7 changed files with 337 additions and 33 deletions

View file

@ -1,4 +1,4 @@
// Domain model for the FI Law-Heatmap client.
// Domain model for the FI ReclIm client.
//
// These types are the lingua franca between the (eventually
// gRPC-fed) repository and the UI. Names mirror the Studie's
@ -75,6 +75,16 @@ class Duty {
final String? consequence;
}
/// One Absatz/paragraph of the actual normative text.
class NormParagraph {
const NormParagraph({required this.number, required this.text});
/// Source numbering as it appears, e.g. "(1)", "(2a)". Empty
/// when the source has no Absatz numbering.
final String number;
final String text;
}
/// One norm version a versioned legal text identified by its
/// (synthetic for now) ELI/CELEX.
class Norm {
@ -86,6 +96,7 @@ class Norm {
required this.standDate,
required this.sourceUrl,
required this.sourceSha256,
this.paragraphs = const [],
});
final String eli;
@ -95,6 +106,12 @@ class Norm {
final DateTime standDate;
final String sourceUrl;
final String sourceSha256;
/// The actual paragraphs of the norm text, normalised by
/// `text.akoma_normalize` in live mode. In demo mode the
/// fixture quotes the public source verbatim under §5 UrhG
/// (amtliche Werke).
final List<NormParagraph> paragraphs;
}
/// A heatmap point: one norm with its computed scores.