Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-LIFE-151

A side preview locks its editor group

When a new side preview opens in an editor group that holds only that panel, the extension SHALL lock the group and, when that locked preview is closed, unlock the group it left empty, one tick later, only if no live preview occupies it.

Step 2 of path 1 in StRS-MDOKFSTUDIO-LIFE-001: from “A side preview is open beside the editor” to “The side preview is open and the editor group is locked”.

Scenarios 7

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

nominalQuick Open from the preview
Givena locked preview group with the preview focused
Whenthe reader opens another file with Quick Open
Thenthe file opens in the source group, no third group is created and the preview stays the active tab
nominalPreview closed
Givena locked preview group that holds only the preview
Whenthe reader closes the preview
Thenthe empty group is unlocked and closes, and Quick Open from the reader's group opens a file there
boundaryPreview reopened at once
Givena locked preview that closed, and whose group closed
Whena new side preview opens at the same column before the unlock of the closed one runs
Thenthe new group is not unlocked, and the focus stays in the new preview
boundaryShared group
Givena preview that opened in a group that holds another tab
Whenthe preview opens
Thenthe group is not locked and the preview works
boundaryUser lock
Givena group the reader locked that holds other tabs
Whena preview is closed in another group
Thenthat group stays locked
boundaryUnlocking never creates a group
Group count and positionOutcome
A window with three groups, position twoThe command focusSecondEditorGroup is returned
A window with two groups, position threeNo command is returned, because VS Code would create a group
A column below 1, past the group count or past 8, or one not knownNo command is returned
boundaryThe recorded column follows the group
CaseOutcome
A locked preview in column 3 and the group in column 1 closedVS Code reports the layout change, the recorded column becomes 2 and the right group is unlocked later
A preview whose group was not locked, and the layout changesNo column is recorded

Implemented in 3

Tested by 3