{
+ if (mounted.current) void navigate(${camel}RouteUrl("${routeId}"));
+ }}
+ // The resend is drawn only for a request with a key (a KEYED command).
+ onResent={openSaved}
+ />
}
guard={}
/>
diff --git a/src/presentation/components/async-surface.tsx b/src/presentation/components/async-surface.tsx
index 041d3072..f2773888 100644
--- a/src/presentation/components/async-surface.tsx
+++ b/src/presentation/components/async-surface.tsx
@@ -142,6 +142,12 @@ export type AsyncSurfaceProps = Readonly<{
* terminal error shows its own `failure.requestId`.
*/
supportReference?: string | undefined;
+ /**
+ * 1112/04-02. Words about the unknown save shown with it (a resend the
+ * server refused before the write: `form.resendLater`), not under the input
+ * error summary.
+ */
+ notice?: ReactNode;
}>;
export function AsyncSurface({
@@ -155,6 +161,7 @@ export function AsyncSurface({
onResendUnknownEffect,
headingLevel,
supportReference,
+ notice,
}: AsyncSurfaceProps) {
const { message } = useLocale();
if (state.base === "idle") return idle ?? null;
@@ -231,6 +238,7 @@ export function AsyncSurface({
{message("action.resendMutation")}
) : null}
+ {state.indicator === "mutation-effect-unknown" && notice ? {notice}
: null}
{state.indicator === "mutation-effect-unknown" && supportReference ? (
{message("template.supportReference", {
diff --git a/src/presentation/design-system/index.ts b/src/presentation/design-system/index.ts
index 4ec1456e..535d724f 100644
--- a/src/presentation/design-system/index.ts
+++ b/src/presentation/design-system/index.ts
@@ -123,6 +123,7 @@ export {
FormActions,
FormFailureStatus,
FormField,
+ FormSaveFeedback,
useAppForm,
useDirtyNavigationGuard,
} from "../forms/index.ts";
diff --git a/src/presentation/forms/form-components.tsx b/src/presentation/forms/form-components.tsx
index a5d400a7..b7a98b0c 100644
--- a/src/presentation/forms/form-components.tsx
+++ b/src/presentation/forms/form-components.tsx
@@ -1,13 +1,16 @@
import { useId, type FormHTMLAttributes, type ReactNode } from "react";
+import type { AsyncState } from "../../application/view-models/async-state.ts";
import type { AppFailure } from "../../contracts/errors.ts";
-import { TerminalErrorSurface } from "../components/async-surface.tsx";
+import { AsyncSurface, TerminalErrorSurface } from "../components/async-surface.tsx";
import type { HeadingLevel } from "../components/state-surfaces.tsx";
import { TextField } from "../components/ui/text-field.ts";
-import { useLocale } from "../i18n/index.ts";
+import { useLocale, type ParameterlessMessageKey } from "../i18n/index.ts";
import type {
FieldErrors,
FieldName,
+ FormResult,
+ FormResultState,
FormValues,
} from "./form-contracts.ts";
@@ -126,3 +129,71 @@ export function FormActions(props: Readonly<{
);
}
+
+/** What FormSaveFeedback reads of a `useAppForm` result given the `mutation` option. */
+export type FormSaveFeedbackForm