Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-087

Edit mode places an insert point with a plus button after every body block

While edit mode is on, the page SHALL place an insert point holding a plus button labelled "Insert a block here" after every top-level body block and after the properties table, and a click on the plus opens an empty insertion editor at that place.

Step 1 of path 1 in StRS-MDOKFSTUDIO-BLOCK-011: from “Edit mode is on” to “An empty insertion editor is open”.

Scenarios 8

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

nominalThree blocks
Givena document with three body blocks and edit mode turned on
Whenthe page builds the bars
Thenthree bars exist, one after each block, each with the source line the block ends at
boundaryReading mode and rebuilds
InputOutcome
The same document in reading modeNo insert point exists
Edit mode toggled off and onThe old bars are gone and new ones exist, one per current block
A patch in edit mode whose block and neighbouring blocks are unchangedThe bar of that block is the same element and only its line number moves (SwRS-MDOKFSTUDIO-LIFE-069)
A page that starts or is patched in edit modeThe bars are built for the new content
boundaryThe properties table
InputOutcome
A document with frontmatter and edit mode onA bar after the properties table has data-sphinx-insert-after-line 0 and no move buttons, only the plus button
A document without frontmatterNo bar for line 0 exists
nominalThe plus button appears on hover and on keyboard focus
InputOutcome
Edit mode on and the pointer over a block or over the plus buttonThe plus button is visible (opacity 1)
The plus button has the keyboard focus (focus-visible)The plus button is visible
No pointer and no focus on the barThe plus button is transparent (opacity 0) but still reachable by keyboard
nominalClicking the plus opens an empty insertion editor
Givena bar after a block that ends at line 9
Whenthe writer clicks the plus
ThenpreviewEditOpen carries insertAfterLine 9 and line and endLine 9, the bar is replaced by the frame and the empty text box has the focus with the status New block
refusalOther input on the bar
Givenan insert point
Whena click or key reaches the document handlers of the page
Thenno block editor of a rendered block opens
boundaryThe insertion editor text box shows a placeholder
InputOutcome
An insertion editor receiving its empty source from the hostThe text box is empty and shows the placeholder `Type Markdown, for example "## Heading" or "- item"`
A block editor on existing textThe text box has no placeholder
boundaryThe insert point follows the whole rendered block
InputOutcome
A document that ends with a figure, edit mode onThe bar follows the figure and its insertAfterLine is the line of the closing fence (9 in the scenario fixture)
A document that ends with a plain image, edit mode onThe bar follows the image and its insertAfterLine is the image line (5 in the scenario fixture)
A fenced code block whose mapped element is inside a pre elementThe bar is the next sibling of the pre element

Implemented in 3

Tested by 4