fix(ui): restore staged review for models and instructions

Apply reviewed edits through the module APIs one request at a time. Keep failed and untouched drafts for retry, and remove successful edits from the review.

(cherry picked from commit 952215e36325b76f6e3364d713263f502acf6d02)
This commit is contained in:
sam committed 2026-11-27 15:51:34 +11:00
1 parent a2141ed4bb
commit f6eff43ca4
7 files changed
+420 -198

No files matched your search

-18
View File
@@ -32,24 +32,6 @@ export interface BlockingField extends FieldIssue {
kind: string;
}
/**
* collectIssues runs each dirty section's validator against its draft. It is
* driven by the dirty list on purpose: a section with no changes is not
* blocked, so a value the server already accepted can never stop an unrelated
* save.
*/
export function collectIssues(
dirtyKinds: readonly string[],
draftValue: (kind: string) => unknown,
validators: Record<string, DraftValidator | undefined>,
): BlockingField[] {
return dirtyKinds.flatMap((kind) => {
const validate = validators[kind];
if (!validate) return [];
return validate(draftValue(kind)).map((issue) => ({ ...issue, kind }));
});
}
interface SchedulingDraft {
poll_interval?: string;
label?: string | null;