Markdown OKF-Schema Studio

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
InputOutcome
The setting not setThe gray comment chips show
The setting set to true or to any value other than falseThe gray comment chips show
The setting set to falseThe gray and the thread chips and every review mark are hidden
nominalThe setting changes in an open preview
Givenan open preview with a gray chip, a thread chip, a TODO chip, a thread highlight and an open thread popover
Whenthe setting is set to false, and then to true
Thenthe gray and the thread chips and the review marks are hidden at once and the popover closes, the TODO chip stays, without a new render; with true the chips and the marks show again
nominalThe Comments button follows the setting
SettingToolbar
falseNo Comments button is visible
trueThe Comments button is visible
nominalThe host tells the page the value
TriggerOutcome
The settings change (true to false, for example)The page receives showComments false, without a new render
A page has just loadedThe page receives the current value
nominalThe Comments button shows its state
Commentsaria-pressedaria-label, title and tooltip
ShowntrueHide comments
HiddenfalseShow comments
nominalThe Comments button hides the gray and the thread chips
Givengray chips shown, a TODO chip and an inline thread chip on the page, in preview or in edit mode
Whenthe reader presses the Comments button
Thenthe gray chips and the thread chip are hidden at once, the preference false is posted to the host and the state is saved in the webview (the preference is stored for the workspace and decides the start state, see SwRS-MDOKFSTUDIO-LIFE-169 and SwRS-MDOKFSTUDIO-LIFE-170), while the TODO chip stays visible
nominalHiding comments hides every review mark
Review markComments hidden (button off or setting false)Comments shown again
Highlight of an open threadno highlight colour, no rounded paint, no pointer cursor; the quoted text stays as plain textthe highlight colour is back
Highlight of a resolved threadno dotted underline; the quoted text stays as plain textthe dotted underline is back
Thread badgenot displayeddisplayed
Orphaned comments boxnot displayeddisplayed
nominalA former highlight behaves as plain text
Input while comments are hiddenOutcome
Click on a former highlight in preview modeno popover; the source line of its block is revealed, as for a click on plain text
Click on a former highlight in edit modeno popover; the block editor of its block opens
Click, Enter or Space on a former highlight, badge or orphaned comments entryno popover; the event reaches the other handlers of the page
Tab through the pagethe former highlights are skipped (no tabindex, no button role)
Comments shown againthe highlights are back in the Tab order and open their popover again
boundaryPopovers and new threads while comments are hidden
GivenWhenThen
a thread popover openthe reader presses the Comments button, or the setting turns falsethe popover closes
comments hiddenthe 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 popovercomments are shown againno popover opens by itself
comments hiddenthe layout moves because a badge after a block is no longer displayedthe reading line is kept by the same layout callback as the chips
nominalCurrent show-comments message
Givena previewShowComments message that names the page's render
Whenit reaches the page
Thenthe data-okf-show-comments attribute follows its value
refusalStale show-comments message
Givena previewShowComments message that names another document, revision or request
Whenit reaches the page
Thenthe attribute is unchanged

Implemented in 7

Tested by 10

Replaces

SwRS-MDOKFSTUDIO-REVIEW-156A show-comments message of another render is ignored superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-152 Markdown file