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
nominalGood render
| Input | Outcome |
|---|---|
| a successful first render | the 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 state | the status region says Preview recovered and the page shows the new content |
| a render after a successful one | the label is Preview ready |
refusalFailed render
| Input | Outcome |
|---|---|
| a render that fails over a shown page, including a failing render of the document that is shown | the last good page stays with Preview is stale |
| a render that fails with nothing shown | Preview 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 throws | the page shows Preview unavailable with the error message, and nothing from A |
| a missing source | Preview source missing |
| waiting for a render | Preview pending |
boundaryPending render
| Input | Outcome |
|---|---|
| a ready page and a render queued by typing, the queue enters the debouncing and building phases | the 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 yet | the 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 seconds | a 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 seconds | the notice never appears |
| the 1.5 second delay elapses while the page document is loading | the notice is posted when the page reports ready |
| the render finished before the page reported ready | no notice is posted |
| a new page document is assigned over a visible notice and a render that needs a full page load | the notice flags are cleared and the new page shows no notice |
| an assignment of the identical page string | nothing is cleared, because the host ignores an identical assignment |
boundaryPosition of the pending notice
| Input | Outcome |
|---|---|
| the notice shown with the toolbar expanded | the 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 row | the notice sits 62 px from the top |
nominalShow and hide
a valid message with visible false removes the notice
refusalOversized or malformed field
| previewPendingOverlay field | Outcome |
|---|---|
| A message of 501 characters | No notice appears and an existing one is unchanged |
| A label of 501 characters | The page ignores the message |
| A visible field that is not a boolean | The page ignores the message |
| A label or message that is not a string | The page ignores the message |
boundaryLongest accepted text
| previewPendingOverlay field | Outcome |
|---|---|
| A message of 500 characters | The notice is accepted |
Implemented in 4
Tested by 8
- test/core/preview/previewStyles.test.tsunit
- test/host/lifeReq.requirements.test.tsunit
- test/host/previewTiming.test.tsunit
- test/integration/dirtySnapshots.test.tsintegration
- test/integration/lifecycle.test.tsintegration
- test/integration/stockCoexistence.test.tsintegration
- test/node-services/build/buildQueue.test.tsunit
- test/page/lifeReq.requirements.test.tsunit