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
| Given | When | Then |
|---|---|---|
| a preview and a selection inside one paragraph | the selection is made | a 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 another | the selection is made | the button appears |
refusalNo button for a collapsed selection or for text outside body blocks
| Input | Outcome |
|---|---|
| a caret without selected text | no button is shown |
| a selection ending inside a code block | no button is shown |
| a selection starting or ending in math | no button is shown |
| a selection ending inside the properties table | no button is shown |
| a selection ending inside an open editor | no button is shown |
| a selection ending inside a comment chip | no button is shown |
| a selection ending inside a thread popover | no button is shown |
| a selection ending inside included content | no button is shown |
| a selection in unmapped text | no button is shown |
| a selection inside a Mermaid or PlantUML figure | no button is shown |
| a selection inside an ordinary paragraph | the button is offered |
refusalThe button is hidden while busy
| Given | When | Then |
|---|---|---|
| a selection being made with the mouse button held | the selection changes | no button is shown until the mouse button is released |
| a block editor open, or blocks selected | the selection changes | no button is shown |
nominalPressing the button keeps the selection
| Event | Outcome |
|---|---|
| mousedown on the Comment button | default-prevented and the selection is unchanged |
| mouseup and click events reaching the page | keep their default behaviour |
nominalCopy and Shift+click keep working
| Input, with a selection that shows the button | Outcome |
|---|---|
| Cmd+C or Ctrl+C | the key event is not intercepted |
| Shift+click in the text | the click is not intercepted |
nominalThe keyboard shortcut opens the comment box
| Input | Outcome |
|---|---|
| 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 selection | no box opens and the key is left alone |
| the chord with Shift held | no 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