Feature: Full form editing applies as one form 

Description 

Edit all opens every editable profile field at once. It now also gives the form controls of its own: Apply, Undo and Discard, rendered once at the end of every field form by Partials/Profile/Field/FormActions.html. The per-field clear, undo and save groups are hidden for as long as the form is open, and the undo beside an autosaving checkbox with them.

  • Apply sends every changed field of the profile in one request. updateAction() validates the whole field map before it writes anything, so either all of it is stored or none of it is - a refused property leaves the other submitted properties unwritten as well. On success the stored values are written back into the fields, the previews and the name heading, the form closes and the focus returns to Edit all.
  • Undo restores every field to the value that is stored and keeps the form open.
  • Discard restores every field and closes the form. Closing the form with Edit all does the same thing.

Entering the form discards the single field or group that was open. Its control goes back to the stored value and any message beside it is cleared, exactly as its own Undo would leave it, so the form starts from the stored profile rather than from a value the visitor typed in a state they have just left.

While an apply is on its way to the server none of the three, and neither Edit all nor Escape, does anything: the request cannot be taken back, and reverting under it would leave the stored profile and the editor's baseline disagreeing silently. Because entering the form discards, the same applies while a single field is being saved: Edit all and every pencil do nothing until the answer has been written back, and say so in the polite live region rather than merely not reacting - see Important: Opening an editor asks about the unsaved one.

A refusal reverts nothing. Every entered value stays where it was entered, the refused fields are marked and described by their own message, the caret goes to the first of them and the refusal is announced once rather than once per field. Reverting thirty typed fields because one of them was rejected is data loss; the per-field paths revert only because a checkbox has one bit and no other way to report a failure.

A checkbox that saves on change stops doing so while the form is open and is applied with everything else instead. Without that, the value would reach the database while the visitor is still deciding, and Discard could not take it back. The synchronisation switch of the page header sits outside the field forms and keeps saving immediately.

Keyboard and screen reader 

  • Opening the form puts the caret in the first editable field.
  • The controls stand after the fields in document order and are tabbed through as Apply, Undo, Discard.
  • Escape discards the form, unless the caret is inside a rich text editor - that key belongs to the editor's own balloons first.
  • Ctrl + Enter (Cmd + Enter) applies it, and so does Enter in a text field, which submits the form. Both keys belong to the field form, so a document, contract or image editor open at the same time keeps its own handling of them.
  • The bar is a role="group" with its own accessible name, the Edit all button carries aria-pressed and names the forms it controls through aria-controls, and the two live regions of the editor announce the result: the polite one carries the restored notice and the success, the assertive one a failure and a refusal of the form. A refusal beside a single field stays polite, as it always was.

Impact 

This is a feature rather than a breaking change: the whole profile editing view is new in 3.0.0 (Breaking: Replaced the profile editing view) and no release ever shipped Edit all with per-field controls.

Single-field editing keeps its controls - the pencil, the three buttons beside a field and the field groups act exactly as they did, and the editors of every document and contract panel are not touched at all. What changed is that only one field or group is open at a time: opening another field or group, with a pencil or with Edit all, discards the editor that was open before it. Pressing the pencil of the field that is already open is not that - its own editor is left alone and what has been typed into it survives. An unsaved value left behind in another row is lost, rather than being posted later from a control the visitor can no longer see. A pencil pressed while the form is open does nothing at all - every field is already open, and the bar is the way out.

An override of Partials/Profile/Profile/Fields.html has to render Profile/Field/FormActions at its end, or the profile offers no way to apply the form. An override of the bar itself keeps the data-pe-form-actions element with its data-pe-form-reverted-message, and the three data-pe-form-apply, data-pe-form-undo and data-pe-form-discard buttons; every label of it is Fluid, none is spelled in JavaScript. See Two editing modes.