Behaviour SwRS-MDOKFSTUDIO-FMSCHEMA-005
Without a schema the table lists the keys in source order, escaped
When the frontmatter has no string `type`, or no schema lookup is made for the document, the extension SHALL show a two-column table headed Names and Values that lists the keys in source order, without type icons or a Description column, with every name, value, tooltip and data attribute escaped as text and its section marked as source line 1, and SHALL keep each key on one line in a key column as wide as its longest key, up to 40% of the table.
Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-FMSCHEMA-001, in the state “The properties table is shown”.
Step 1 of path 2 in StRS-MDOKFSTUDIO-FMSCHEMA-006: from “The frontmatter has no string `type`” to “The generic Names and Values table is shown”.
Scenarios 5
The situations the tests check; open one to read it.
nominalNo type
boundaryOther reasons for the generic table
| Input | Outcome |
|---|---|
| A document whose frontmatter is `type: 5` then `a: 1` | The same generic two-column table lists type then a and no schema lookup message appears |
| A document whose frontmatter is `type: ''` then `a: 1` | The generic table is shown and no schema lookup is made, so no info row appears |
| A schema exists for the type and the workspace is in Restricted Mode | The table is generic and no field is editable |
| A Markdown file opened outside every workspace folder with a typed frontmatter | The table is generic |
refusalMarkup in a name or a value
| Input | Outcome |
|---|---|
| A field whose value is a bold tag, an ampersand and double quotes written as a YAML string | The Value cell shows the characters literally (escaped as lt, amp and quot entities) and no bold element is created |
| A field whose name contains an angle bracket | The name appears as text in the Name cell and in the row attributes, never as an element |
nominalThe properties section maps to source line 1
the editor cursor is on line 1 of the source and the preview syncs to the source line
the preview scrolls back to the top where the properties section sits
boundaryThe key column fits its keys
| Input | Outcome |
|---|---|
| Keys such as name, description and metadata next to a long description | The key column is as wide as the longest key; no key breaks inside a word and the Value column wraps in the rest |
| A long description and a nested metadata block of code next to short keys (a skill file), or keys shorter than the Names label | The key column keeps the width of its longest key (never a few pixels), no key breaks inside a word, the Names label stays whole and the value cell wraps its text and keeps its code block inside the cell |
| A key wider than 40% of the table | The key ends with an ellipsis, the key column stays within 40% of the table, and the full key is the tooltip of the key (shown for keys of more than 24 characters) |
Implemented in 3
Tested by 6
Known limits (2)
- the generic header reads Names / Values while a schema table reads Name / Value.
- a file outside every workspace folder in a trusted workspace is also told that schema validation requires a trusted workspace, which is misleading.