Use case StRS-MDOKFSTUDIO-BLOCK-025
Preview edits land exactly, in one undo step, keep line endings, or are refused with a reason
As a writer, I trust that every change I make from the preview lands on the lines I meant, reverts with one undo and keeps the line endings of my document, or is refused with a reason, never landing on the wrong text; I am told why when an edit, move or paste cannot be done, and my document and clipboard are left untouched.
Use case diagram
How it is split
This use case (StRS) is reached by 2 paths, one per coloured line. A path goes from one situation (circle) to the next; each step (pill) is a behaviour (SwRS) with its own tests.
path 1: Edit a block and undo it path 2: Cut blocks and paste them other outcomeone dot = one scenario checked: nominal boundary refusal
Path 1: Edit a block and undo it
- A block editor is openSwRS-MDOKFSTUDIO-BLOCK-216 a refused save keeps the typed text and says whySwRS-MDOKFSTUDIO-BLOCK-042 · 6 tests the typed text is autosaved as the smallest single replacement
- The typed text is in the documentSwRS-MDOKFSTUDIO-BLOCK-058 an edit that VS Code does not apply or rejects is answered with a reasonSwRS-MDOKFSTUDIO-BLOCK-234 the line endings of the document are keptSwRS-MDOKFSTUDIO-BLOCK-058 · 8 tests the edit is one undo step and the preview renders once
- The edit is one undo step with the line endings kept
Path 2: Cut blocks and paste them
- A run of blocks is selectedSwRS-MDOKFSTUDIO-BLOCK-124 ranges that do not match the document are refused with a reasonSwRS-MDOKFSTUDIO-BLOCK-127 copy and cut of an included block are refusedSwRS-MDOKFSTUDIO-BLOCK-169 · 5 tests a cut puts their Markdown on the clipboard and deletes them with one blank separator
- The blocks are on the clipboard and gone from the documentSwRS-MDOKFSTUDIO-BLOCK-174 the document changed while the clipboard was readSwRS-MDOKFSTUDIO-BLOCK-174 · 5 tests paste inserts the clipboard text as new blocks after the insert point
- The blocks are in their new place
This map has 86 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 8 behaviours on the map are tested one by one, with 57 scenarios.
Behaviours of this use case
SwRS-MDOKFSTUDIO-BLOCK-042Typing is autosaved as the smallest single replacement 6 testsSwRS-MDOKFSTUDIO-BLOCK-058Every host source edit is one undo step, renders once and reports a failed apply 8 testsSwRS-MDOKFSTUDIO-BLOCK-094The host inserts a new block with clean blank lines not on the map2 testsSwRS-MDOKFSTUDIO-BLOCK-117The host swaps two blocks in one edit and keeps their separators not on the map3 testsSwRS-MDOKFSTUDIO-BLOCK-124Moves and clipboard edits are refused for ranges that do not match the document 5 testsSwRS-MDOKFSTUDIO-BLOCK-127An included block is never moved, cut, copied, selected or pasted after 9 testsSwRS-MDOKFSTUDIO-BLOCK-169Cut removes the selected blocks with one blank separator 5 testsSwRS-MDOKFSTUDIO-BLOCK-174Paste inserts the clipboard as new blocks after the selection or insert point 5 testsSwRS-MDOKFSTUDIO-BLOCK-216A refused open or save keeps the typed text and says why 10 testsSwRS-MDOKFSTUDIO-BLOCK-234Preview edits keep the line endings of the document 11 testsSwRS-MDOKFSTUDIO-BLOCK-259The host ignores a malformed block-editing message and changes nothing not on the map2 testsSwRS-MDOKFSTUDIO-BLOCK-264An emptied top-level block or list item is deleted with its separator when the writer commits it not on the map4 testsSwRS-MDOKFSTUDIO-BLOCK-265Delete block deletes the blocks of a selection with one separator in one undo step not on the map7 testsSwRS-MDOKFSTUDIO-BLOCK-266Edit mode shows each shown blank line as a blank-line block not on the map12 testsSwRS-MDOKFSTUDIO-BLOCK-267A blank-line block takes the arrows, Enter and a click not on the map3 testsSwRS-MDOKFSTUDIO-BLOCK-268Typing or pasting in a blank-line block writes the text in place of that blank line not on the map17 testsSwRS-MDOKFSTUDIO-BLOCK-269Removing a blank-line block removes that one blank line not on the map12 testsSwRS-MDOKFSTUDIO-TRUST-005The host handles the page messages of every preview, whatever the trust not on the map17 testsSwRS-MDOKFSTUDIO-TRUST-059The page accepts only registered host messages addressed to its render not on the map6 testsSwRS-MDOKFSTUDIO-TRUST-065A page message is matched to the shown render or document by the gate of its type not on the map12 tests
SwRS-MDOKFSTUDIO-BLOCK-129The page applies a move result only for its own render superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-109 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-227A thread reply or delete is refused while a block edit is open deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-232Text edits apply in offset order deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-233Overlapping or out-of-range text edits are refused deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-235A refusal is told apart from a plan deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-236previewEditModeChanged carries a boolean edit mode superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-237previewEditOpen needs an edit id and a line range superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-238previewEditSave needs both texts and valid optional fields superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-239previewEditCancel needs an edit id and a line range superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-240previewBlockMove needs both ranges and a direction superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-241previewBlocksCopy needs a line range superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-242previewBlocksCut needs a line range and an optional pin superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-243previewBlocksPaste needs a line to paste after superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-244previewEditClosed carries the id of the closed editor superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-245previewEditFlushed carries the flush id and a flag superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-252Overlapping or out-of-range planned edits leave the document unchanged deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-TRUST-064Flush and editor watch messages are addressed by their own id superseded superseded by SwRS-MDOKFSTUDIO-TRUST-059 Markdown file