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
| Given | Pressing | Outcome |
|---|---|---|
| A document with the labels intro and setup | Reference | The 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 entries | Citation | The 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
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
| Input | Outcome |
|---|---|
| Enter in the filter with the list narrowed to two entries | The first of the two is inserted |
| Enter in the filter with a filter that matches nothing | Nothing is inserted and the list stays open |
| Cmd or Ctrl with Enter in the filter | The list closes and the edit is finished instead |
| ArrowDown, ArrowDown and ArrowUp from the filter | The focus goes to the first entry, the second entry and the first entry again |
| ArrowUp on the first entry | The focus goes back to the filter |
| Escape in the filter or on an entry | The popover closes and the focus returns to the text box |
boundaryEmpty list, host error and truncation
| Host answer | Outcome |
|---|---|
| No entry for Reference (a document without labels) | Loading... is replaced by No label found. Add one with the Label button. |
| No entry for Citation | Loading... is replaced by No citation key found in the workspace .bib files. |
| An error with a reason | The reason replaces the list |
| An answer with the truncated flag | The note More entries exist. Type to narrow the list. is the last line of the list |
| An answer without the flag | No note is shown |
| An answer that arrives after the popover closed | It is ignored |
The note is appended after the entries only when result.truncated is true.