fix(ceo-approve): require substantive notes; panel collects them

ceo-approve was bound to QANotes (notes required), so the panel's
one-click approve (posts {}) 422'd. The wrong fix is to waive notes —
that empties the audit record for a production merge. Instead require
substantive notes (>=20 chars, mirroring pass-qa) and make the panel
COLLECT them: a new CeoApproveDialog (mirrors the reject dialog) gates
the 'Approve & Merge' action, and the dashboard approval-queue enforces
the same before POSTing. The CEO sign-off note is now always captured.
This commit is contained in:
Renn F
2026-05-24 06:59:37 +02:00
parent d49d1cdb37
commit c093996efc
5 changed files with 133 additions and 8 deletions
@@ -83,7 +83,13 @@ export function CeoApprovalQueue({ className }: CeoApprovalQueueProps) {
if (!selectedTask) return;
if (actionType === "approve") {
approveMutation.mutate({ taskId: selectedTask.id, notes: notes || undefined });
// The approval note is the audit record for merging to production —
// required and substantive (>= 20 chars), matching the server gate.
if (notes.trim().length < 20) {
toast.error("Approval notes are required (>= 20 characters)");
return;
}
approveMutation.mutate({ taskId: selectedTask.id, notes: notes.trim() });
} else if (actionType === "reject") {
if (!notes.trim()) {
toast.error("Rejection reason is required");