Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-228

Opening, saving and closing an editor keep the reading position

When a writer opens, saves or closes an editor, the extension SHALL keep the edited block, table or properties section at its screen position: the page scrolls by the palette height on opening and back on closing, and the final save carries the source line and the viewport top (pinLine and pinViewportTop) that the host puts back at the same viewport top on the next render.

Part of StRS-MDOKFSTUDIO-BLOCK-006, outside the paths drawn on its map.

Step 3 of path 1 in StRS-MDOKFSTUDIO-FMEDIT-001: from “The new value is saved” to “The table shows the new value where it was”.

Part of StRS-MDOKFSTUDIO-TABLE-001, outside the paths drawn on its map.

Scenarios 9

The situations the tests check; open one to read it.

nominalThe final save of a block carries the pin
Givenan editor on a paragraph at line 12 whose frame top is at 180 px after a palette shift of 40 px
Whenthe final save is posted
Thenit carries pinLine 12 and pinViewportTop 220, the top of the frame plus the shift, because the rendered paragraph is hidden; an insertion editor uses the line after its bar
nominalTable and properties saves carry the pin
InputOutcome
A table visible in the pane, a cell edited and Enter pressedThe final save carries the source line and the viewport top of the table, and after the re-render the table top is within 3 px of its position at the moment of Enter
The saving status changes the edited element's geometryThe pin is captured before the status changes, preserving the position visible when Save was requested
A table whose rendered rectangle is empty and a final saveThe position of the editor element stands in for the table's
A value save of a field of the properties sectionThe message carries pinLine 1 and the pinViewportTop of the properties section
A field save in the last row of a long tablepinLine is still 1 and the viewport top is that of the section, not of the row
An add or a remove action of the properties sectionIt carries the same fields
A properties section with an empty rectangleNo pin fields are sent
boundaryOut of range
Givena viewport top beyond 100000 px or not finite
Whenthe final save is posted
Thenit carries no pin fields
nominalThe host stores the pin
Givena final save with pinLine 12 and pinViewportTop 180
Whenthe host handles it
Thenthe pin is stored for five seconds and used by the first render of that version or later, which puts the line back at the same viewport top
boundaryA save without a pin
Givena final save without both pin fields
Whenthe host handles it
Thenno pin is stored
nominalOpening an editor keeps the clicked text where it was
Givena paragraph centred in the view and a palette that adds height above the frame
Whenits editor opens and the source arrives
Thenthe page moves by the palette height only, without overshoot or oscillation, and the clicked text moves by at most 2 px
boundaryPage at the top
Givena page scrolled to its very top
Whenan editor opens
Thenthe page is not scrolled
nominalClosing an editor scrolls the page back
Givenan editor that opened with a palette shift of 40 px
Whenit closes
Thenthe page scrolls back by 40 px, within the scroll bounds of the page, and the anchor line is updated
boundaryClose without a shift
Givenan editor that opened without a shift
Whenit closes
Thenthe page is not scrolled

Implemented in 4

Tested by 6

Replaces

SwRS-MDOKFSTUDIO-FMEDIT-057The properties section keeps its place across the save superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-228 Markdown file