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
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
| Typed | Outcome |
|---|---|
| warning | one emoji remains and only its category heading is shown |
| a word that no name contains | no emoji and no heading are shown |
| an empty filter | everything is shown |
| several words | only 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
the picker open
the writer Shift-clicks an emoji
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
the filter has the focus
the writer presses ArrowDown, then ArrowUp on the first row
the focus goes to the first visible emoji and back to the filter
| Key | Outcome |
|---|---|
| ArrowRight, ArrowLeft | the focus moves by one over the visible emoji |
| ArrowDown, ArrowUp | the focus moves by eight over the visible emoji (eight to a row) |
| Escape | the picker closes and the focus returns to the text box |
| Cmd or Ctrl with Enter in the filter | the picker closes and the edit is finished |
nominalThe emoji action inserts a pictograph
| Input | Argument | Outcome |
|---|---|---|
| `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
| Argument | Outcome |
|---|---|
| no argument | no edit |
| empty | no edit |
| `a` | no edit |
| `<b>` | no edit |
| a newline | no 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.