Behaviour SwRS-MDOKFSTUDIO-BLOCK-033
The status line shows the lines and keys, with Done and Cancel beside it
When a writer opens a block editor, the page SHALL insert the editor frame in place of the block at once, expose it as a region named "Raw Markdown editor" around a text box named "Raw Markdown block" that switches off spell check and auto-correction, grows with its text and is drawn in monospace inside a one pixel border in the focus colour, hide the rendered block it replaces, and, when the host sends the block's source, fill the frame with the text box, a status line that shows the line range and the keys of the editor, and a primary Done button beside a Cancel button.
Step 2 of path 1 in StRS-MDOKFSTUDIO-BLOCK-003: from “The framed editor is open in place of the block” to “The writer edits the raw Markdown of the block with Done and Cancel at hand”.
Scenarios 12
The situations the tests check; open one to read it.
nominalFrame at once, filled when the source arrives
the source message of the open editor
it is received
the frame holds the text box, the status line and the buttons
nominalLine range in the status line
| Input | Outcome |
|---|---|
| Editor on lines 5 to 7, source arrived | The status line starts with "Lines 5–7" |
| Editor on a one-line block at line 5 | The status line starts with "Line 5" |
| Editor opened from an insert point | The status line starts with "New block" |
The text before the first separator dot is exactly one of the three forms.
nominalKeys of the editor in the status line
| Platform | The status line ends with |
|---|---|
| macOS | "Esc: cancel · ⌘↩: done" |
| Windows or Linux | "Esc: cancel · Ctrl+Enter: done" |
The keys before the done key read "Enter: new line · Tab: indent · Esc: cancel". In an editor opened on a one-line card part (a card title, `:header:` or `:footer:` line, SwRS-MDOKFSTUDIO-BLOCK-258), where Enter is done, they read "Enter: done · Esc: cancel": the whole hint is "Line 18 · Enter: done · Esc: cancel · ⌘↩: done" on macOS and ends with "Ctrl+Enter: done" on Windows or Linux.
nominalDone and Cancel buttons
the same frame
the buttons are listed
no button named Save Markdown block or Cancel Markdown edit exists
boundaryPressing Done or Cancel keeps the focus in the text box
| Input | Outcome |
|---|---|
| Mouse button pressed on Done, with typed text in the editor | The mousedown default is prevented, the text box keeps the focus and no blur save is posted before the click |
| Mouse button pressed on Cancel, same editor | The same applies |
boundaryA click inside the frame stays inside it
| Input | Outcome |
|---|---|
| Click in the text box, the status line or between the buttons | The document click listeners do not run, so no other editor opens and the block selection is not touched |
| Click on another block while the editor is open | The document listeners run as usual |
nominalBlock editor names
boundaryCell that cannot be parsed
nominalText box attributes
| Text box of | Attributes set |
|---|---|
| a block editor receiving its source | spellcheck is false and autocorrect, autocapitalize and autocomplete are off |
| an insertion editor | the same four attributes |
nominalThe rendered block is hidden while its editor is open
| Editor | Rendered block |
|---|---|
| a paragraph in edit mode, its editor opens | the paragraph carries data-sphinx-preview-editing true and is not displayed, with the frame right after it |
| the open editor closes | the attribute is removed and the paragraph is displayed again; a diagram block follows the same rule, see SwRS-MDOKFSTUDIO-DIAG-001 |
nominalThe frame is a one pixel accent frame with monospace text
| Pane | Measured frame |
|---|---|
| a paragraph editor open in the dark theme at 900 px | the border is 1 px, the font is monospace one pixel smaller than the editor font size and the tab size is 4 |
| the same editor at 460 px | the same border, font and tab size apply and the frame stays inside the column |