Behaviour SwRS-MDOKFSTUDIO-REVIEW-152
The showComments setting and the Comments button hide and show every review mark, and a message of another render changes nothing
When the setting markdownOkfSchemaStudio.preview.showComments is read, the extension SHALL treat the value false as off and every other value, including no value, as on, and while the setting is off or the Comments button is off it SHALL hide the gray and the thread chips and every review mark of the preview (highlight colour and underline, badges, the Orphaned comments box), keeping the quoted text as plain text that opens no thread popover and is not in the Tab order; a previewShowComments message that names another document, revision or request than the page's does not change the show-comments state.
Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-REVIEW-012, in the state “A chip stands in the text”.
Scenarios 11
The situations the tests check; open one to read it.
boundarySetting value at start
| Input | Outcome |
|---|---|
| The setting not set | The gray comment chips show |
| The setting set to true or to any value other than false | The gray comment chips show |
| The setting set to false | The gray and the thread chips and every review mark are hidden |
nominalThe setting changes in an open preview
nominalThe Comments button follows the setting
| Setting | Toolbar |
|---|---|
| false | No Comments button is visible |
| true | The Comments button is visible |
nominalThe host tells the page the value
| Trigger | Outcome |
|---|---|
| The settings change (true to false, for example) | The page receives showComments false, without a new render |
| A page has just loaded | The page receives the current value |
nominalThe Comments button shows its state
| Comments | aria-pressed | aria-label, title and tooltip |
|---|---|---|
| Shown | true | Hide comments |
| Hidden | false | Show comments |
nominalThe Comments button hides the gray and the thread chips
nominalHiding comments hides every review mark
| Review mark | Comments hidden (button off or setting false) | Comments shown again |
|---|---|---|
| Highlight of an open thread | no highlight colour, no rounded paint, no pointer cursor; the quoted text stays as plain text | the highlight colour is back |
| Highlight of a resolved thread | no dotted underline; the quoted text stays as plain text | the dotted underline is back |
| Thread badge | not displayed | displayed |
| Orphaned comments box | not displayed | displayed |
nominalA former highlight behaves as plain text
| Input while comments are hidden | Outcome |
|---|---|
| Click on a former highlight in preview mode | no popover; the source line of its block is revealed, as for a click on plain text |
| Click on a former highlight in edit mode | no popover; the block editor of its block opens |
| Click, Enter or Space on a former highlight, badge or orphaned comments entry | no popover; the event reaches the other handlers of the page |
| Tab through the page | the former highlights are skipped (no tabindex, no button role) |
| Comments shown again | the highlights are back in the Tab order and open their popover again |
boundaryPopovers and new threads while comments are hidden
| Given | When | Then |
|---|---|---|
| a thread popover open | the reader presses the Comments button, or the setting turns false | the popover closes |
| comments hidden | the threads are posted again (a render, a new thread made with the text-selection Comment button) | the new marks are hidden too and no popover reopens |
| comments hidden after a closed popover | comments are shown again | no popover opens by itself |
| comments hidden | the layout moves because a badge after a block is no longer displayed | the reading line is kept by the same layout callback as the chips |
nominalCurrent show-comments message
refusalStale show-comments message
Implemented in 7
Tested by 10
- test/core/preview/previewStyles.test.tsunit
- test/integration/realInput/blockKeys.tsintegration
- test/page/modules/chipToggle.test.tsunit
- test/page/modules/commentThreads.test.tsunit
- test/page/modules/commentsToggle.test.tsunit
- test/page/runtimeCommentsHidden.test.tsunit
- test/page/runtimePageControls.test.tsunit
- test/session/reviewReqIncoming.requirements.test.tsunit
- test/visual/reviewMarksHiddenScenarios.tsvisual
- test/visual/scenarioDefinitions2.tsvisual