Behaviour SwRS-MDOKFSTUDIO-BLOCK-079
Arrow keys at the edges open the previous or next block
When a writer presses an arrow key with the caret at an edge of the text box of an open block editor, the page SHALL leave the editor, saving a changed text, and open the editor of the previous or next body block with the caret at its end or at its start, and otherwise leave the key to the text box.
Step 1 of path 2 in StRS-MDOKFSTUDIO-BLOCK-008: from “A block editor is open with the caret on its last line” to “The editor of the next block is open with the caret at its start”.
Scenarios 8
The situations the tests check; open one to read it.
nominalArrowUp from the first visual line
Givenan editor on the second of three paragraphs with the caret on its first visual line
Whenthe writer presses ArrowUp
Thenwhen the text changed the final save is posted first, and the editor of the first paragraph opens with the caret at its end once the page is patched (at once when nothing changed)
nominalArrowDown from the last visual line
Givenan editor on the first of three paragraphs with the caret on its last visual line
Whenthe writer presses ArrowDown
Thenwhen the text changed the final save is posted first, and the editor of the second paragraph opens with the caret at its start once the page is patched (at once when nothing changed)
boundaryCaret position decides
| Input | Outcome |
|---|---|
| A long paragraph that wraps over four visual lines, the caret on the third, ArrowUp | The caret moves up one visual line and the editor stays |
| The caret on a line that is not the last visual line, ArrowDown | The caret moves down natively |
| The caret at offset 0, ArrowLeft | The editor of the previous block opens with the caret at its end |
| The caret at the end of the text, ArrowRight | The editor of the next block opens with the caret at its start |
refusalModifiers or a selection
| Input | Outcome |
|---|---|
| The caret on the first visual line, Shift+ArrowUp | The selection extends and the editor stays open |
| An arrow key with Shift, Ctrl, Cmd or Alt held | The page does not leave the text box |
| A selected word, ArrowLeft | The text box collapses the selection natively |
boundaryFirst block, last block and the properties table
| Input | Outcome |
|---|---|
| The editor of the first body block with the caret on its first visual line, ArrowUp | The editor stays open |
| The editor of the last body block with the caret on its last line, ArrowDown | The editor stays open |
| The editor of the first body block under a properties table (a document with frontmatter), ArrowUp on its first line | The properties table is stepped over, no editor opens on it and the editor stays open |
| The editor of a block between two body blocks, ArrowUp | The previous body block opens |
nominalItems of a list and inner blocks
| Input | Outcome |
|---|---|
| ArrowDown at the end or ArrowUp at the start of a list item editor | The editor of the next or previous item of the same list opens |
| ArrowDown at the end of the last item's editor, or ArrowUp at the start of the first item's editor | The editor of the next or previous top-level block, past the list, opens |
| ArrowDown at the end of the editor of a block inside a list item (opened from the keyboard, SwRS-MDOKFSTUDIO-BLOCK-254) | The editor of the next item of that list opens; past the last item, the next top-level block opens |
| ArrowUp or ArrowDown at the edge of the editor of an inner block of an admonition or of another container that is not a list item | The key stays with the text box and the editor stays open |
nominalThe block to open next is remembered in the webview state
Givenan arrow navigation whose save is in flight
Whenthe page state is read
ThenpendingBlockNavigation holds the block id, source line and caret position (and the table cell if any) until that editor is opened
boundaryPage replaced before the save is rendered
Giventhe page replaced before the save is rendered
Whenthe new page starts and receives its content
Thenthe editor of the remembered block opens and the entry is cleared
Implemented in 2
Tested by 5
Replaces
SwRS-MDOKFSTUDIO-FMEDIT-062Boundary navigation does not step into the properties table superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-079 Markdown file