Markdown OKF-Schema Studio

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
InputOutcome
An open column and a toolbar whose bottom edge is at 92 pxIts top variable (--sphinx-preview-toc-top) is 100 px, which is the toolbar bottom plus 8 px
The window is resizedThe column is placed again below the toolbar
The toolbar is expanded or collapsed, even with quick clicksThe column is placed again below the toolbar when the animation of the rows ends
A toolbar bounds value that is not finiteThe top is 8 px
nominalWide pane
Givena 900 px pane with the column open
Whenthe page is measured
Thenthe column is 240 px wide with a 16 px gap on the right, the content area is 256 px narrower and the column stays inside the viewport
boundaryPane width
InputOutcome
Exactly 760 px with the column openThe column is shown
900 px with the column openThe column is shown (240 px wide, 16 px from the right edge, 256 px reserved)
460 px with the button pressedThe 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 pxThe column shows without a new press and the rail goes
nominalNarrow pane rail and overlay
InputOutcome
460 px, TOC on, a document with three headings of h1 to h4The 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 itThe column opens as an overlay (data-sphinx-preview-toc-overlay is open)
The pointer leaves the rail and the overlayThe overlay stays 299 ms and is closed at 300 ms; entering the overlay in between keeps it open
Escape while the overlay is openThe overlay closes at once and the rail takes the focus; another key changes nothing
A click on a tickThe page goes to that heading
A click on an entry of the overlay, or the TOC turned offThe overlay closes
nominalText and tables stay clear in Margin and Full width
Givena 900 px pane with a 10-column table and the column open
Whenthe width mode is Margin, then Full width
Thenthe content column and every table end at or before the column's left edge and the page has at most 1 px of horizontal overflow
boundaryZoom 200
Givenzoom 200 percent with the column open on a wide pane
Whenthe page is measured
Thenthe content still ends before the column and does not scroll sideways
nominalContent padded for the rail
Givena 460 px pane with the table of contents on
Whenthe page is measured
Thenthe content column ends 16 px before the pane edge, so the rail never covers text, and a 900 px pane keeps its 256 px reserve
nominalOverlay clear of the tooltip
Givena 460 px pane, the rail hovered, and the toolbar tooltip of the TOC button open
Whenthe overlay is placed
Thenthe overlay top is 40 px below the column top variable and lies below the bottom of the tooltip
boundaryEscape belongs to its owner
InputOutcome
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 handlerThe 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

Implemented in 2

Tested by 5

Replaces

SwRS-MDOKFSTUDIO-TOOLBAR-133The narrow-pane rail keeps the text and the other Escape handlers clear superseded superseded by SwRS-MDOKFSTUDIO-TOOLBAR-037 Markdown file