Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-001

The palette mode decides the button sets, in registry order

When the extension builds the edition palette of a block editor, the extension SHALL start it with a select named Palette buttons that offers Strict Markdown, GitHub (GFM), MyST and Full and shows the current mode, and list below it the buttons of that mode in the order of the registry, marking the start of each group.

Step 2 of path 1 in StRS-MDOKFSTUDIO-PALETTE-002: from “The focus is in the mode select” to “The palette shows the buttons of the chosen mode”.

Scenarios 10

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

nominalSelect in the palette
Givenan open block editor in the GFM mode
Whenthe palette is inspected
Thenits first control is a select with the accessible name Palette buttons and four options with the values strict, gfm, myst and full labelled Strict Markdown, GitHub (GFM), MyST and Full, and the option gfm is selected
nominalEach mode adds its buttons to those of the mode before
Givenan open paragraph editor in the strict, gfm, myst or full mode
Whenthe palette is inspected
Thenthe buttons are those of the row of the mode, in registry order, the select reads the mode and the palette carries data-palette-mode with the mode name
ModeButtons shownNot in the palette
strictHeading, Bold, Italic, Strikethrough, Colour, Colour code, Link, Image, Code block, Blockquote, Horizontal rule, Table, Emoji, TODO and Thread; Colour code is hidden until the caret is in a colour code; the two list actions of the slash menu have no buttonno GitHub or MyST button: Alert, Checkbox, HTML table, Admonition and Figure
gfmthe strict buttons, followed by the eight GitHub buttons Alert, Checkbox, HTML table, Collapsible, Footnote, Mermaid, Column alignment and KeyAdmonition, Math and Figure
mystthe GitHub buttons, followed by the MyST buttons Admonition, Definition list, Math, Subscript, Superscript, Label, Reference, Document link, Citation, Dropdown, Table with caption, List table, Pipe table, Figure and Key (MyST); List table and Pipe table are hidden unless the caret is in a table of the matching formnone; both Key (the HTML kbd element) and Key (MyST) (the kbd role) are present, because the modes add up
fullthe MyST buttons, followed by the Full buttons Vega-Lite chart and Vega chart (see SwRS-MDOKFSTUDIO-PALETTE-278)nothing of the other modes is missing
nominalOrder and groups
Giventhe MyST mode
Whenthe buttons are listed
Thenthey follow the registry order from Heading to Key (MyST), and the first button of each group other than the first carries data-edit-group-start (the groups are inline, block, insert, annotation, github, myst and full)
nominalThe editor opened from an insert point
Giventhe GFM mode and an editor opened from an insert point
Whenthe palette is inspected
Thenits buttons equal those of a paragraph editor in the GFM mode and it carries data-palette-mode gfm, and in the strict and the MyST modes the two palettes list the same buttons as well
nominalChoosing another mode
Givenan editor in the strict mode with some text typed
Whenthe writer chooses MyST in the select
Thenthe buttons are rebuilt at once, the MyST buttons are shown, the select reads MyST, the text and the focus stay in the text box and no save is posted (the choice is stored for the workspace, see SwRS-MDOKFSTUDIO-LIFE-169)
refusalSame mode again or a value outside the four modes
Givena palette in the GFM mode
Whenthe select fires a change
Thenthe outcome is the one of the table
Select changeOutcome
to gfm againnothing is rebuilt and no change is reported
to an unknown valuethe select shows gfm again and no mode change is reported
to strictthe change is applied and reported once
boundaryThe setting defaultPaletteMode
Giventhe setting markdownOkfSchemaStudio.editing.defaultPaletteMode
Whenthe editing configuration is read
ThendefaultPaletteMode is the value of the table (the start of a page follows SwRS-MDOKFSTUDIO-LIFE-170)
SettingdefaultPaletteMode
strict, gfm, myst or full (myst for example)the value
not setgfm
the text html or a numbergfm
nominalThe cell formatting group follows the mode
Givenan open table cell editor (the group is specified in SwRS-MDOKFSTUDIO-TABLE-085)
Whenthe cell formatting group is inspected
Thenthe group holds no mode select, and its buttons are those of the table
ModeCell formatting group
gfmBold, Italic, Strikethrough, Colour, Colour code, Link, Emoji and Key, and no Subscript or Superscript
mystalso Subscript, Superscript and Key (MyST)
refusalA mode that does not list an insertion command offers none
Giventhe palette or the slash menu in a mode below the one that lists a command
Whenthe palette is shown or the slash is typed
Thenthe command is not offered, as the table says; the constructs of the document are rendered all the same (the insertion itself is SwRS-MDOKFSTUDIO-PALETTE-278)
CommandListed inNot offered in
Vega-Lite chart and Vega chart (/chart, /vega)fullstrict, gfm, myst
PlantUML diagram (/plantuml, /uml)fullstrict, gfm, myst
Content tabs (/tab-set, /tabs)myst and fullstrict, gfm
nominalThe mode setting and the stored choice
Giventhe select of the palette, the setting defaultPaletteMode or a stored choice
Whenthe mode is chosen
Thenthe table says what follows
InputOutcome
the select of the paletteoffers Strict Markdown, GitHub (GFM), MyST and Full
the setting defaultPaletteMode or a stored choice fullthe page starts in the Full mode
a message previewPaletteModeChanged with mode fullaccepted and stored for the workspace

Implemented in 5

Tested by 8

Replaces

SwRS-MDOKFSTUDIO-PALETTE-265The Full palette mode adds Vega-Lite and Vega chart commands superseded superseded by SwRS-MDOKFSTUDIO-PALETTE-001, SwRS-MDOKFSTUDIO-PALETTE-278 Markdown file
SwRS-MDOKFSTUDIO-PALETTE-273The MyST palette mode adds a Content tabs command superseded superseded by SwRS-MDOKFSTUDIO-PALETTE-001, SwRS-MDOKFSTUDIO-PALETTE-278 Markdown file
SwRS-MDOKFSTUDIO-PALETTE-274The Full palette mode adds a PlantUML diagram command superseded superseded by SwRS-MDOKFSTUDIO-PALETTE-001, SwRS-MDOKFSTUDIO-PALETTE-278 Markdown file