Behaviour SwRS-MDOKFSTUDIO-TABLE-064
The table bar rides down with a tall table and stays visible
When a cell editor is open and the table bar would lie under the sticky band or the preview controls, the extension SHALL keep the bar visible, by translating it down with a tall table to 4 px below the usable top and never past the end of the table, and by scrolling the page up by exactly the missing distance when the bar appears above the reading offset. The bar SHALL paint above the row and column handles, so that no handle takes a press meant for a button of the bar.
Scenarios 9
The situations the tests check; open one to read it.
nominalScrolled into a tall table
Givena table taller than the pane scrolled so that its top is under the sticky band
Whenthe page scrolls
Thenthe bar is translated down to the usable top plus 4 px, the table text does not move, and the bar carries the stuck mark
boundaryNear the end of the table
Giventhe table's bottom close to the usable top
Whenthe page scrolls
Thenthe translation is limited so that the bar bottom does not pass the table bottom
boundarySize of the bar against the viewport
| Input | Outcome |
|---|
| A bar taller than 40 percent of the viewport and a table scrolled under the band | The bar stays in its place above the table: the shift stays 0 px and the stuck mark is not set |
| A bar at most 40 percent of the viewport and the same scroll | The bar rides down |
nominalWindow resize while the editor is open
| Input | Outcome |
|---|
| A bar translated down and the window resized (the resize event fires) | The shift is recomputed for the new geometry |
| The editor closed, then the window scrolls or is resized | The scroll and resize listeners of the bar are gone and nothing is recomputed |
nominalBar appearing above the reading offset
| Input | Outcome |
|---|
| The bar appears 30 px above the usable top with the page scrolled down | The page scrolls up by 30 px as a preview-owned scroll and the edit anchor is moved by the same delta |
| The page is scrolled to 10 px and the bar is 30 px above the usable top | The scroll is limited to 10 px |
boundaryNo scroll into view
| Input | Outcome |
|---|
| A bar at or below the usable top | No scroll is made |
| Only the empty part of the bar lies under the preview controls | No scroll is made |
| A bar above the usable top and a selected cell whose bottom plus the delta passes the viewport height | No scroll is made |
boundaryBar opening under the preview controls at the top of the page
| Input | Outcome |
|---|
| The bar opens with its top under the preview controls, its box reaching under them, and the page scrolled less than the missing distance (a table right under the first heading, page at its top) | The bar gives up the width from 4 px left of the controls to the right edge of its column (`--sphinx-preview-table-menu-inset`): its buttons wrap left of the controls and every one stays clickable |
| The same bar with the page scrolled enough to bring it below the controls | No inset: the scroll into view above reveals it |
| A bar that opens below the controls | No inset |
| A narrow pane where the inset would leave the bar under 200 px | No inset: the bar keeps the whole width |
| A bar that gets the inset | The inset is decided before the reveal, from the page as it is when the bar appears; the buttons then lie left of the controls and the page is not scrolled for them |
The inset is measured when the bar is filled, never on a scroll, so a scroll never reflows the page.
nominalA later layout change hides the bar again
| Input | Outcome |
|---|
| The bar is shown and its status wraps onto a new line, which moves the bar above the usable top, then the edit anchor is restored | The bar is revealed again by the missing distance |
| The bar size is unchanged and the writer has scrolled, then the edit anchor is restored | The writer's scroll is not undone |
boundaryA handle on a button of the bar
| Input | Outcome |
|---|
| A row or column handle whose box lies on a button of the bar | The press on the button reaches the button: the bar is positioned in the flow (no offset) with a z-index above the handle layer, so the handle does not take it |