Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-217

The comment editors stay inside the window and follow their text

When a reader opens the new comment box or the thread popover with its reply box, the page SHALL place it entirely inside the window, below its anchored text or above it when there is no room below, and SHALL move it with that text on every scroll, even when the text is out of view.

Step 2 of path 1 in StRS-MDOKFSTUDIO-REVIEW-003: from “The Comment button is shown” to “The comment box is open”.

Scenarios 3

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

nominalThe editor opens next to its text, inside the window
GivenWhenThen
text with room below it for the editorthe new comment box or the thread popover opensthe editor sits 6 px below the text
text near the bottom, no room below, room abovethe editor opensthe editor sits 6 px above the text and is entirely inside the window
text in view, no room above or belowthe editor opensthe editor is moved up so its bottom edge is 8 px above the bottom of the window, and at least 8 px from the top
a window narrower than the editorthe editor opensthe editor is as wide as the window minus 16 px, and at least 8 px from each side
nominalThe editor follows its text on scroll
Givenan open new comment box or thread popover holding a draft
Whenthe page, or any scrolling container, scrolls
Thenthe editor is placed again from the current position of its text, so it moves with the text, and keeps its draft
WHEN the text scrolls out of view, THEN the editor leaves the window with it and stays open
WHEN the text scrolls back, THEN the editor is back next to it
boundaryThe editor grows

When an error line or the Discard question is added to the new comment box, or a Discard question to the thread popover, the editor is placed again so that it stays inside the window.

Implemented in 3

Tested by 1