Behaviour SwRS-MDOKFSTUDIO-REVIEW-143
A click or Enter on a chip toggles its comment box
When a reader clicks a comment chip, or presses Enter or Space on a focused one, the page SHALL toggle the box that shows the comment text under the line, with the title and shape of its comment kind, and keep which boxes are open for the panel.
Step 2 of path 1 in StRS-MDOKFSTUDIO-REVIEW-012: from “A chip stands in the text” to “The comment box shows the comment text”.
Part of StRS-MDOKFSTUDIO-REVIEW-003, outside the paths drawn on its map.
Scenarios 8
The situations the tests check; open one to read it.
nominalClick opens and closes the box
Givena gray chip
Whenthe reader clicks it twice
Thenthe box opens with the comment text and then closes, and the chip aria-expanded and the box hidden attribute follow the clicks
nominalEnter and Space toggle the box
Givena focused chip that has a box
Whenthe reader presses Enter and then Space
Thenthe box opens and closes
refusalTargets and keys that change nothing
| Input | Outcome |
|---|---|
| A click on text that is not a chip | No box changes |
| Another key than Enter or Space on a focused chip | Nothing changes |
| A click on a TODO chip that comes from the word TODO in prose (a chip without a box) | No box opens, aria-expanded stays false and the layout is not re-measured |
nominalTitle and accent follow the comment kind
| Open box | Title | Accent bar on the inline start |
|---|---|---|
| A comment | Comment | gray |
| A TODO chip written from a TODO comment | TODO | green |
| A thread | Thread | - |
The boxes are drawn with an admonition-like shape; v04 asserts the contrast of 4.5:1 on the cream page.
nominalOpen boxes are kept for the panel
Giventwo open comments, or two inline comments in one paragraph with one open
Whenthe content is replaced in the same panel (a content patch) or the page is reloaded
Thenthe same boxes are open, and only the open one of the paragraph stays open; the webview state holds the keys of the open boxes in the form {line}:{number}, the source line and the number of the comment on that line
boundaryKeys of comments that no longer exist
| Input | Outcome |
|---|---|
| A saved key 5:0 and a document without a comment at line 5 | The key is removed from the saved state when the state is applied |
| A saved key whose comment exists | The key stays |
nominalOpening or closing a box keeps the reading position
Givena comment above the reading line
Whenthe reader opens its box, and then closes it
Thenthe text being read does not move either time
boundarySquare corners
| Shown element | Corners |
|---|---|
| An open comment box | square (border radius 0) |
| A comment compose box | square (border radius 0) |
| A thread popover | square (border radius 0) |