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 field | Outcome |
|---|---|
| Absent from the target's frontmatter | Not in the tooltip |
| Holding a mapping (not a string, number or boolean) | Not in the tooltip |
| Target with a leading byte-order mark | Read normally |
nominalExcerpt beside the link
| Setup | Outcome |
|---|---|
| preview_shows_fields description and a target whose description spans two lines | The excerpt shows the two lines joined by a single space (whitespace collapsed; several fields are joined by "; ") |
| An excerpt longer than the room | Clipped with an ellipsis by CSS; the excerpt element has the full text in its own title |
| A preview field that the target does not define | No 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
| Input | Outcome |
|---|---|
| A target without a line carrying the marker and the identity | No line label is shown |
| An id_marker that names a field the document does not define | No line label is shown and the file name is not used instead |
| The line Evidence ddx while the identity is dd | Does 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 dd | Does not match (the marker must start the line or follow whitespace) |
| An annotation without id_marker | The file name stem without extension of the document itself (not of the target) is the identity |
nominalDetails refresh when the target changes on disk
| Event | Outcome |
|---|---|
| A link showing a tooltip field of its target, and the target is saved with a new value | The link details are resolved again and show the new value |
| The target is created | The link details are resolved again |
| The target is deleted | The link turns into the not-found problem |
nominalTooltip opens on hover and focus
| Trigger | Outcome |
|---|---|
| The pointer rests on a resolved link near the middle of the page | A tooltip with its title appears below it, at most 480 px wide |
| A link at the bottom of the page is focused | The tooltip is placed above it and stays clear of the toolbar |
| A link that is pending | No tooltip (see SwRS-MDOKFSTUDIO-FMSCHEMA-063) |
| An invalid or unavailable span | Focusable, with the same tooltip |
nominalTooltip closes
| Trigger | Outcome |
|---|---|
| Escape is pressed | The tooltip is removed and the link has its title back |
| The page scrolls | The tooltip is removed |
| The page resizes, the pointer and focus leave the link, or a click lands elsewhere | The tooltip is removed |
Implemented in 5
Tested by 12
- test/core/frontmatter/fileLinks.holes.test.tsunit
- test/core/frontmatter/fileLinks.test.tsunit
- test/core/frontmatter/frontmatterFence.test.tsunit
- test/core/frontmatter/propertiesTable.test.tsunit
- test/core/navigation/previewNavigation.holes.test.tsunit
- test/core/navigation/previewNavigation.test.tsunit
- test/host-memory/memoryHostSession.test.tsunit
- test/integration/previewEditing.test.tsintegration
- test/node-services/linkedTargetWatch.test.tsunit
- test/page/runtimeScroll.test.tsunit
- test/session/eventFanOut.test.tsunit
- test/visual/scenarioDefinitions2.tsvisual
Known limits (1)
- a link whose annotation lists no tooltip field and no preview field and sets no show_line_number gets no watcher of its own and relies on the preview-wide watcher.
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