Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-130

Alt+Up and Alt+Down move the focused block, also from the text box

When a writer presses Alt+ArrowUp or Alt+ArrowDown on a focused body block in edit mode, the page SHALL request the move of that block and focus the block at its new place, and the move chord in the text box of a block editor does the same after saving the edit and reopens the editor with the caret where it was.

Step 1 of path 2 in StRS-MDOKFSTUDIO-BLOCK-014: from “A body block is focused in edit mode” to “The host is asked to swap the block with its neighbour”.

Scenarios 7

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

nominalAlt+Arrow on a focused block or insert point
InputOutcome
Alt+ArrowDown on a focused body block, edit mode onpreviewBlockMove is posted for that block and, after the render, the block at its new line has the focus; one message per key press
Alt+ArrowUp or Alt+ArrowDown with the plus button of a bar focusedpreviewBlockMove is posted for the block above the bar
Alt+ArrowUp on the first blockNothing is posted
Alt+ArrowDown with the bar of the properties table focusedNothing is posted
boundaryA key repeat does not move a block twice
InputOutcome
The key repeat event arrives while a keyboard move waits for its result and renderNo second message is posted
The result and the render of the move have arrived and the writer presses the chord againA new move is requested
refusalOther chords and targets do not move a block
InputOutcome
Shift+Alt+Arrow or Ctrl+Alt+Arrow on a focused blockNo move is posted
Alt+Arrow with CmdNo move is posted
Plain Alt+Arrow with the focus in a text boxThe key stays with the text box and no move is posted
Alt+Arrow in an input, select or editor, in the properties table, outside edit mode or during an open editorNo block move starts
refusalA refused keyboard move can be retried
Givena keyboard move whose result is ok false
Whenthe result arrives
the writer presses the chord again
Thenthe flight is cleared, the block has the focus and the reason shows next to the bar under the block
a new previewBlockMove is posted
boundaryA keyboard move that never lands is forgotten after five seconds
InputOutcome
A keyboard move in flight and no result for five secondsThe flight is cleared and a new chord is accepted
The result arrives after one secondThe timer has been cleared
nominalThe move chord in the text box moves the block and reopens its editor

The move chord is Cmd+Alt with ArrowUp or ArrowDown on macOS and Ctrl+Alt elsewhere.

InputOutcome
An editor with typed text and the caret at offset 12, the chord downThe final save is posted, then the block is moved, and the editor of the block at its new place opens with the caret at offset 12
An editor opened and not changed, the chordThe editor closes, the host drops the edit and previewBlockMove is posted at once
refusalThe move chord is always consumed in the text box
InputOutcome
The chord in the editor of the last block (no neighbour)The key is consumed and nothing else happens
The chord while a move is already in flightThe key is consumed and nothing else happens
The chord in an insertion editorNo word navigation happens and nothing moves
The chord in a table cell, or as a key repeatThe key is consumed and nothing moves
AltGr with an arrow, on a layout where AltGr reports Ctrl and Alt togetherThe key stays native and moves the caret; AltGraph is never part of the chord
Option or Alt with an arrow, without Cmd or Ctrl (or without Cmd+Alt on macOS)The key stays native and moves the caret by word; the chord itself is Cmd+Alt on macOS and Ctrl+Alt elsewhere

Implemented in 2

Tested by 5