Behaviour SwRS-MDOKFSTUDIO-PALETTE-238
The slash menu lists the palette commands of the mode and scope
When the slash menu opens, the extension SHALL list the actions of the palette for the current mode and scope in the order of the buttons, without the buttons that depend on the caret and are hidden, together with the variants and the two list entries, grouped under category headings with an icon and a shortcut while the query is empty, and a disabled No command row when the query matches nothing.
Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-PALETTE-015, in the state “The slash menu lists the commands of the mode”.
Scenarios 6
The situations the tests check; open one to read it.
nominalThe mode lists
Giventhe strict, GFM and MyST modes
Whenthe menu opens in each
Thenit lists the same actions as the palette buttons of that mode and nothing of a higher mode, plus Bulleted list and Numbered list
| Case | Outcome |
|---|---|
| strict, GFM or MyST mode | the actions of the palette buttons of that mode, in the order of the buttons, with Bulleted list and Numbered list |
| caret inside a colour code | the Colour code command is listed as well |
| caret outside a colour code | the Colour code command is not listed |
| caret inside a pipe table | List table is listed, Pipe table is not (see SwRS-MDOKFSTUDIO-TABLE-122) |
| caret inside a list table | Pipe table is listed, List table is not (see SwRS-MDOKFSTUDIO-TABLE-122) |
nominalAn empty query groups the commands, a query ranks them
Giventhe MyST mode and the menu just opened
Whenthe list is inspected, then the query tab is typed
Thenthe empty query shows headings Text, Blocks, Insert, Annotations, GFM and MyST in registry order, each row with an icon, the label and the shortcut where there is one, and the query shows one list, the best match first, each row with its category name
| Query | Outcome |
|---|---|
| empty | commands under the headings Text, Blocks, Insert, Annotations, GFM and MyST in registry order, each with its icon and its shortcut when it has one |
| not empty | one list, the best match first, each command with its category name |
nominalVariants run an action with a ready-made argument
Giventhe strict mode, then the MyST mode
When/h2 is typed and chosen, then /warning is typed
Thenthe line gets the prefix ## as with the Heading popover and the parent entry Heading is not listed, and the Warning alert and the Warning admonition are listed, the MyST one first
| Variants | Outcome |
|---|---|
| Heading 1 to Heading 5 and Paragraph | run Heading with the argument that choosing the same option in the Heading popover gives |
| one Alert per type | run Alert with the argument of the same option in the Alert popover |
| one admonition per type | run Admonition with the argument of the same option in the Admonition popover, plus the version admonitions (see the scenario of the admonition entries below) |
| the pickers Alert, Admonition and Code block | stay listed |
nominalMyST admonitions are listed with their icons
Giventhe MyST mode and an empty text box
When/ is typed
Thenthe list holds an entry "<kind> admonition" for note, tip, hint, important, warning, caution, attention, danger, error, seealso, versionadded, versionchanged and deprecated, and "Custom admonition", each with the icon of its preview callout badge
| Kind | Icon (as the preview callout badge) |
|---|---|
| note | information circle |
| tip, hint, versionadded | light bulb |
| important | star |
| warning, attention, versionchanged | triangle |
| caution | octagon |
| danger, error, deprecated | circle with a cross |
| seealso | circle with an arrow |
| Custom admonition | the Admonition icon |
Giventhe MyST mode and an empty text box
the GFM mode, or the Admonition type popover of the MyST mode
the GFM mode, or the Admonition type popover of the MyST mode
When/versionadded is typed and Enter is pressed
the slash menu or the popover is opened
the slash menu or the popover is opened
Thenthe text box holds the block `:::{versionadded} 1.0`, an empty line and `:::`, with 1.0 selected, in one undo step; versionchanged and deprecated write the same block with their name
the GFM menu lists no admonition entry, and the popover keeps offering only the ten simple types and Custom (the version admonitions are not options of the popover, see SwRS-MDOKFSTUDIO-PALETTE-127)
the GFM menu lists no admonition entry, and the popover keeps offering only the ten simple types and Custom (the version admonitions are not options of the popover, see SwRS-MDOKFSTUDIO-PALETTE-127)
boundaryThe Key commands in MyST mode
Giventhe MyST mode, then the GFM mode
When/kbd is typed
Thenin MyST mode Key (MyST) is first and Key is also listed; in GFM mode Key is first and Key (MyST) is not listed
| Palette mode | Outcome |
|---|---|
| myst | Key and Key (MyST) are both listed; Key (MyST) ranks first for the queries kbd and key |
| gfm | Key is listed, Key (MyST) is not |
refusalA query that matches nothing
Givenan open menu
Whenthe query zzzz is typed, then Backspace removes the query and the slash
Thena disabled row No command is shown, the live region reads No command and Enter inserts a line break, then the menu closes
| State | Outcome |
|---|---|
| query matches no command | a disabled row No command, announced; Enter and Tab are left to the editor |
| Backspace removes the query and the slash | the menu closes |
Implemented in 3
Tested by 4
Replaces
SwRS-MDOKFSTUDIO-PALETTE-268The MyST slash menu lists every admonition directive with its icon superseded superseded by SwRS-MDOKFSTUDIO-PALETTE-238 Markdown file