Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-TABLE-119

An outside change of the table under an open cell editor closes the editor and shows the buffer

When the document changes outside the preview (an undo, a redo, a revert of the file or a write by another tool) over the source lines of the table whose cell editor the page has open, the extension SHALL let the render of the new buffer reach the page at once, release the host's edit of that table without writing, and have the page close the cell editor without saving it, so the table shows what the buffer holds.

Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-TABLE-001, in the state “The cell editor is open”.

Scenarios 3

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

nominalAn undo, a redo or a revert under an open cell editor
Givena cell editor open in a table (its text autosaved or not) and the writer undoing, redoing or reverting the file in the text editor, or another tool rewriting the document, so that the change overlaps the source lines of that table
Whenthe change reaches the host
Thenthe host lets the render of the new buffer reach the page at once, drops a render that waited for the editor, and releases its edit of the table without writing; the page applies the content patch, which closes the cell editor without a save and without a cancel message, and the table shows what the buffer holds (unit tests test/host/previewTiming.test.ts "an undo inside the table of an open cell editor reaches the page at once", "a revert-like change that is neither an undo nor typed also reaches an open cell editor's table", "an undo inside the table releases a held host edit without writing and renders")
boundaryWhich changes close the editor
InputOutcome
A change outside the table (another block, above or below it)The render waits for the editor as in SwRS-MDOKFSTUDIO-BLOCK-193; a change above the table moves the range the host follows, so a later change inside the table is still recognised
Text typed by the writer in the source (including a change that touches the cursor before VS Code has reported any keystroke, which may be the first one), or an edit the preview applied itselfThe render keeps waiting; the editor stays open
An inline editor that is not a table cell editor (a prose block editor)Not affected: the conflict of SwRS-MDOKFSTUDIO-BLOCK-191 applies, the editor stays open with the reader's text
A cell editor that never saved (no host edit)The change is recognised from the table range the host recorded when the page opened the editor
nominalA cell left with Tab is rebuilt
Givena table whose cell was left with Tab, an arrow key or a click, so that the page wrote the text just typed into it
Whenthe next content patch carries the same table HTML as the render the page started from (the buffer went back to that text)
Thenthe table is rebuilt from the patch and shows the buffer text, not the text typed in the cell (SwRS-MDOKFSTUDIO-LIFE-069)

Implemented in 5

Tested by 5