Behaviour SwRS-MDOKFSTUDIO-LAYOUT-011
A control under the floating toolbar is moved or narrowed out of its way
When the floating toolbar covers the first control of the page (the open first-block editor, the Start writing button or the controls of a leading properties table), the extension SHALL publish the smallest clearance and inset that move it down or narrow it out of the toolbar's way, and a clearance of 0 and an inset of 0 when the toolbar sits beside the text column or ends above the 40 px gap, so that the first element keeps exactly 40 px.
Step 1 of path 2 in StRS-MDOKFSTUDIO-LAYOUT-004: from “The floating toolbar covers the first control of the page” to “The first control is clear of the toolbar”.
Scenarios 8
The situations the tests check; open one to read it.
nominalToolbar beside the column
Givena column from 100 to 700 px and a toolbar that starts at 800 px, with an open first-block editor
Whenthe clearance is measured
Thenthe published first clearance and first inset are both 0 px
nominalToolbar ending above the gap
Givena 460 px column and a toolbar that overlaps it horizontally but ends at 20 px, above the 40 px gap
Whenthe clearance is measured
Thenthe clearance and the inset are 0 px
nominalFirst-block editor narrowed
Givena column from 0 to 900 px with a content box from 16 to 884 px, a toolbar from 600 to 850 px and an open first-block editor
Whenthe clearance is measured
Thenthe inset is 292 px (884 minus 600 plus 8), the clearance is 0 and the inset is published as --sphinx-preview-first-inset
a hidden Start writing button because the editor replaced it, in the same wide pane, counts as an open first-block editor: clearance 0 and inset 292 px
a hidden Start writing button because the editor replaced it, in the same wide pane, counts as an open first-block editor: clearance 0 and inset 292 px
nominalFirst-block editor pushed down
Givena 460 px column, a toolbar from 200 to 450 px reaching down to 84 px and an open first-block editor, so that narrowing it would leave the frame under 320 px
Whenthe clearance is measured
Thenthe clearance is 52 px (toolbar bottom 84 plus 8 margin minus 40 gap), the inset is 0 and the frame top is just below the toolbar
a plain paragraph as the first element in the same pane keeps its 40 px margin, because the clearance applies only to the first-block editor, the Start writing button and a leading properties table
a plain paragraph as the first element in the same pane keeps its 40 px margin, because the clearance applies only to the first-block editor, the Start writing button and a leading properties table
nominalStart writing button and properties table controls
| Input | Outcome |
|---|---|
| 460 px column, toolbar from 200 to 450 px reaching down to 84 px, Start writing button from 16 to 316 px | Clearance 52 px |
| 900 px column, toolbar from 600 px, Start writing button from 16 to 121 px | Clearance 0 px |
| 900 px column, toolbar from 600 to 850 px, right-aligned Description toggle of a leading properties table at 800 to 824 px | Inset 292 px, clearance 0 |
| 460 px column, toolbar from 200 px over the right-aligned toggle, so that less than 320 px would remain | The table is not shortened (inset 0 px) and is pushed down instead (clearance above 0) |
| 460 px column, left-aligned badge of a leading properties table at 250 to 310 px with a top of 45 px under a toolbar reaching 84 px | Clearance 47 px (toolbar bottom 84 plus 8 margin minus the badge top 45) |
| 900 px column whose controls are all clear of the toolbar | Clearance and inset 0, the table keeps its 40 px gap |
boundaryPalette bottom edge of the first-block editor
| Input | Outcome |
|---|---|
| Column 0 to 900 px, toolbar 600 to 850 px reaching down to 84 px, open first-block editor (frame gives up 292 px) | --sphinx-preview-first-bar-bottom is 0px and the palette stays in the 40 px place, while --sphinx-preview-toolbar-bottom is 92px |
| 460 px column, toolbar 200 to 450 px reaching down to 84 px, open first-block editor (inset 0) | --sphinx-preview-first-bar-bottom is 92px, so the palette sticks below the toolbar |
nominalThe clearance follows layout changes
Givena leading properties table whose Description toggle moves under the toolbar after the last measurement
the properties section is replaced by a new one
a 360 px pane in edit mode with the toolbar collapsed to its first row and a paragraph, then a table, as first element
a page whose first element sits 40 px below the top, and a width mode change that makes the column narrower
the properties section is replaced by a new one
a 360 px pane in edit mode with the toolbar collapsed to its first row and a paragraph, then a table, as first element
a page whose first element sits 40 px below the top, and a width mode change that makes the column narrower
Whenthe window load event fires
the next update runs
the page is rendered
the Width button is clicked
the next update runs
the page is rendered
the Width button is clicked
Thenthe inset is measured again and published (192 px in the tested layout)
the new section is observed for size changes
the paragraph and the table start exactly 40 px (within 4 px) below the top; and with a settled page, a click on the collapse chevron makes the toolbar-collapse callback measure the first-element clearance again
the first-element clearance is measured again, so the first element keeps its 40 px gap below the toolbar at the new width; a width mode change that leaves the column width and the toolbar position unchanged still measures again (the change callback calls the update unconditionally) and the published values stay the same
the new section is observed for size changes
the paragraph and the table start exactly 40 px (within 4 px) below the top; and with a settled page, a click on the collapse chevron makes the toolbar-collapse callback measure the first-element clearance again
the first-element clearance is measured again, so the first element keeps its 40 px gap below the toolbar at the new width; a width mode change that leaves the column width and the toolbar position unchanged still measures again (the change callback calls the update unconditionally) and the published values stay the same
boundaryToolbar bottom edge for the sticky palette
| Input | Outcome |
|---|---|
| 460 px column and a toolbar from 200 to 450 px ending at 84 px | --sphinx-preview-toolbar-bottom is 92px |
| 600 px column from 100 px and a toolbar from 800 px | The toolbar bottom is 0px |
Implemented in 2
Tested by 4
Known limits (4)
- The 480 px limit between wide and narrow is a rule of the visual tests only: the code decides by overlap with the toolbar and a 320 px minimum frame width, so a 481 px pane with a long toolbar could push content down as well.
- A non-interactive first element, such as a paragraph or a table, is never pushed down: only the first-block editor, the Start writing button and a leading properties table take the clearance. A first paragraph or heading wraps its text around the toolbar instead, and a first table or other box keeps its 40 px place (SwRS-MDOKFSTUDIO-LAYOUT-043).
- Older documents (archive 004 T8, CHANGELOG 0.2.1) describe a 56 px first-block margin and a 24 px Start writing margin; the uniform 40 px with an inset replaces them. Visual scenarios v07 to v09 keep the older assertion of at least 20 px.
- The variable --sphinx-preview-first-bar-bottom is 0 whenever the inset is above 0, including a leading properties table that gave up the toolbar width; only the first-block editor palette reads it, falling back to --sphinx-preview-toolbar-bottom when it is unset.
Replaces
SwRS-MDOKFSTUDIO-LAYOUT-012A first-block editor too narrow to be narrowed is pushed below the toolbar superseded superseded by SwRS-MDOKFSTUDIO-LAYOUT-011 Markdown file
SwRS-MDOKFSTUDIO-LAYOUT-014A first-block editor gives up the width the toolbar covers superseded superseded by SwRS-MDOKFSTUDIO-LAYOUT-011 Markdown file
SwRS-MDOKFSTUDIO-LAYOUT-015The Start writing button is pushed only when it sits under the toolbar superseded superseded by SwRS-MDOKFSTUDIO-LAYOUT-011 Markdown file
SwRS-MDOKFSTUDIO-LAYOUT-016A leading properties table gives up the toolbar width for its Description toggle superseded superseded by SwRS-MDOKFSTUDIO-LAYOUT-011 Markdown file
SwRS-MDOKFSTUDIO-LAYOUT-018The clearance is measured again after layout events, in bounded bursts superseded superseded by SwRS-MDOKFSTUDIO-LAYOUT-011 Markdown file
SwRS-MDOKFSTUDIO-LAYOUT-037A leading properties table is pushed down for a control under the toolbar superseded superseded by SwRS-MDOKFSTUDIO-LAYOUT-011 Markdown file
SwRS-MDOKFSTUDIO-LAYOUT-042A first-block editor's palette keeps its place unless the frame is under the toolbar superseded superseded by SwRS-MDOKFSTUDIO-LAYOUT-011 Markdown file