Markdown OKF-Schema Studio

Use case StRS-MDOKFSTUDIO-BLOCK-014

A writer reorders blocks with arrows, keys and selections

As a writer, I swap a block or a selected run of blocks with its neighbour with one click on an arrow or one key press, also while I edit the block, keep typing at the same place, and can undo it with one undo.

Use case diagram

How it is split

This use case (StRS) is reached by 3 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. Where paths meet, they share the circle or the step.

path 1: Move a block with an arrow path 2: Move a block with the keyboard path 3: Move a list item shared step other outcomeone dot = one scenario checked: nominal boundary refusal
SwRS-MDOKFSTUDIO-BLOCK-109: The up and down arrows of an insert point move its blockSwRS-MDOKFSTUDIO-BLOCK-1094 teststhe writer clicks anenabled arrow of aninsert point and thepage asks the host toswap the block with itsneighbourSwRS-MDOKFSTUDIO-BLOCK-117: The host swaps two blocks in one edit and keeps their separators (paths 1 and 2)SwRS-MDOKFSTUDIO-BLOCK-1173 teststhe host replaces only the linesfrom the first block to thesecond, keeping the blankseparatorSwRS-MDOKFSTUDIO-BLOCK-058: Every host source edit is one undo step, renders once and reports a failed apply (paths 1 and 2)SwRS-MDOKFSTUDIO-BLOCK-0588 teststhe swap is one undo step and thepreview renders onceSwRS-MDOKFSTUDIO-BLOCK-130: Alt+Up and Alt+Down move the focused block, also from the text boxSwRS-MDOKFSTUDIO-BLOCK-1305 testsAlt+ArrowUp or Alt+ArrowDownrequests the move and focuses theblock at its new placeSwRS-MDOKFSTUDIO-BLOCK-262: List item handle reorders an item among its siblings in edit modeSwRS-MDOKFSTUDIO-BLOCK-2627 teststhe writer drags the handle of anitem onto a sibling, or pressesAlt+Up or Alt+Down on it, and thepage saves the list's lines withthe item movedSwRS-MDOKFSTUDIO-BLOCK-058: Every host source edit is one undo step, renders once and reports a failed applySwRS-MDOKFSTUDIO-BLOCK-0588 teststhe save is one undo step and thepreview renders onceSwRS-MDOKFSTUDIO-BLOCK-109: The up and down arrows of an insert point move its blockSwRS-MDOKFSTUDIO-BLOCK-1094 teststhe arrows are disabled atthe ends of the documentSwRS-MDOKFSTUDIO-BLOCK-127: An included block is never moved, cut, copied, selected or pasted afterSwRS-MDOKFSTUDIO-BLOCK-1279 teststhe arrows beside anincluded block aredisabledSwRS-MDOKFSTUDIO-BLOCK-124: Moves and clipboard edits are refused for ranges that do not match the documentSwRS-MDOKFSTUDIO-BLOCK-1245 testsa move whose ranges do not match the document is refused witha reasonSwRS-MDOKFSTUDIO-BLOCK-156: A block selection moves as a wholeSwRS-MDOKFSTUDIO-BLOCK-1564 testswith blocks selected the whole selection movesSwRS-MDOKFSTUDIO-BLOCK-262: List item handle reorders an item among its siblings in edit modeSwRS-MDOKFSTUDIO-BLOCK-2627 testsa drop in place or over another list, an open editor or anunreadable source moves nothingEdit mode is onEdit mode is onThe host is asked to swap the block with its neighbour (paths 1, 2)The host is asked toswap the block with itsneighbourThe two blocks are swapped in the document (paths 1, 2)The two blocks areswapped in the documentThe block is at its new place and one undo reverts the move (paths 1, 2)The block is at its newplace and one undoreverts the moveA body block is focused in edit modeA body block is focusedin edit modeEdit mode is on and a list has two items or moreEdit mode is on and alist has two items ormoreThe list's lines are saved with the item at its new placeThe list's lines aresaved with the item atits new placeThe item is at its new place, the numbers of an ordered list in order, and one undo reverts the moveThe item is at its newplace, the numbers of anordered list in order,and one undo reverts themove

Path 1: Move a block with an arrow

  1. Edit mode is onSwRS-MDOKFSTUDIO-BLOCK-109 the arrows are disabled at the ends of the documentSwRS-MDOKFSTUDIO-BLOCK-127 the arrows beside an included block are disabledSwRS-MDOKFSTUDIO-BLOCK-109 · 4 tests the writer clicks an enabled arrow of an insert point and the page asks the host to swap the block with its neighbour
  2. The host is asked to swap the block with its neighbourSwRS-MDOKFSTUDIO-BLOCK-124 a move whose ranges do not match the document is refused with a reasonSwRS-MDOKFSTUDIO-BLOCK-117 · 3 tests the host replaces only the lines from the first block to the second, keeping the blank separator
  3. The two blocks are swapped in the documentSwRS-MDOKFSTUDIO-BLOCK-058 · 8 tests the swap is one undo step and the preview renders once
  4. The block is at its new place and one undo reverts the move

Path 2: Move a block with the keyboard

  1. A body block is focused in edit modeSwRS-MDOKFSTUDIO-BLOCK-156 with blocks selected the whole selection movesSwRS-MDOKFSTUDIO-BLOCK-130 · 5 tests Alt+ArrowUp or Alt+ArrowDown requests the move and focuses the block at its new place
  2. The host is asked to swap the block with its neighbourSwRS-MDOKFSTUDIO-BLOCK-117 · 3 tests the host replaces only the lines from the first block to the second, keeping the blank separator
  3. The two blocks are swapped in the documentSwRS-MDOKFSTUDIO-BLOCK-058 · 8 tests the swap is one undo step and the preview renders once
  4. The block is at its new place and one undo reverts the move

Path 3: Move a list item

  1. Edit mode is on and a list has two items or moreSwRS-MDOKFSTUDIO-BLOCK-262 a drop in place or over another list, an open editor or an unreadable source moves nothingSwRS-MDOKFSTUDIO-BLOCK-262 · 7 tests the writer drags the handle of an item onto a sibling, or presses Alt+Up or Alt+Down on it, and the page saves the list's lines with the item moved
  2. The list's lines are saved with the item at its new placeSwRS-MDOKFSTUDIO-BLOCK-058 · 8 tests the save is one undo step and the preview renders once
  3. The item is at its new place, the numbers of an ordered list in order, and one undo reverts the move

This map has 2,531 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 63 scenarios.

Behaviours of this use case

SwRS-MDOKFSTUDIO-BLOCK-109The up and down arrows of an insert point move its block 4 testsSwRS-MDOKFSTUDIO-BLOCK-117The host swaps two blocks in one edit and keeps their separators 3 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-130Alt+Up and Alt+Down move the focused block, also from the text box 5 testsSwRS-MDOKFSTUDIO-BLOCK-156A block selection moves as a whole 4 testsSwRS-MDOKFSTUDIO-BLOCK-262List item handle reorders an item among its siblings in edit mode 7 testsSwRS-MDOKFSTUDIO-TRUST-005The host handles the page messages of every preview, whatever the trust not on the map17 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-139The chord is Cmd+Alt on macOS and Ctrl+Alt elsewhere deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-240previewBlockMove needs both ranges and a direction superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file