Behaviour SwRS-MDOKFSTUDIO-FMSCHEMA-006
Property values read like YAML in a lean table
When the properties table is displayed, the extension SHALL show each frontmatter value in the Value cell as YAML reads it, a mapping without a link as a YAML code block, a boolean as a read-only checkbox, a list as at most 50 dash-marked items and an empty list or null as `[]` or `null`, inside a table drawn without outer border that fits a preview 640 px wide or less.
Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-FMSCHEMA-001, in the state “The properties table is shown”.
Scenarios 5
The situations the tests check; open one to read it.
nominalValue kinds
| Input | Outcome |
|---|---|
| A mapping value `obj` with the keys `a: 1` and `b` holding a list with x | The Value cell of obj holds a code block in YAML syntax reading `a: 1`, `b:` and ` - x` on separate lines |
| A list field that holds a mapping item | The list item is shown with its keys as a nested key and value list, not as raw JSON |
| `flag: true` | The Value cell holds a checked checkbox with aria-disabled true and tabindex -1, and the word true |
| `flag: false` | The Value cell holds an unchecked checkbox with aria-disabled true and the word false |
| `empty: []` | The Value cell reads [] |
| `none:` with no value | The Value cell reads null |
boundaryList limit
| Input | Outcome |
|---|---|
| A list field with 52 items | 50 items are listed, one dash-marked item per line, and the text "+ 2 more" follows them |
| A list field with exactly 50 items | All 50 items are listed and no "more" text appears |
nominalLean frame
Givena document with frontmatter in a dark, a white and a cream theme
Whenthe preview is rendered
the header row is inspected
the header row is inspected
Thenthe section and table have no border and no background, the cells are transparent and the title Frontmatter properties has no background
the header cells show the translucent grey background and the data cells do not, and an error row has the red background
the header cells show the translucent grey background and the data cells do not, and an error row has the red background
boundaryContrast thresholds
| Input | Outcome |
|---|---|
| The title badge in a dark, a white and a cream theme | It reaches 2.5:1 contrast |
| The description text | It reaches 2.2:1 and is smaller than the value text |
| The value text | It reaches 4:1 |
boundaryNarrow preview
| Input | Outcome |
|---|---|
| A preview 460 px wide showing a schema table with alert rows and link details | The page has no horizontal overflow and long names, values and links wrap inside their cells, with fixed columns |
| A preview wider than 640 px | The table keeps its normal automatic layout |
Implemented in 1
Tested by 3
Known limits (2)
- the helper formatValue of the table renderer is never called and would show an em dash for null; today null shows the word null.
- a word can still break in the middle of a name in a narrow preview; there is no stacked layout.
Replaces
SwRS-MDOKFSTUDIO-FMSCHEMA-007Boolean values show as read-only checkboxes superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-006 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-008Long lists are cut after fifty items superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-006 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-009Empty lists and null values show as YAML tokens superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-006 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-010The properties table has a lean frame superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-006 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-011The table fits a narrow preview superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-006 Markdown file