Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-140

Reference and Citation open a filterable list filled by the host

When the writer presses Reference or Citation, the extension SHALL open a popover with a filter field, show Loading... until the host answers, and then list one button per entry with its detail text, narrowed by the words typed in the filter.

Step 1 of path 1 in StRS-MDOKFSTUDIO-PALETTE-013: from “The palette is shown above the text box” to “The host is asked for the labels”.

Scenarios 4

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

nominalReference and Citation lists
GivenPressingOutcome
A document with the labels intro and setupReferenceThe popover shows a filter field named Filter reference, Loading... and then the labels, each followed by the heading or text after it
The workspace holds bibliography entriesCitationThe filter field is named Filter citation and the keys are listed with their titles

The popover holds an input with data-choice-filter and a list; an entry button shows the label, an em dash and the detail when there is one. A page without a way to ask the host shows The list is not available here. The host request and its answer are in SwRS-MDOKFSTUDIO-TRUST-090.

nominalThe filter narrows the entries
Giventhe list shown
Whenthe writer types a word of a label
Thenonly the entries whose value or detail contains every typed word, ignoring case, remain
when the filter is emptied, all entries are shown again

The words are split on blanks; the label text of an entry that is not its value or detail is not matched.

nominalKeys in the filter and on the entries
InputOutcome
Enter in the filter with the list narrowed to two entriesThe first of the two is inserted
Enter in the filter with a filter that matches nothingNothing is inserted and the list stays open
Cmd or Ctrl with Enter in the filterThe list closes and the edit is finished instead
ArrowDown, ArrowDown and ArrowUp from the filterThe focus goes to the first entry, the second entry and the first entry again
ArrowUp on the first entryThe focus goes back to the filter
Escape in the filter or on an entryThe popover closes and the focus returns to the text box
boundaryEmpty list, host error and truncation
Host answerOutcome
No entry for Reference (a document without labels)Loading... is replaced by No label found. Add one with the Label button.
No entry for CitationLoading... is replaced by No citation key found in the workspace .bib files.
An error with a reasonThe reason replaces the list
An answer with the truncated flagThe note More entries exist. Type to narrow the list. is the last line of the list
An answer without the flagNo note is shown
An answer that arrives after the popover closedIt is ignored

The note is appended after the entries only when result.truncated is true.

Implemented in 1

Tested by 2