Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-037
The column sits below the toolbar on the right and never covers the text
When the column is open, the extension SHALL place it eight pixels below the toolbar and, on a pane of at least 760 pixels, show it as a fixed 240 pixel column 16 pixels from the right edge with 256 pixels reserved from the content so that the text and the tables stay clear of it, and on a narrower pane show a rail on the right with one tick per heading instead, open the column as an overlay above the text while the pointer or the focus is on the rail, close it 300 ms after both left or on Escape, go to a heading when its tick is clicked, reserve 16 pixels at the end of the content for the rail, place the overlay 40 pixels lower than the column top so that it stays clear of the open toolbar tooltip, and close the overlay on Escape only when the key comes from the overlay, the rail or no focused element and no other handler consumed it.
Step 2 of path 2 in StRS-MDOKFSTUDIO-TOOLBAR-006: from “The column is open” to “A rail with one tick per heading is shown”.
Scenarios 9
The situations the tests check; open one to read it.
nominalTop edge follows the toolbar
| Input | Outcome |
|---|---|
| An open column and a toolbar whose bottom edge is at 92 px | Its top variable (--sphinx-preview-toc-top) is 100 px, which is the toolbar bottom plus 8 px |
| The window is resized | The column is placed again below the toolbar |
| The toolbar is expanded or collapsed, even with quick clicks | The column is placed again below the toolbar when the animation of the rows ends |
| A toolbar bounds value that is not finite | The top is 8 px |
nominalWide pane
boundaryPane width
| Input | Outcome |
|---|---|
| Exactly 760 px with the column open | The column is shown |
| 900 px with the column open | The column is shown (240 px wide, 16 px from the right edge, 256 px reserved) |
| 460 px with the button pressed | The root attribute is open, the button is pressed, the rail is displayed, the column is not displayed until the rail is hovered or focused and the content right edge moved in by the 16 px of the rail only |
| The 460 px pane resized to 900 px | The column shows without a new press and the rail goes |
nominalNarrow pane rail and overlay
| Input | Outcome |
|---|---|
| 460 px, TOC on, a document with three headings of h1 to h4 | The rail holds three ticks, each labelled with its heading, and the tick of the section at the reading line is marked current |
| The pointer enters the rail, or the focus enters it | The column opens as an overlay (data-sphinx-preview-toc-overlay is open) |
| The pointer leaves the rail and the overlay | The overlay stays 299 ms and is closed at 300 ms; entering the overlay in between keeps it open |
| Escape while the overlay is open | The overlay closes at once and the rail takes the focus; another key changes nothing |
| A click on a tick | The page goes to that heading |
| A click on an entry of the overlay, or the TOC turned off | The overlay closes |
nominalText and tables stay clear in Margin and Full width
boundaryZoom 200
nominalContent padded for the rail
nominalOverlay clear of the tooltip
boundaryEscape belongs to its owner
| Input | Outcome |
|---|---|
| Overlay open, Escape typed in the text or in a field (target outside the overlay and the rail) | The overlay stays open and the key is not prevented |
| Overlay open, Escape already consumed by another handler | The overlay stays open |
| Overlay open, Escape typed in the overlay, on the rail, or with no focused element (body) | The overlay closes at once and the key is prevented |