From 6c8ef32a115bddc2084c1b1894edcade23f787a9 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Mon, 5 Oct 2026 12:03:54 +0200 Subject: [PATCH] =?UTF-8?q?fix(#173):=20motif=20de=20refus=20plus=20visibl?= =?UTF-8?q?e=20sur=20les=20cong=C3=A9s=20refus=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Affiche « Motif : … » pour les co-parents (réponse API ou payload), et retire la capture flutter_01.png locale. Co-authored-by: Cursor --- frontend/lib/models/carte_bulle.dart | 9 +++++++++ frontend/lib/widgets/quotidien/cartes_feed.dart | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/lib/models/carte_bulle.dart b/frontend/lib/models/carte_bulle.dart index c4ab82d..fbc3b94 100644 --- a/frontend/lib/models/carte_bulle.dart +++ b/frontend/lib/models/carte_bulle.dart @@ -84,6 +84,15 @@ class CarteBulle { String? get dateFin => payload['date_fin']?.toString(); String? get motif => payload['motif']?.toString(); + /// Motif de refus : réponse API, sinon motif payload (co-parent / reload). + String? get motifRefus { + final fromResponse = lastRefuseComment?.trim(); + if (fromResponse != null && fromResponse.isNotEmpty) return fromResponse; + final fromPayload = motif?.trim(); + if (fromPayload != null && fromPayload.isNotEmpty) return fromPayload; + return null; + } + /// Libellé UI (sémantique produit) — pas le titre brut API. String get titreAffiche { switch (typeCode) { diff --git a/frontend/lib/widgets/quotidien/cartes_feed.dart b/frontend/lib/widgets/quotidien/cartes_feed.dart index 7cfe7ff..91158e0 100644 --- a/frontend/lib/widgets/quotidien/cartes_feed.dart +++ b/frontend/lib/widgets/quotidien/cartes_feed.dart @@ -592,16 +592,16 @@ class _BulleTile extends StatelessWidget { ], if (card.isCongeAm && card.statut == CarteStatut.refusee && - card.lastRefuseComment != null && - card.lastRefuseComment!.trim().isNotEmpty) ...[ + card.motifRefus != null) ...[ const SizedBox(height: 8), Text( - 'Motif : ${card.lastRefuseComment}', - maxLines: 2, + 'Motif : ${card.motifRefus}', + maxLines: 4, overflow: TextOverflow.ellipsis, style: GoogleFonts.merriweather( - fontSize: 12, + fontSize: 13, fontStyle: FontStyle.italic, + height: 1.3, color: encre.ink, ), ),