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
| Input | Outcome |
|---|---|
| The same document in reading mode | No insert point exists |
| Edit mode toggled off and on | The old bars are gone and new ones exist, one per current block |
| A patch in edit mode whose block and neighbouring blocks are unchanged | The 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 mode | The bars are built for the new content |
boundaryThe properties table
| Input | Outcome |
|---|---|
| A document with frontmatter and edit mode on | A bar after the properties table has data-sphinx-insert-after-line 0 and no move buttons, only the plus button |
| A document without frontmatter | No bar for line 0 exists |
nominalThe plus button appears on hover and on keyboard focus
| Input | Outcome |
|---|---|
| Edit mode on and the pointer over a block or over the plus button | The 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 bar | The 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
| Input | Outcome |
|---|---|
| An insertion editor receiving its empty source from the host | The text box is empty and shows the placeholder `Type Markdown, for example "## Heading" or "- item"` |
| A block editor on existing text | The text box has no placeholder |
boundaryThe insert point follows the whole rendered block
| Input | Outcome |
|---|---|
| A document that ends with a figure, edit mode on | The 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 on | The 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 element | The bar is the next sibling of the pre element |