Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-FMSCHEMA-067

A link tooltip shows the fields and an excerpt of the linked file

When a link annotation lists `tooltip_shows_fields`, `preview_shows_fields` or `show_line_number`, the extension SHALL show the details of the resolved target with the link, adding to its tooltip one "name: value" line per listed field found in the target's frontmatter (counting only string, number and boolean values), showing beside it an excerpt of the listed preview fields and the line of its marker, refreshing them when the target changes on disk, and presenting the tooltip on hover and focus until it closes.

Another outcome at step 4 of path 1 in StRS-MDOKFSTUDIO-FMSCHEMA-014, in the state “The link is a focusable link”.

Scenarios 8

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

nominalTooltip fields found
Giventooltip_shows_fields owner and count and a target whose frontmatter has owner Bob and count 3
Whenthe table is rendered
Thenthe tooltip lists the path, then owner: Bob and count: 3
boundaryTooltip fields missing or structured
Listed fieldOutcome
Absent from the target's frontmatterNot in the tooltip
Holding a mapping (not a string, number or boolean)Not in the tooltip
Target with a leading byte-order markRead normally
nominalExcerpt beside the link
SetupOutcome
preview_shows_fields description and a target whose description spans two linesThe excerpt shows the two lines joined by a single space (whitespace collapsed; several fields are joined by "; ")
An excerpt longer than the roomClipped with an ellipsis by CSS; the excerpt element has the full text in its own title
A preview field that the target does not defineNo excerpt is shown
nominalLine of the marker
Givenbasename_marker Evidence, id_marker id, the document id dd, show_line_number true and a target whose tenth line is Evidence dd
Whenthe table is rendered
Thenthe link shows line 10 (the 1-based line of the first line of the target that carries the marker followed by the document identity)
boundaryNo line label
InputOutcome
A target without a line carrying the marker and the identityNo line label is shown
An id_marker that names a field the document does not defineNo line label is shown and the file name is not used instead
The line Evidence ddx while the identity is ddDoes not match (the identity must be followed by the end of the line or a character that is not a letter, digit, underscore or hyphen)
The line xEvidence ddDoes not match (the marker must start the line or follow whitespace)
An annotation without id_markerThe file name stem without extension of the document itself (not of the target) is the identity
nominalDetails refresh when the target changes on disk
EventOutcome
A link showing a tooltip field of its target, and the target is saved with a new valueThe link details are resolved again and show the new value
The target is createdThe link details are resolved again
The target is deletedThe link turns into the not-found problem
nominalTooltip opens on hover and focus
TriggerOutcome
The pointer rests on a resolved link near the middle of the pageA tooltip with its title appears below it, at most 480 px wide
A link at the bottom of the page is focusedThe tooltip is placed above it and stays clear of the toolbar
A link that is pendingNo tooltip (see SwRS-MDOKFSTUDIO-FMSCHEMA-063)
An invalid or unavailable spanFocusable, with the same tooltip
nominalTooltip closes
TriggerOutcome
Escape is pressedThe tooltip is removed and the link has its title back
The page scrollsThe tooltip is removed
The page resizes, the pointer and focus leave the link, or a click lands elsewhereThe tooltip is removed

Implemented in 5

Tested by 12

Known limits (1)

Replaces

SwRS-MDOKFSTUDIO-FMSCHEMA-068A link shows an excerpt of the linked file superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-067 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-069A link can show the line of its marker superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-067 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-070Linked file details refresh when the target changes on disk superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-067 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-071A link tooltip appears on hover and focus superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-067 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-072A link tooltip closes on leaving, Escape, scroll, resize and outside click superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-067 Markdown file