Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-242

Keys and clicks drive the slash menu and run the lit command

When the slash menu is open, the extension SHALL take ArrowDown, ArrowUp, Enter, Tab, Escape, Backspace, a click and a hover for the menu, running the lit command in one edit and leaving every other key and the text to the text box.

Step 3 of path 1 in StRS-MDOKFSTUDIO-PALETTE-015: from “The list is narrowed to the query” to “The edit of the command is in the text”.

Scenarios 8

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

nominalThe arrows move the highlight and wrap
GivenWhenThen
an open menu with the first entry litthe writer presses ArrowUpthe last entry is lit
the last entry litthe writer presses ArrowDownthe first entry is lit
nominalEnter or Tab runs the lit command in one edit
Giventhe text before /bold and a selection-free caret
the query typed in the middle of a text
Whenthe writer presses Enter or Tab
Enter is pressed
Thenthe slash and the query are removed, Bold is applied as its button does and one undo restores /bold
only the query is removed and the rest of the text stays
nominalA click runs a command and a hover lights it
Givenan open menu
an open menu
Whenthe writer clicks Bold
the pointer moves over the third command
ThenBold runs and the query is removed
the third command is lit and the text box keeps the focus
nominalA command with a picker removes the query and then opens like its button
QueryWhen the command is chosenOutcome
/link or /tablethe writer chooses itthe query is removed, then the link panel or the size grid opens as the button opens it
/boldthe writer chooses itthe query is removed and Bold is applied in the same edit, as the Enter scenario states
the list entriesthe writer chooses onethe list prefix is written as one edit
boundaryEscape closes the menu and keeps the typed text
GivenWhenOutcome
an open menu with the query /tathe writer presses Escapethe menu closes, /ta stays and the editor is still open
the same state, menu closedthe writer presses Escape againthe editor is cancelled
boundaryBackspace narrows the query or closes the menu
GivenWhenOutcome
the menu open with the query tathe writer presses Backspacethe query is t and the list is longer
the menu open with an empty querythe writer presses Backspacethe slash is removed and the menu closes
refusalLeaving the query closes the menu and keeps the text
GivenWhenOutcome
an open menuthe caret is moved before the slashthe menu closes
an open menua selection appearsthe menu closes and the text is as typed
an open menuthe text box loses the focus or the editor finishesthe menu closes and the text is unchanged
refusalChords, compositions and other keys are not taken by the menu
GivenWhenOutcome
an open menuthe writer presses Ctrl+B (or another chord with Cmd, Ctrl or Alt)the menu closes and the key reaches the shortcut handler
an open menuthe writer types a letterthe menu stays open and narrows through the input event
an open menua key arrives during an IME compositionthe menu does not take it
an open menuthe writer presses only a modifier keynothing closes
the Alert shortcut's slash chordthe writer presses itthe menu never opens

Implemented in 2

Tested by 2