Behaviour SwRS-MDOKFSTUDIO-BLOCK-253
Start writing is the keyboard selection of an empty document
While edit mode is on and the body of the document is empty, the page SHALL make the Start writing button the keyboard selection, open the new-block editor on Enter or Arrow Down exactly as a click on it does, and show the hint "Enter to create a new block" under it.
Another outcome at step 1 of path 2 in StRS-MDOKFSTUDIO-BLOCK-011, in the state “Edit mode is on and the body of the document is empty”.
Scenarios 3
The situations the tests check; open one to read it.
nominalThe Start writing button is the keyboard selection and Enter opens the editor
Givena successfully rendered document with an empty body (or only frontmatter) in edit mode, and no editor open
Whenthe preview is built
the writer presses Enter, with no modifier, while the focus is on the page (the document body, the preview content, the edit-mode toggle or the Start writing button itself)
the writer presses Enter, with no modifier, while the focus is on the page (the document body, the preview content, the edit-mode toggle or the Start writing button itself)
Thenthe Start writing button carries `data-sphinx-preview-start-selected="true"` and the selection ring of a selected block, and a hint line "Enter to create a new block" sits under it in the typography of the block editor's hint line (0.75em, description foreground)
the new-block editor opens as after a click on the button: `previewEditOpen` carries line 1, endLine 1 and insertAfterLine 0, and the key is consumed
the new-block editor opens as after a click on the button: `previewEditOpen` carries line 1, endLine 1 and insertAfterLine 0, and the key is consumed
nominalArrow Down opens the editor, Arrow Up keeps the selection
Giventhe same document and the same focus targets
Whenthe writer presses Arrow Down
the writer presses Arrow Up
the writer presses Arrow Up
Thenthe new-block editor opens exactly as for Enter
nothing opens and the Start writing button stays the selection
nothing opens and the Start writing button stays the selection
refusalThe keys do nothing elsewhere
| Input | Outcome |
|---|---|
| Shift, Alt, Ctrl or Cmd held, or an IME composition | Nothing opens |
| The key goes to a text field, a select, a link, or a toolbar button other than the edit-mode toggle | Nothing opens |
| Reading mode, or a failed render | Nothing opens, and the button and its hint are not shown |
| A document with body blocks | Nothing opens: the "+" bars carry no hint and no selection marker |
| A block editor or a field editor is open | Nothing opens (SwRS-MDOKFSTUDIO-BLOCK-041) |