diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 43dad01..76d4382 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -1014,7 +1014,8 @@ "approvalsPillApproved": "freigegeben", "approvalsPillRejected": "abgelehnt", "approvalsPillExpired": "abgelaufen", - "approvalsPayloadPreview": "DIESE DATEN WERDEN FREIGEGEBEN", + "approvalsPayloadPreview": "ZU PRÜFENDE DATEN", + "approvalsNoPayload": "Keine Daten zum Prüfen angehängt. Der system.approval-Schritt des Flows bestimmt über sein \"show:\"-Feld, was angezeigt wird — setze es, um die Daten hinter dieser Entscheidung sichtbar zu machen.", "approvalsRequestFallback": "Freigabe für diesen Schritt erforderlich", "approvalsFlowStepMeta": "Flow: {flow} · Schritt: {step}", "approvalsApproveButton": "Freigeben", diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index ad016b5..45f0e53 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -1027,7 +1027,8 @@ "approvalsPillApproved": "approved", "approvalsPillRejected": "rejected", "approvalsPillExpired": "expired", - "approvalsPayloadPreview": "DATA TO BE RELEASED", + "approvalsPayloadPreview": "DATA TO REVIEW", + "approvalsNoPayload": "No data was attached for review. The flow's approval step chooses what to show via its \"show:\" field — set it to surface the data behind this decision.", "approvalsRequestFallback": "Approval required for this step", "approvalsFlowStepMeta": "Flow: {flow} · Step: {step}", "@approvalsFlowStepMeta": { diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 524f5ff..c1410f0 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -3065,9 +3065,15 @@ abstract class AppLocalizations { /// No description provided for @approvalsPayloadPreview. /// /// In en, this message translates to: - /// **'DATA TO BE RELEASED'** + /// **'DATA TO REVIEW'** String get approvalsPayloadPreview; + /// No description provided for @approvalsNoPayload. + /// + /// In en, this message translates to: + /// **'No data was attached for review. The flow\'s approval step chooses what to show via its \"show:\" field — set it to surface the data behind this decision.'** + String get approvalsNoPayload; + /// No description provided for @approvalsRequestFallback. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index ca28652..ee21fb7 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -1767,7 +1767,11 @@ class AppLocalizationsDe extends AppLocalizations { String get approvalsPillExpired => 'abgelaufen'; @override - String get approvalsPayloadPreview => 'DIESE DATEN WERDEN FREIGEGEBEN'; + String get approvalsPayloadPreview => 'ZU PRÜFENDE DATEN'; + + @override + String get approvalsNoPayload => + 'Keine Daten zum Prüfen angehängt. Der system.approval-Schritt des Flows bestimmt über sein \"show:\"-Feld, was angezeigt wird — setze es, um die Daten hinter dieser Entscheidung sichtbar zu machen.'; @override String get approvalsRequestFallback => diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 6b961b5..606c3f1 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -1777,7 +1777,11 @@ class AppLocalizationsEn extends AppLocalizations { String get approvalsPillExpired => 'expired'; @override - String get approvalsPayloadPreview => 'DATA TO BE RELEASED'; + String get approvalsPayloadPreview => 'DATA TO REVIEW'; + + @override + String get approvalsNoPayload => + 'No data was attached for review. The flow\'s approval step chooses what to show via its \"show:\" field — set it to surface the data behind this decision.'; @override String get approvalsRequestFallback => 'Approval required for this step'; diff --git a/lib/pages/approvals.dart b/lib/pages/approvals.dart index 2a091a3..e13e168 100644 --- a/lib/pages/approvals.dart +++ b/lib/pages/approvals.dart @@ -585,19 +585,44 @@ class _ApprovalCard extends StatelessWidget { ), ], ), - if (approval.payloadPreview != null) ...[ - const SizedBox(height: ChainSpace.md), - Padding( - padding: const EdgeInsets.only(bottom: 4), - child: Text( - l.approvalsPayloadPreview, - style: theme.textTheme.labelSmall?.copyWith( - color: theme.colorScheme.onSurfaceVariant, - letterSpacing: 0.6, - fontSize: 10, - ), + const SizedBox(height: ChainSpace.md), + Padding( + padding: const EdgeInsets.only(bottom: 4), + child: Text( + l.approvalsPayloadPreview, + style: theme.textTheme.labelSmall?.copyWith( + color: theme.colorScheme.onSurfaceVariant, + letterSpacing: 0.6, + fontSize: 10, ), ), + ), + if (approval.payloadPreview != null) + Container( + width: double.infinity, + // Cap the height so a large payload scrolls inside the + // card instead of stretching it off-screen; still fully + // readable + copyable (SelectableText). + constraints: const BoxConstraints(maxHeight: 280), + padding: const EdgeInsets.all(ChainSpace.md), + decoration: BoxDecoration( + color: theme.colorScheme.surfaceContainerHigh, + borderRadius: BorderRadius.circular(ChainRadius.sm), + border: Border.all(color: theme.colorScheme.outlineVariant), + ), + child: SingleChildScrollView( + child: SelectableText( + _prettyPreview(approval.payloadPreview!), + style: ChainTheme.mono( + size: 11, + color: theme.colorScheme.onSurface, + ), + ), + ), + ) + else + // No `show:` on the approval step → explain where the data + // would come from instead of rendering nothing. Container( width: double.infinity, padding: const EdgeInsets.all(ChainSpace.md), @@ -606,15 +631,26 @@ class _ApprovalCard extends StatelessWidget { borderRadius: BorderRadius.circular(ChainRadius.sm), border: Border.all(color: theme.colorScheme.outlineVariant), ), - child: SelectableText( - _prettyPreview(approval.payloadPreview!), - style: ChainTheme.mono( - size: 11, - color: theme.colorScheme.onSurface, - ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon( + Icons.info_outline, + size: 14, + color: theme.colorScheme.onSurfaceVariant, + ), + const SizedBox(width: ChainSpace.sm), + Expanded( + child: Text( + l.approvalsNoPayload, + style: theme.textTheme.bodySmall?.copyWith( + color: theme.colorScheme.onSurfaceVariant, + ), + ), + ), + ], ), ), - ], const SizedBox(height: ChainSpace.lg), Row( children: [