Forms Dialogs And Notifications Flow

edit lifecycle, modal request/response, and fire-and-forget notification channels

Forms Dialogs And Notifications Flow edit lifecycle, modal request/response, and fire-and-forget notification channels Forms Dialogs And Notifications Flow edit lifecycle, modal request/response, and fire-and-forget notification channels FormVM edit lifecycle Modal dialog seam Notification hub and rendering VMs FormVM<TM> Snapshot captured at construct() Model mutates via SetModel() IsDirty derives from Model vs Snapshot DenyCommand revert Model to Snapshot publish property changes ApproveCommand persist captured model reset -> pristine errors -> ApproveErrors Validation surface field validators + model validator Errors / FieldError(field) IsValid gates approval strict mode = IsDirty && IsValid Success + failure channels reset commits before OnApproved OnApproved emits persisted model one failure observer per entry path IDialogService PickFileToOpen / PickFileToSave Confirm(message, title?) Notify(message, severity?) Present(modalVM) for VM-backed modals ConfirmationDecoratorCommand wraps delete or deny commands confirm delegate can call dialogService.Confirm() same pattern works for file/export prompts NullDialogService + cancellation safe defaults: PickFile* -> null Confirm -> false, Notify -> no-op cancellation completes with safe default INotificationHub Post(notification) -> await NotificationReaction Resolve(notification, reaction) Pending behaves like a hot current snapshot NotificationVM wraps Notification auto-dismiss at expiry Dismiss -> Approve ConfirmationVM inherits NotificationVM Approve / Reject timeout stays pending Bridge helper make_confirm(hub, prompt) -> async bool posts Confirmation notification adapts hub flow for command decorators Responsibility split dialogs: modal request/response notification hub: informational or queued user action both can be injected into the same VM Decision rule Awaiting a user decision belongs on IDialogService. Informing the user without blocking belongs on INotificationHub. cancel path save path wrap Deny/Delete host modal semantics via hub adapts

FormVM

  • FormVM is an edit-lifecycle primitive, not a persistence framework.
  • Snapshot, dirty tracking, validation, declarative reset, and success/error channels all live on the VM surface.
  • Dialog confirmation is documented composition, not a hard dependency.

Dialog seam

  • IDialogService is the host-facing modal contract for file pickers, confirms, and VM-backed modals.
  • NullDialogService exists so tests can stay deterministic.
  • ConfirmationDecoratorCommand composes directly with dialogService.Confirm().

Notifications

  • The notifications package is opt-in and orthogonal to dialogs.
  • NotificationVM and ConfirmationVM render posted notifications without changing the core VM family.
  • The make_confirm bridge is the clean way to reuse notification flows for command confirmation.