Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-018
The sticky band shows the current heading path
When a heading of level h1 to h6 of the running text lies at or above the reading line, the extension SHALL show in the sticky band that heading and its nearest parent headings, one line each, up to the depth setting (markdownOkfSchemaStudio.preview.stickyHeadingDepth, rounded, kept between 1 and 6 and 3 when it is not a number; a change of the setting while a preview is open loads the full page again with the new depth rather than patching the content in place), each line written with its # markers and without comment chips, and hide the band and empty its text when no heading lies at or above the reading line.
Step 1 of path 1 in StRS-MDOKFSTUDIO-TOOLBAR-004: from “The reader scrolls the document” to “The band shows the current heading path”.
Scenarios 11
The situations the tests check; open one to read it.
nominalDepth 3
boundarySkipped level
boundaryAbove the first heading
the same document is scrolled past the first heading and the page updates the band
the band shows
nominalEvery heading level
boundaryZero-height heading
boundaryHeadings the table of contents leaves out
nominalComment chips
| Heading | Band line |
|---|---|
| text followed by a comment chip | the heading words only, without the chip and its hidden body |
| plain heading | the heading text unchanged |
boundaryOut of range and not a number
| Value | Depth |
|---|---|
| 0 | 1 |
| 4.6 | 5 |
| 12 | 6 |
| NaN or a string | 3, the default of the setting |
nominalPage uses the configured depth
| Depth | Heading | Band |
|---|---|---|
| 1 | a heading with two parents | only the current heading |
| 6 | a heading with five parents | six lines |
nominalSetting changed
boundarySetting unchanged
Implemented in 4
Tested by 8
- test/core/configuration/previewConfiguration.test.tsunit
- test/core/preview/contentPatch.test.tsunit
- test/page/modules/toolbarReq.requirements.test.tsunit
- test/page/pageSettings.test.tsunit
- test/page/runtimeScroll.test.tsunit
- test/visual/capture_final_checks.pyvisual
- test/visual/scenarioDefinitions1.tsvisual
- test/visual/scenarioDefinitions2.tsvisual