Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-214

The Diff button and the showIncomingChanges setting hide the change bars

When the page applies the Diff state, the page SHALL set the Diff button to pressed with the label Hide changes since last commit while the marks are shown, and to not pressed with the label Show changes since last commit while they are hidden, hide or show the change bars at once and post the incomingChanges view preference when the reader presses it, and show no change marks and no Diff button when markdownOkfSchemaStudio.preview.showIncomingChanges is false.

Step 3 of path 1 in StRS-MDOKFSTUDIO-REVIEW-017: from “Changed blocks carry a green bar” to “The change bars are hidden”.

Scenarios 5

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

nominalThe label follows the state
InputOutcome
Marks shown, the page startsthe button has aria-pressed true and its aria-label, title and tooltip read Hide changes since last commit
Marks hidden, the page startsthe button has aria-pressed false and reads Show changes since last commit
nominalPressing the button
Givenbars shown, then bars hidden
Whenthe reader presses the Diff button, then presses it again
Thenthe first press hides the bar layer, posts the preference false and the host stops sending ranges; the second press shows the bars again and posts the preference true
nominalThe host refreshes the marks at once
Givena preview with marks shown
Whenthe reader presses the Diff button
Thenthe host stores incomingChanges false and schedules the incoming-change update with no delay
refusalAnother preference schedules nothing
Givena change of the toc preference
Whenthe host handles it
Thenno incoming-change update is scheduled
boundaryThe setting
InputOutcome
markdownOkfSchemaStudio.preview.showIncomingChanges falsethe host posts enabled false with no ranges and the Diff button is hidden
The setting at its default true and a tracked file that differs from HEADthe blocks are marked and the Diff button is visible

Implemented in 3

Tested by 2