feat(editor): success snackbar after save

Brief 1.5 s green-check snackbar appears at the bottom of
the editor after a successful save. Confirmation matters
here because Cmd+S is the operator's most common keystroke
in any editor — without visible feedback, they'd need to
hunt for the dirty dot to verify the save landed.

The error path's existing snackbar (which has no duration
cap by design — operators must read errors) stays
unchanged.

Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
flemming-it 2026-06-01 01:57:52 +02:00
parent cae5c94c4d
commit 307eaccc3e

View file

@ -192,6 +192,25 @@ class _FlowEditorPageState extends State<FlowEditorPage>
_controller.markSaved(); _controller.markSaved();
_files = _listFiles(); _files = _listFiles();
setState(() {}); setState(() {});
// Brief positive feedback. Confirmation matters more
// here than on most save buttons because the operator
// can also save via Cmd+S without watching the dirty
// dot a tiny green snackbar tells them the
// keystroke landed.
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
duration: const Duration(milliseconds: 1500),
behavior: SnackBarBehavior.floating,
content: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.check_circle_outline, size: 16),
const SizedBox(width: FaiSpace.sm),
Text('$name.yaml ${_l.save.toLowerCase()}'),
],
),
),
);
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
ScaffoldMessenger.of( ScaffoldMessenger.of(