From 8a40e8e3156f868ad48e5ca8b450cf15a46080b6 Mon Sep 17 00:00:00 2001 From: flemming-it Date: Fri, 19 Jun 2026 02:19:20 +0200 Subject: [PATCH] fix(studio): make remaining non-copyable error sites copyable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audit sweep after the System-AI fix: the Settings dialog rendered its two _error states as a bare Text (hub-endpoint save, default-scope edit), and the Audit live-status bar showed the raw load failure in a non-selectable Text (the only place that failure surfaces — the empty-state below shows just a generic hint). Route the Settings errors through ChainErrorBox and make the Audit disconnected text a SelectableText. Errors must always be clipboard-copyable. Signed-off-by: flemming-it --- lib/pages/audit.dart | 24 +++++++++++++++++++----- lib/widgets/chain_settings_dialog.dart | 16 ++++------------ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lib/pages/audit.dart b/lib/pages/audit.dart index 422c0ee..07dd7cf 100644 --- a/lib/pages/audit.dart +++ b/lib/pages/audit.dart @@ -436,12 +436,26 @@ class _LiveStatusBar extends StatelessWidget { pulsing: live, ), const SizedBox(width: ChainSpace.sm), - Text( - live ? l.auditLiveStatus(eventCount) : l.auditDisconnected(error!), - style: theme.textTheme.bodySmall?.copyWith( - color: theme.colorScheme.onSurfaceVariant, + // Disconnected → SelectableText so the raw error is copyable + // (it's the only place the underlying failure is surfaced; + // the empty-state below shows only a generic hint). + if (live) + Text( + l.auditLiveStatus(eventCount), + style: theme.textTheme.bodySmall?.copyWith( + color: theme.colorScheme.onSurfaceVariant, + ), + ) + else + Flexible( + child: SelectableText( + l.auditDisconnected(error!), + maxLines: 2, + style: theme.textTheme.bodySmall?.copyWith( + color: theme.colorScheme.onSurfaceVariant, + ), + ), ), - ), const Spacer(), if (live) Row( diff --git a/lib/widgets/chain_settings_dialog.dart b/lib/widgets/chain_settings_dialog.dart index b94b58d..54c05a7 100644 --- a/lib/widgets/chain_settings_dialog.dart +++ b/lib/widgets/chain_settings_dialog.dart @@ -491,12 +491,8 @@ class _FaiSettingsDialogState extends State { ), if (_error != null) ...[ const SizedBox(height: ChainSpace.md), - Text( - _error!, - style: theme.textTheme.bodySmall?.copyWith( - color: theme.colorScheme.error, - ), - ), + // Copyable — errors must be selectable + one-tap copyable. + ChainErrorBox(text: _error!, isError: true, maxHeight: 200), ], const SizedBox(height: ChainSpace.md), Container( @@ -2490,12 +2486,8 @@ class _DefaultScopePanelState extends State<_DefaultScopePanel> { ], if (_error != null) ...[ const SizedBox(height: ChainSpace.sm), - Text( - _error!, - style: theme.textTheme.bodySmall?.copyWith( - color: theme.colorScheme.error, - ), - ), + // Copyable — errors must be selectable + one-tap copyable. + ChainErrorBox(text: _error!, isError: true, maxHeight: 200), ], ], ],