Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-047

Done, Cmd/Ctrl+Enter or leaving the text box commits the edit

When a writer presses Done, presses Enter with Ctrl or Cmd in the text box, or moves the focus from the text box to something outside the editor frame, the page SHALL post the final previewEditSave of the text of the open editor and close the editor without any message when its text equals the original and nothing was autosaved.

Step 2 of path 1 in StRS-MDOKFSTUDIO-BLOCK-006: from “The typed text is in the document” to “The final text is saved”.

Part of StRS-MDOKFSTUDIO-PALETTE-013, outside the paths drawn on its map.

Step 3 of path 1 in StRS-MDOKFSTUDIO-PALETTE-005: from “The editor is open with the focus in the text” to “The edit is saved and the editor is closed”.

Scenarios 7

The situations the tests check; open one to read it.

nominalDone with changes
Givenan open editor whose text differs from the original
an editor with typed text and an autosave timer still running
Whenthe writer presses Done
the writer presses Done
Thenone previewEditSave with final true and the typed text is posted, the status line reads "Saving Markdown…" and the editor waits for the render
the timer is cleared and the final save carries the latest text
refusalThe host refuses the final save
Givenan editor that posted its final save
Whenthe host refuses the save and its error arrives
Thenthe status line shows the error instead of "Saving Markdown…"
nominalCmd or Ctrl with Enter
InputOutcome
Ctrl+Enter in the text box with typed textThe default action is prevented and the final save is posted
Cmd+Enter in the same editorThe same final save is posted
Plain EnterThe editor is not finished
nominalLeaving the text box
InputOutcome
Click outside the frame, with typed textOne final save is posted and the autosave timer is cleared
The browser window loses the focus with no related targetThe final save is posted as well
Cmd/Ctrl+F in the text box (the find field takes the focus, see SwRS-MDOKFSTUDIO-TOOLBAR-009)The final save carries the text typed before the key; the keys typed afterwards go to the find query
boundaryMoving the focus inside the editor or into a host dialog does not commit
InputOutcome
The focus moves from the text box to a palette button, the link panel or the figure form of the same editorNo final save is posted and the editor stays open
The text box blurs while a file picker opened by an image or document action is pendingNo final save is posted until the dialog is answered
A request marked as a native dialog is pendingA dialog is reported as open, until the request is answered, times out or is cancelled
The dialog was answered, cancelled or timed out; or a list request is pendingNo dialog is reported as open; a list request never carries the dialog mark
boundaryAn editor whose text is unchanged closes without a save
InputOutcome
Done, leaving the text box or Ctrl+Enter on an editor opened and not changedThe editor closes and no previewEditSave and no previewEditCancel is posted (a close report may follow, see SwRS-MDOKFSTUDIO-BLOCK-191)
Done on an insertion editor left emptyThe editor closes and nothing is written
boundaryA second final save is refused while the first is in flight
InputOutcome
Done, Ctrl+Enter or leaving the text box while the final save of the same editor is in flightNo second final save is posted; the editor waits for the render of the first

Implemented in 3

Tested by 10