Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-072

The Emoji picker filters and inserts one pictograph

When the writer presses Emoji, the extension SHALL open a picker with a field named Filter emoji and about 150 emoji in six named categories, none of them a flag, each button with its English name as title and accessible name, show only the emoji whose English name contains every typed word, case-insensitively, and insert a chosen emoji at the caret, replacing a selection, only when it is one run of at most 16 UTF-16 code units made of pictographs, joiners and variation selectors.

Part of StRS-MDOKFSTUDIO-PALETTE-007, outside the paths drawn on its map.

Scenarios 6

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

nominalPicker contents and focus
Givenan open block editor
Whenthe writer presses Emoji
Thenthe picker shows the filter field and six headings with between 140 and 170 emoji buttons, each with a title, including the check mark, the warning sign and the cross mark, and no flag
the filter field has the focus and the text box does not

The categories are Smileys, People and hands, Nature, Food and drink, Objects and Symbols and status; every emoji has a unique character and a name (lower-case letters, digits, blanks and hyphens).

nominalThe filter matches the words of the English names
Giventhe picker open
Whenwarning is typed in the filter
Thenone emoji remains and only its category heading is shown
TypedOutcome
warningone emoji remains and only its category heading is shown
a word that no name containsno emoji and no heading are shown
an empty filtereverything is shown
several wordsonly the emoji whose lower-cased name contains each typed word, split on blanks, or that is the typed character
nominalA click inserts the emoji and closes the picker
Givena selection and the picker open
the picker open
Whenthe writer clicks an emoji
the writer Shift-clicks an emoji
Thenthe emoji replaces the selection, the picker closes and the text box has the focus
the emoji is inserted and the picker stays open

The insertion uses the live selection of the text box at the moment of the click: an emoji chosen after the text changed is inserted at the live caret, never a stale one.

nominalEnter and arrow keys in the picker
Giventhe filter typed with a match
the filter has the focus
Whenthe writer presses Enter
the writer presses ArrowDown, then ArrowUp on the first row
Thenthe first visible emoji is inserted, and with Shift held the picker stays open
the focus goes to the first visible emoji and back to the filter
KeyOutcome
ArrowRight, ArrowLeftthe focus moves by one over the visible emoji
ArrowDown, ArrowUpthe focus moves by eight over the visible emoji (eight to a row)
Escapethe picker closes and the focus returns to the text box
Cmd or Ctrl with Enter in the filterthe picker closes and the edit is finished
nominalThe emoji action inserts a pictograph
Giventhe argument of a check mark emoji
Whenthe action runs
Thenthe character replaces the selection and the caret is after it
InputArgumentOutcome
`say | now`check mark`say ✅| now`
`say [foo] now`warning sign with variation selector`say ⚠️| now` (the selection is replaced)

The emoji action is available in the block and cell scopes.

refusalOther text
Giventhe argument abc, or an empty argument
Whenthe action runs
Thenno edit is produced
ArgumentOutcome
no argumentno edit
emptyno edit
`a`no edit
`<b>`no edit
a newlineno edit
a check mark followed by `x`no edit
twenty `x`no edit

The pattern is Extended_Pictographic plus U+200D and U+FE0F, with a maximum length of 16.

Implemented in 2

Tested by 3