Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-207

Changed blocks get a thin change bar that moves nothing, and malformed ranges are ignored

When the page receives line ranges, the extension SHALL mark the innermost mapped element whose lines meet a range with data-sphinx-preview-changed and draw, for each marked block, a green bar 3 px wide with square ends, as high as the box of the block, in one column at the left margin of the page, without moving any block or text edge; a range that is not a pair of integers with 1 <= start <= end is ignored, as is a range list that is not a list.

Step 2 of path 1 in StRS-MDOKFSTUDIO-REVIEW-017: from “The page holds the changed line ranges” to “Changed blocks carry a green bar”.

Scenarios 8

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

nominalMarking the innermost blocks
InputOutcome
A range that meets one list itemthe item is marked and the list that contains it is not
New ranges after earlier marksthe old marks are removed and only the new ones remain
An empty list of rangesall marks are removed
A content patch on a page that holds marksthe last received ranges are applied to the new content and the new blocks that meet them are marked
A content patch on a page that never received rangesnothing is marked
boundaryBlocks that are never marked
InputOutcome
A changed range over a block that is being edited, or under an open editorthat block is not marked
A changed range that meets a block rendered from an include directivethe block is not marked, while a distinct wrapper of the directive can be
nominalSize of one bar
InputOutcome
A marked paragraphone bar has the top and the height of the paragraph
A marked code blockthe bar spans the whole box of the code block, not only its text
nominalOne column and no layout shift
Givenmarked blocks at several indentation levels, in the light, dark and cream themes
Whenthe bars are drawn
Thenall bars sit in one layer after the content with one left position at the left margin, no block or text position changes, no ancestor clips a bar, no bar touches an anchor icon, and the bars are visible in each theme
nominalLaid out again
InputOutcome
A window resize with marked blockseach bar follows the new top and height of its block
A content patch that moves a marked blockthe bar moves with the block
A change of content size, or an image loadthe bars are placed again (stabilizeLayout of the scroll core)
nominalValid ranges
Givena previewIncomingChanges message whose ranges are pairs of integers with 1 <= start <= end
Whenit is received
Thenthe blocks that meet them are marked and the enabled value is reported
refusalBad ranges
Givenranges with a zero, a negative number, a fraction or an end before the start
Whenthey are received
Thenno block is marked from them
refusalNot a list
Givena previewIncomingChanges message whose ranges are not a list
Whenit is received
Thenall marks are cleared

Implemented in 1

Tested by 5

Replaces

SwRS-MDOKFSTUDIO-REVIEW-208Malformed incoming-change ranges are ignored superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-207 Markdown file