Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-FMEDIT-067

A navigation saves the open field editor as an unchecked flush

When a navigation or a host flush request occurs while a field or key editor is open, the extension SHALL save the typed text as a flush before leaving, which the host writes as typed, skipping the type, YAML and schema checks.

Another outcome at step 1 of path 1 in StRS-MDOKFSTUDIO-FMEDIT-008, in the state “A field editor is open”.

Scenarios 9

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

nominalA navigation saves the typed text as a flush
Givena YAML field editor holding invalid YAML and a click on a link to another file
Whenthe page navigates
Thena save with flush true and the text as typed is posted before the navigation
boundaryWhat the flush sends for each editor
Editor open when the page flushesText sent
a number field with a bad numberthe number as typed text
a key editor with surrounding spacesthe key trimmed
a key editor with an empty keythe old key is kept
nominalHiding or closing the page saves the open editor
EventOutcome
the page receives pagehide, or visibilitychange to hidden, with a field editor open and text typedone previewFrontmatterSave with flush true and the typed text is posted
the page is hidden with no field editor openno frontmatter save is posted
nominalThe host writes a flush save as typed
Givena flush save of the text [ for a YAML field
Whenthe host plans it
Thenthe text is written as a string and the plan needs no schema check
boundaryA flush skips the type check
Givena flush save of three for a number field with a schema
Whenthe host plans it
Thenthe value is written instead of the stale-field refusal

Other refusals (stale field, bad key, YAML that cannot be patched) still apply to a flush save.

refusalA refused flush warns that the typed text was dropped
Save refused by the hostOutcome
a flush save of the field status, with a reasona warning reads "Markdown OKF-Schema Studio could not save the text you typed in the frontmatter field "status": {reason}. That text was not saved."
a normal saveno host warning is shown, only the error in the editor
boundaryA normal save carries no flush flag
Save postedMessage
a field editor committed with Enter or by leaving itno flush property
an editor flushed by a navigationflush true
nominalA refused plain save is saved again as a flush before a navigation
Givena plain save in flight and a navigation waiting
Whenthe host refuses the save
Thenthe editor is enabled again, the typed text is posted again as a flush, then the navigation goes on
boundaryWaiting for a plain save
Pending plain saveOutcome
gets no resultthe navigation goes on after the bounded wait of about 1.5 seconds
was accepted before the flushit is not saved twice

Implemented in 5

Tested by 3

Replaces

SwRS-MDOKFSTUDIO-FMEDIT-068A flush save is written without the type and schema check superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-067 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-069A refused flush warns that the typed text was dropped superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-067 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-070A normal frontmatter save carries no flush flag superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-067 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-071A refused plain save is saved again as a flush before a navigation superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-067 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-085Hiding or closing the page saves the open field editor as a flush superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-067 Markdown file