Behaviour SwRS-MDOKFSTUDIO-FMSCHEMA-039
The title badge counts the issues and jumps to the first one
When the frontmatter has errors or warnings, the extension SHALL show in the table title a badge button with the count of errors then the count of warnings (the count of infos when there is neither), which scrolls to the first row with an issue when pressed, together with a red line under the table that names the missing required fields.
Step 3 of path 1 in StRS-MDOKFSTUDIO-FMSCHEMA-010: from “Violations are marked on their field rows” to “The reader is at the first row with an issue”.
Step 1 of path 2 in StRS-MDOKFSTUDIO-FMSCHEMA-014: from “The link target is checked against the files” to “The badge counts the problems of the link fields”.
Scenarios 7
The situations the tests check; open one to read it.
nominalErrors and warnings
Givena document with 1 error and 2 warnings
Whenthe preview is rendered
Thenthe badge, a button labelled "Go to the first frontmatter issue", reads ✖ 1 ⚠ 2
boundaryCounts of the badge
| Input | Outcome |
|---|---|
| a document without any issue | no badge is shown |
| a document with only the no-schema info row | the badge reads ℹ 1 |
| a document with an error and an info row | the badge reads only the error count |
nominalJump to the issue
Givena long table whose third row has an error
Whenthe writer presses the badge
Thenthe row is scrolled to the centre, its value cell has focus and the highlight attribute is removed after 1.5 s
refusalInfo rows only
Givena table whose only issue is the info row (no field row carries it)
Whenthe writer presses the badge
Thennothing scrolls and nothing is highlighted
nominalMissing required fields summary
Givena schema requiring title and owner and a document with neither
Whenthe preview is rendered
Thena line under the table reads "Missing required fields: title, owner" and has role alert
boundaryNo required field missing
Givena document with both fields
Whenthe preview is rendered
Thenno "Missing required fields" line is shown
nominalLink problems count in the badge
| Input | Outcome |
|---|---|
| a link value nope.md that is not found | the field row carries the issue and the badge counts one error |
| a bundle-relative link without a bundle root | the badge counts one warning |
Implemented in 3
Tested by 6
Known limits (1)
- when only info rows carry issues the badge does nothing.
Replaces
SwRS-MDOKFSTUDIO-FMSCHEMA-038Missing required fields are summarised under the table superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-039 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-040The badge jumps to the first row with an issue superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-039 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-085The badge counts infos only when there is no error or warning superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-039 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-087A link problem counts in the badge superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-039 Markdown file