Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-FMEDIT-010

List fields and link lists are edited item by item

When a writer opens the editor of a list field, the extension SHALL show one text input per item, each with a drag handle and a remove button, an Add item button and no Save or Cancel button, and let the writer add, remove, reorder and save the items from the keyboard or by drag, with the known Markdown file stems offered on a list of filename-stem links.

Part of StRS-MDOKFSTUDIO-FMEDIT-001, outside the paths drawn on its map.

Scenarios 10

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

nominalA list field shows one input per item
Givena list field with items a and b
Whenthe writer opens its editor
Thentwo inputs labelled List item 1 and List item 2 appear with a handle and a remove button each, plus "+ Add item" and no Save or Cancel button
boundaryWhat saves the list and what does not
InputOutcome
Focus moves out of the editorThe list is saved as an array of strings
Cmd or Ctrl+Enter in an itemOne previewFrontmatterSave with the items as strings is posted
Focus moves to the field menuNo save
A drag in progress (focus change of the drag)No save
Enter with Shift, or Enter during IME composition, in an itemThe list is not touched and nothing is posted
nominalEnter inserts an empty item after the caret item
Givena list editor with items a and b and the caret in a
Whenthe writer presses Enter
Thenan empty item is inserted after a and focused, nothing is posted
boundaryEnter and Backspace on empty items
InputOutcome
Enter in an empty last itemThe item is removed and the list is saved
Enter with Shift or Alt, or during IME compositionThe list is not touched
Backspace in an empty middle itemThe item is removed and the previous input is focused
Backspace in an empty first itemThe item is removed and the next input is focused
Backspace in the only itemThe item is removed and the Add item button is focused
Backspace in a non-empty itemThe key is left to the browser and the item stays
nominalItems reorder by keyboard
Givena list editor with items a, b and c
Whenthe writer presses ArrowDown on the handle of a
Thenthe order becomes b, a, c and the labels are renumbered
boundaryItems reorder by drag
Givena drag of the handle of a over c
Whenthe item is dropped
Thenan insertion line shows during the drag, the order changes, and no save is triggered by the focus change of the drag
nominalLink lists suggest the known Markdown file stems
Givena list field of filename-stem links whose row carries link suggestions
Whenthe writer opens its editor and adds an item
Theneach input, the new one included, references the datalist of the stems
nominalThe suggestions start with the stems closest to the document
Givena list field of filename-stem links in a workspace of more than 500 Markdown files
Whenthe link suggestions of its row are computed
Thenthe stems of the document's own folder come first, then the others by the number of folder steps between the document's folder and the file's folder, then alphabetically; a stem found in several folders appears once, at its closest folder, and the list stops at 500 stems
boundaryAn item matching no stem is warned about and still saved
Givenan item whose value matches no known stem
Whenthe writer types it
Thenthe status warns 'No Markdown file named "x.md" was found. It will be saved as typed.' and saving still posts the value; a missing or invalid suggestion attribute gives no datalist
boundaryThe warning checks every known stem, not only the dropdown
Givena row whose known stems (every Markdown file stem of the index the table resolves links with, sent uncapped, and only when the dropdown was capped) include a stem that is not among the 500 dropdown suggestions
Whenthe writer types that stem in an item
Thenno warning is shown, and a value outside the known stems (such as zzz) still warns

Implemented in 4

Tested by 6

Known limits (2)

Replaces

SwRS-MDOKFSTUDIO-FMEDIT-011Enter in a list item inserts an empty item after it superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-010 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-012List items reorder by keyboard and drag superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-010 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-014Link lists suggest the known Markdown file stems superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-010 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-077Backspace in an empty list item removes it superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-010 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-078Cmd or Ctrl+Enter in a list item saves the list superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-010 Markdown file