Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-LIFE-049

The status names the render state and shows pending, failed and recovered notices

When the preview shows a render state, the extension SHALL label the status Preview pending, Preview ready, Preview is stale, Preview unavailable, Preview source missing or Preview recovered, show a pending notice for a slow render and leave a page that is already shown unchanged while a render is pending, and ignore a pending notice whose visible field is not a boolean or whose label or message is not a string or is longer than 500 characters.

Step 3 of path 1 in StRS-MDOKFSTUDIO-LIFE-003: from “The preview shows the newly active file” to “The status says the render is ready”.

Part of StRS-MDOKFSTUDIO-LIFE-005, outside the paths drawn on its map.

Step 1 of path 1 in StRS-MDOKFSTUDIO-LIFE-007: from “A new preview waits for its render” to “The status reads Preview ready”.

Scenarios 8

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

nominalPending page of a new side preview
Givena new side preview whose group lock is still being set
Whenthe panel is created for an existing Markdown file
Thenits page holds a status region data-sphinx-preview-status=pending with the label Preview pending and the message Waiting for the first render, until the render starts
nominalGood render
InputOutcome
a successful first renderthe status region says Preview ready
a successful render after a failure, for example a stale page after a simulated render failure and the text edited back to a renderable statethe status region says Preview recovered and the page shows the new content
a render after a successful onethe label is Preview ready
refusalFailed render
InputOutcome
a render that fails over a shown page, including a failing render of the document that is shownthe last good page stays with Preview is stale
a render that fails with nothing shownPreview unavailable
a render that fails for a document the preview has not shown yet, for example a side preview of A switched to B whose render throwsthe page shows Preview unavailable with the error message, and nothing from A
a missing sourcePreview source missing
waiting for a renderPreview pending
boundaryPending render
InputOutcome
a ready page and a render queued by typing, the queue enters the debouncing and building phasesthe page document is not reassigned, nothing moves, and the internal status is pending
a preview that shows no render and the queue enters a pending phase, or the render of the file is requested and no page is shown yetthe pending status page is shown with the pending message instead; it takes the message Waiting for the latest edit. when the queue starts collecting the edit
a queued edit inside the debounce delay (the debouncing phase)the message is Waiting for the latest edit.
the delay elapsed and the render started (the building phase)the message is Rendering the active buffer.
a ready page and a render that stays pending for 1.5 secondsa small notice with the label Preview pending and the latest pending message appears, and is hidden again before the patch of the result, or when the render fails
a render that ends in less than 1.5 secondsthe notice never appears
the 1.5 second delay elapses while the page document is loadingthe notice is posted when the page reports ready
the render finished before the page reported readyno notice is posted
a new page document is assigned over a visible notice and a render that needs a full page loadthe notice flags are cleared and the new page shows no notice
an assignment of the identical page stringnothing is cleared, because the host ignores an identical assignment
boundaryPosition of the pending notice
InputOutcome
the notice shown with the toolbar expandedthe notice is fixed 14 px from the right and 160 px from the top (right under the four rows of the toolbar), with pointer-events none and no effect on the layout
the toolbar collapsed to its first rowthe notice sits 62 px from the top
nominalShow and hide
Givena valid previewPendingOverlay message with visible true, a label and a message of at most 500 characters
Whenthe page applies it
Thenthe notice appears with the label and the message
a valid message with visible false removes the notice
refusalOversized or malformed field
previewPendingOverlay fieldOutcome
A message of 501 charactersNo notice appears and an existing one is unchanged
A label of 501 charactersThe page ignores the message
A visible field that is not a booleanThe page ignores the message
A label or message that is not a stringThe page ignores the message
boundaryLongest accepted text
previewPendingOverlay fieldOutcome
A message of 500 charactersThe notice is accepted

Implemented in 4

Tested by 8

Replaces

SwRS-MDOKFSTUDIO-LIFE-055The page ignores a pending notice with an oversized or malformed field superseded superseded by SwRS-MDOKFSTUDIO-LIFE-049 Markdown file