diff --git a/lib/data/error_presentation.dart b/lib/data/error_presentation.dart index 1e7421f..c8357bd 100644 --- a/lib/data/error_presentation.dart +++ b/lib/data/error_presentation.dart @@ -32,7 +32,7 @@ import 'chain_log.dart'; /// back to a Material default duration of 6 seconds — twice /// the framework default so the operator has time to click /// copy on an unfamiliar message. -void showFaiErrorSnack( +void showChainErrorSnack( BuildContext context, String source, Object error, { @@ -101,7 +101,7 @@ void showFaiProcessError( final detail = [stderr.trim(), stdout.trim()] .where((s) => s.isNotEmpty) .join('\n\n'); - showFaiErrorSnack( + showChainErrorSnack( context, source, detail.isEmpty ? 'process exited non-zero (no output)' : detail, @@ -122,7 +122,7 @@ Future showFaiProcessErrorDialog( final detail = [stderr.trim(), stdout.trim()] .where((s) => s.isNotEmpty) .join('\n\n'); - return showFaiErrorDialog( + return showChainErrorDialog( context, source, detail.isEmpty ? 'process exited non-zero (no output)' : detail, @@ -133,7 +133,7 @@ Future showFaiProcessErrorDialog( /// Show [error] as a centered modal dialog. Use this when the /// failure blocks meaningful interaction (auth missing, hub /// unreachable) — a SnackBar would be too easy to dismiss. -Future showFaiErrorDialog( +Future showChainErrorDialog( BuildContext context, String source, Object error, { diff --git a/lib/pages/audit.dart b/lib/pages/audit.dart index fdf4d66..1ba2629 100644 --- a/lib/pages/audit.dart +++ b/lib/pages/audit.dart @@ -95,14 +95,14 @@ class _AuditPageState extends State { _refresh(); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'audit.clear', e); + showChainErrorSnack(context, 'audit.clear', e); } } // _friendly was an inline shadow of friendlyError() in // data/friendly_error.dart — kept only because the original // call site predated the central mapper. Removed in favour - // of showFaiErrorSnack, which uses friendlyError under the + // of showChainErrorSnack, which uses friendlyError under the // hood (with proper gRPC-code mapping + selectable // copy-affordance). diff --git a/lib/pages/doctor.dart b/lib/pages/doctor.dart index 1271a34..42fda7f 100644 --- a/lib/pages/doctor.dart +++ b/lib/pages/doctor.dart @@ -457,7 +457,7 @@ class _PathRow extends StatelessWidget { ); if (!context.mounted) return; if (!r.ok) { - showFaiErrorSnack( + showChainErrorSnack( context, 'doctor.open-path', r.stderr.isEmpty ? 'open failed' : r.stderr, diff --git a/lib/pages/federation.dart b/lib/pages/federation.dart index a193380..a19a25c 100644 --- a/lib/pages/federation.dart +++ b/lib/pages/federation.dart @@ -49,7 +49,7 @@ class _FederationPageState extends State { _refresh(); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'federation.issue', e, + showChainErrorSnack(context, 'federation.issue', e, title: l.federationIssueFailed('')); } } diff --git a/lib/pages/flows.dart b/lib/pages/flows.dart index 752b9ff..8cec918 100644 --- a/lib/pages/flows.dart +++ b/lib/pages/flows.dart @@ -132,7 +132,7 @@ class _FlowsPageState extends State { final l = AppLocalizations.of(context); // Copyable error (was a plain SnackBar) — install failures // carry the real cause (network, signature, store lookup). - showFaiErrorSnack( + showChainErrorSnack( context, 'flows.install', e, diff --git a/lib/pages/store.dart b/lib/pages/store.dart index 19b7e5c..507e126 100644 --- a/lib/pages/store.dart +++ b/lib/pages/store.dart @@ -756,7 +756,7 @@ class _StorePageState extends State { _runSearch(); } catch (e) { if (!mounted) return; - showFaiErrorSnack( + showChainErrorSnack( context, 'store.provider.add', e, @@ -2392,7 +2392,7 @@ class _StoreDetailSheetState extends State<_StoreDetailSheet> { final r = await SystemActions.openInOs(widget.item.repository); if (!mounted) return; if (!r.ok) { - showFaiErrorSnack( + showChainErrorSnack( context, 'store.repository.open', r.stderr.isEmpty ? 'open failed' : r.stderr, diff --git a/lib/widgets/chain_error_box.dart b/lib/widgets/chain_error_box.dart index 1963f02..c86ec22 100644 --- a/lib/widgets/chain_error_box.dart +++ b/lib/widgets/chain_error_box.dart @@ -53,10 +53,10 @@ class ChainErrorBox extends StatefulWidget { ); @override - State createState() => _FaiErrorBoxState(); + State createState() => _ChainErrorBoxState(); } -class _FaiErrorBoxState extends State { +class _ChainErrorBoxState extends State { bool _justCopied = false; bool _detailExpanded = false; diff --git a/lib/widgets/chain_flow_output.dart b/lib/widgets/chain_flow_output.dart index ebe744e..7c49a35 100644 --- a/lib/widgets/chain_flow_output.dart +++ b/lib/widgets/chain_flow_output.dart @@ -173,7 +173,7 @@ class _BytesView extends StatelessWidget { ).showSnackBar(SnackBar(content: Text(l.flowsOutputSavedAt(path)))); } catch (e) { if (!context.mounted) return; - showFaiErrorSnack(context, 'flows.output.save', e); + showChainErrorSnack(context, 'flows.output.save', e); } } @@ -234,7 +234,7 @@ class _FileView extends StatelessWidget { final target = uri.startsWith('file://') ? uri.substring(7) : uri; final r = await SystemActions.openInOs(target); if (!context.mounted || r.ok) return; - showFaiErrorSnack( + showChainErrorSnack( context, 'flows.output.open', r.stderr.isEmpty ? 'open failed' : r.stderr, diff --git a/lib/widgets/chain_module_sheet.dart b/lib/widgets/chain_module_sheet.dart index 5c63740..0ba9208 100644 --- a/lib/widgets/chain_module_sheet.dart +++ b/lib/widgets/chain_module_sheet.dart @@ -107,7 +107,7 @@ class _FaiModuleSheetState extends State { } catch (e) { if (!mounted) return; setState(() => _uninstalling = false); - showFaiErrorSnack(context, 'modules.uninstall', e); + showChainErrorSnack(context, 'modules.uninstall', e); } } diff --git a/lib/widgets/chain_settings_dialog.dart b/lib/widgets/chain_settings_dialog.dart index 54c05a7..0dff4d1 100644 --- a/lib/widgets/chain_settings_dialog.dart +++ b/lib/widgets/chain_settings_dialog.dart @@ -100,7 +100,7 @@ class _FaiSettingsDialogState extends State { ).showSnackBar(SnackBar(content: Text(l.hubAuthTokenSavedToast))); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'auth.hub-token.save', e); + showChainErrorSnack(context, 'auth.hub-token.save', e); } } @@ -116,7 +116,7 @@ class _FaiSettingsDialogState extends State { ).showSnackBar(SnackBar(content: Text(l.hubAuthTokenClearedToast))); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'auth.hub-token.clear', e); + showChainErrorSnack(context, 'auth.hub-token.clear', e); } } @@ -141,7 +141,7 @@ class _FaiSettingsDialogState extends State { ).showSnackBar(SnackBar(content: Text(l.registryTokenSavedToast))); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'auth.registry-token.save', e); + showChainErrorSnack(context, 'auth.registry-token.save', e); } } @@ -156,7 +156,7 @@ class _FaiSettingsDialogState extends State { ).showSnackBar(SnackBar(content: Text(l.registryTokenClearedToast))); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'auth.registry-token.clear', e); + showChainErrorSnack(context, 'auth.registry-token.clear', e); } } @@ -186,7 +186,7 @@ class _FaiSettingsDialogState extends State { ).showSnackBar(SnackBar(content: Text(l.addedN8nToast(draft.name)))); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'settings.n8n.add', e); + showChainErrorSnack(context, 'settings.n8n.add', e); } } @@ -197,7 +197,7 @@ class _FaiSettingsDialogState extends State { setState(() => _n8nEndpoints = list); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'settings.n8n.remove', e); + showChainErrorSnack(context, 'settings.n8n.remove', e); } } @@ -208,7 +208,7 @@ class _FaiSettingsDialogState extends State { setState(() => _n8nEndpoints = list); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'settings.n8n.refresh', e); + showChainErrorSnack(context, 'settings.n8n.refresh', e); } } @@ -238,7 +238,7 @@ class _FaiSettingsDialogState extends State { ).showSnackBar(SnackBar(content: Text(l.addedMcpToast(draft.name)))); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'settings.mcp.add', e); + showChainErrorSnack(context, 'settings.mcp.add', e); } } @@ -249,7 +249,7 @@ class _FaiSettingsDialogState extends State { setState(() => _mcpClients = list); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'settings.mcp.remove', e); + showChainErrorSnack(context, 'settings.mcp.remove', e); } } @@ -260,7 +260,7 @@ class _FaiSettingsDialogState extends State { setState(() => _mcpClients = list); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'settings.mcp.refresh', e); + showChainErrorSnack(context, 'settings.mcp.refresh', e); } } diff --git a/lib/widgets/chain_stores_dialog.dart b/lib/widgets/chain_stores_dialog.dart index f7a8162..ff2d631 100644 --- a/lib/widgets/chain_stores_dialog.dart +++ b/lib/widgets/chain_stores_dialog.dart @@ -114,7 +114,7 @@ class _ChainStoresDialogState extends State { _reload(); } catch (e) { if (mounted) { - showFaiErrorSnack(context, 'store.add', e, + showChainErrorSnack(context, 'store.add', e, title: AppLocalizations.of(context)!.storesManagerAddFailed); } } finally { @@ -131,7 +131,7 @@ class _ChainStoresDialogState extends State { _reload(); } catch (e) { if (mounted) { - showFaiErrorSnack(context, 'store.remove', e, + showChainErrorSnack(context, 'store.remove', e, title: AppLocalizations.of(context)!.storesManagerRemoveFailed); } } diff --git a/lib/widgets/chain_system_ai_editor.dart b/lib/widgets/chain_system_ai_editor.dart index b113ac6..c22129d 100644 --- a/lib/widgets/chain_system_ai_editor.dart +++ b/lib/widgets/chain_system_ai_editor.dart @@ -271,7 +271,7 @@ class _FaiSystemAiEditorState extends State { }); } catch (e) { if (!mounted) return; - showFaiErrorSnack(context, 'settings.system-ai.cache-clear', e); + showChainErrorSnack(context, 'settings.system-ai.cache-clear', e); } } diff --git a/pubspec.lock b/pubspec.lock index 279d399..75544e9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -46,7 +46,7 @@ packages: path: "../fai_chain_studio_flow_editor" relative: true source: path - version: "0.21.0" + version: "0.21.2" characters: dependency: transitive description: