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
| Given | When | Then |
|---|---|---|
| an open menu with the first entry lit | the writer presses ArrowUp | the last entry is lit |
| the last entry lit | the writer presses ArrowDown | the 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
the query typed in the middle of a text
Whenthe writer presses Enter or Tab
Enter is pressed
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
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
an open menu
Whenthe writer clicks Bold
the pointer moves over the third command
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
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
| Query | When the command is chosen | Outcome |
|---|---|---|
| /link or /table | the writer chooses it | the query is removed, then the link panel or the size grid opens as the button opens it |
| /bold | the writer chooses it | the query is removed and Bold is applied in the same edit, as the Enter scenario states |
| the list entries | the writer chooses one | the list prefix is written as one edit |
boundaryEscape closes the menu and keeps the typed text
| Given | When | Outcome |
|---|---|---|
| an open menu with the query /ta | the writer presses Escape | the menu closes, /ta stays and the editor is still open |
| the same state, menu closed | the writer presses Escape again | the editor is cancelled |
boundaryBackspace narrows the query or closes the menu
| Given | When | Outcome |
|---|---|---|
| the menu open with the query ta | the writer presses Backspace | the query is t and the list is longer |
| the menu open with an empty query | the writer presses Backspace | the slash is removed and the menu closes |
refusalLeaving the query closes the menu and keeps the text
| Given | When | Outcome |
|---|---|---|
| an open menu | the caret is moved before the slash | the menu closes |
| an open menu | a selection appears | the menu closes and the text is as typed |
| an open menu | the text box loses the focus or the editor finishes | the menu closes and the text is unchanged |
refusalChords, compositions and other keys are not taken by the menu
| Given | When | Outcome |
|---|---|---|
| an open menu | the writer presses Ctrl+B (or another chord with Cmd, Ctrl or Alt) | the menu closes and the key reaches the shortcut handler |
| an open menu | the writer types a letter | the menu stays open and narrows through the input event |
| an open menu | a key arrives during an IME composition | the menu does not take it |
| an open menu | the writer presses only a modifier key | nothing closes |
| the Alert shortcut's slash chord | the writer presses it | the menu never opens |