Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-038

Selected body text offers a Comment button and a keyboard shortcut

When a reader selects text inside mapped body blocks of a preview, the page SHALL show a Comment button near the selection, and open the comment box for that selection on Cmd+Alt+M (macOS) or Ctrl+Alt+M (elsewhere).

Step 1 of path 1 in StRS-MDOKFSTUDIO-REVIEW-003: from “A reader has selected text in a body block” to “The Comment button is shown”.

Scenarios 6

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

nominalA selection in body blocks shows the button
GivenWhenThen
a preview and a selection inside one paragraphthe selection is madea button labelled "Add a comment on the selected text" and reading "Comment" appears near the selection range
a selection that starts in one paragraph and ends in anotherthe selection is madethe button appears
refusalNo button for a collapsed selection or for text outside body blocks
InputOutcome
a caret without selected textno button is shown
a selection ending inside a code blockno button is shown
a selection starting or ending in mathno button is shown
a selection ending inside the properties tableno button is shown
a selection ending inside an open editorno button is shown
a selection ending inside a comment chipno button is shown
a selection ending inside a thread popoverno button is shown
a selection ending inside included contentno button is shown
a selection in unmapped textno button is shown
a selection inside a Mermaid or PlantUML figureno button is shown
a selection inside an ordinary paragraphthe button is offered
refusalThe button is hidden while busy
GivenWhenThen
a selection being made with the mouse button heldthe selection changesno button is shown until the mouse button is released
a block editor open, or blocks selectedthe selection changesno button is shown
nominalPressing the button keeps the selection
EventOutcome
mousedown on the Comment buttondefault-prevented and the selection is unchanged
mouseup and click events reaching the pagekeep their default behaviour
nominalCopy and Shift+click keep working
Input, with a selection that shows the buttonOutcome
Cmd+C or Ctrl+Cthe key event is not intercepted
Shift+click in the textthe click is not intercepted
nominalThe keyboard shortcut opens the comment box
InputOutcome
Cmd+Alt+M or Ctrl+Alt+M with a selection in a paragraph (by key or by the physical M key)the box opens and the key is consumed
the chord with no selectionno box opens and the key is left alone
the chord with Shift heldno box opens and the key is left alone

Implemented in 1

Tested by 2

Replaces

SwRS-MDOKFSTUDIO-DIAG-020Selecting text inside a diagram offers no comment superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-038 Markdown file