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
Path 1: Move a block with an arrow
- 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
- 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
- The two blocks are swapped in the documentSwRS-MDOKFSTUDIO-BLOCK-058 · 8 tests the swap is one undo step and the preview renders once
- The block is at its new place and one undo reverts the move
Path 2: Move a block with the keyboard
- 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
- 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
- The two blocks are swapped in the documentSwRS-MDOKFSTUDIO-BLOCK-058 · 8 tests the swap is one undo step and the preview renders once
- The block is at its new place and one undo reverts the move
Path 3: Move a list item
- 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
- 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
- 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