T7.9 - S1 (creator): errors at the field, and the last 40 native dialogs gone
wp-creation-app.js:1144 said "Subject and WP Type are required" in an alert() on a form ten cards deep, naming nothing, focusing nothing. The creator carried 40 native call sites in all (43 at the wave 0 count; three had already left with D5 and T5.8's wizard work). Inline validation, the T5.8 wizard pattern applied to the creator: - WP_REQUIRED is one table: field id, owning section, label. The error box, aria-describedby, aria-invalid and the role=alert announcement all follow from a row. The conditional IFF rule folded in beside them. - Submit marks every failing field, marks the rail entry of each section holding one (a "!" chip - a character, not only a colour), switches to the section of the FIRST error, scrolls to and focuses the field, and announces the failure through the role=alert toast. One modal replaced confirm() and prompt(): promise-based wpConfirmDialog()/ wpPromptDialog() with an optional input whose validation renders AT the input (a bad answer keeps the dialog open and says why - no round-trip through a second dialog). Escape cancels; callers read like the natives they replaced, awaited. Pure notifications became role-differentiated toasts. The modal validation errors for the hold log and the QA rejection render inline in their own modals. The A1 path: confirmEarlyRelease() keeps its name and contract - truthy means proceed with the reason recorded - and became async; every caller awaits it (status control, hold release, urgent override, save). App-wide native dialog count, recorded per the done-when: the probe prints it against the wave 0 baseline of 79 and asserts the creator contributes 0. The probe also replaces the natives with throwing stubs for the whole run, so any path that still reached one would fail loudly. hold_check re-pointed, not relaxed: three flows it drove through native stubs now drive the modal - same propositions (the release-ready offer, the named-constraints override prompt, the hard block), new surface. Verification (each probe run alone): NEW tests/creator_dialogs_check.py 20/20. Regressions: hold_check 50/50 (re-pointed), warning_check 17/17, qa_gate_check 40/40, triage_check 16/16, files_check 36/36, frame_check 39/39, generalinfo_check 49/49, form_structure_check 50/51 (the standing F6 height check - see the wave exit). Items: S1 (creator half) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -508,7 +508,7 @@
|
||||
<div class="modal-body">
|
||||
<div class="notice">Moving a package to <strong>Issue (Hold)</strong> requires logging the constraint that blocked it.</div>
|
||||
<div class="field"><label>Constraint type <span class="req">*</span></label><select id="hold-constraint"></select></div>
|
||||
<div class="field"><label>Details <span class="req">*</span></label><textarea id="hold-details" rows="3" placeholder="What reopened / blocked this package?"></textarea></div>
|
||||
<div class="field"><label>Details <span class="req">*</span></label><textarea id="hold-details" rows="3" placeholder="What reopened / blocked this package?" aria-describedby="hold-details_err"></textarea><div class="field-error" id="hold-details_err" role="alert"></div></div>
|
||||
<div class="field"><label>Supporting document link</label><input type="text" id="hold-doclink" placeholder="link to RFI, photo, email, etc. (optional)"></div>
|
||||
<div class="field"><label>Supporting photo</label><input type="file" id="hold-photo" accept="image/*" onchange="holdPhotoChange(event)"><div class="hold-photo-preview" id="hold-photo-preview"></div></div>
|
||||
</div>
|
||||
@@ -516,6 +516,24 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIALOG (S1 / T7.9). The one replacement for the creator's 43 native
|
||||
dialogs: a modal with a message, an optional input with an inline error,
|
||||
and real buttons. Promise-based - wpConfirmDialog()/wpPromptDialog(). -->
|
||||
<div class="modal-overlay" id="wp-dialog" role="dialog" aria-modal="true" aria-labelledby="wp-dialog-title">
|
||||
<div class="modal" style="max-width:480px">
|
||||
<div class="modal-head"><div class="modal-title" id="wp-dialog-title"></div><button class="cmt-x" onclick="wpDialogCancel()" title="Cancel">✕</button></div>
|
||||
<div class="modal-body">
|
||||
<div id="wp-dialog-msg" style="white-space:pre-wrap"></div>
|
||||
<div class="field" id="wp-dialog-input-wrap" style="margin-top:10px">
|
||||
<label id="wp-dialog-label" for="wp-dialog-input"></label>
|
||||
<input type="text" id="wp-dialog-input" onkeydown="if(event.key==='Enter'){wpDialogOk();}">
|
||||
<div class="field-error" id="wp-dialog-err" role="alert"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-foot"><button class="btn btn-ghost" id="wp-dialog-cancel" onclick="wpDialogCancel()">Cancel</button><button class="btn btn-generate" id="wp-dialog-ok" onclick="wpDialogOk()">OK</button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- QA REJECT MODAL (CR-014). The comment is not optional: a rejection with no
|
||||
reason is the after-the-fact surprise this gate exists to end, and the server
|
||||
refuses the transition without one. -->
|
||||
@@ -524,7 +542,7 @@
|
||||
<div class="modal-head"><div class="modal-title">Return to the crew — QA rejection</div><button class="cmt-x" onclick="qaRejectCancel()" title="Cancel">✕</button></div>
|
||||
<div class="modal-body">
|
||||
<div class="notice">The package goes back to <strong>In Progress</strong>. The owner and the QA group are notified, and the comment stays on the package.</div>
|
||||
<div class="field"><label>What needs fixing <span class="req">*</span></label><textarea id="qa-reject-comment" rows="3" placeholder="What QA found — required"></textarea></div>
|
||||
<div class="field"><label>What needs fixing <span class="req">*</span></label><textarea id="qa-reject-comment" rows="3" placeholder="What QA found — required" aria-describedby="qa-reject-comment_err"></textarea><div class="field-error" id="qa-reject-comment_err" role="alert"></div></div>
|
||||
</div>
|
||||
<div class="modal-foot"><button class="btn btn-ghost" onclick="qaRejectCancel()">Cancel</button><button class="btn btn-generate" onclick="qaRejectSubmit()">Reject — back to In Progress</button></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user