Behaviour SwRS-MDOKFSTUDIO-LAYOUT-020
The Width button cycles Margin, Auto and Full and keeps the reading line
When the reader presses the Width button, the extension SHALL switch the width mode in the order Margin, Auto, Full width and back to Margin, update its icon, label and tooltip, and keep the line at the reading position of the page.
Step 1 of path 1 in StRS-MDOKFSTUDIO-LAYOUT-003: from “The text column is as wide as the setting says” to “The width mode has changed”.
Scenarios 4
The situations the tests check; open one to read it.
nominalThree clicks
Giventhe page in Margin width mode with the Width button reading Width: Margin
Whenthe button is clicked three times
Thenthe root attribute data-sphinx-preview-width reads auto, full, margin in turn and the button label reads Width: Auto, Width: Full width and Width: Margin
nominalLabel of every mode
Giventhe button after one and two clicks
Whenits attributes are read
Thenaria-label, title and data-tooltip all read Width: Auto, then Width: Full width, and the icon of the mode is the only one shown
nominalScrolled document
Givena long document scrolled to a position and a width mode change
Whenthe Width button is clicked
Thenthe line at the reading position is taken as the anchor and the page is stabilised, so the same line stays at the reading position after the layout change
boundaryNo anchor yet
Givena page without an anchor
Whenthe Width button is clicked
Thenthe anchor is taken from the line at the current scroll position, when that line is known
Implemented in 2
Tested by 3
Known limits (1)
- docs/user/toolbar.md, the code and the file header of widthMode.ts place the Width button on the third toolbar row, but a bullet of an older released CHANGELOG entry says the second row (stale).
Replaces
SwRS-MDOKFSTUDIO-LAYOUT-040A width mode change keeps the reading line superseded superseded by SwRS-MDOKFSTUDIO-LAYOUT-020 Markdown file