fix(studio): make remaining non-copyable error sites copyable
Some checks failed
Security / Security check (push) Failing after 1s

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 <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-06-19 02:19:20 +02:00
parent 7f59334176
commit 8a40e8e315
2 changed files with 23 additions and 17 deletions

View file

@ -436,11 +436,25 @@ class _LiveStatusBar extends StatelessWidget {
pulsing: live,
),
const SizedBox(width: ChainSpace.sm),
// 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(
live ? l.auditLiveStatus(eventCount) : l.auditDisconnected(error!),
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)

View file

@ -491,12 +491,8 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
),
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),
],
],
],