Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-054
Back and Next follow the host's history state
When the page starts, the page receives a history state for its render or the reader presses Back or Next, the extension SHALL keep both buttons disabled until the host reports a place to go to, enable each only when its flag in a state for the page's own render is true (a state of another render is ignored), and post one history move per press, which the host accepts only when its direction is back or forward and it names the current render, and answers by moving, by posting the state again when there is nowhere to go, or by a warning when the document cannot be opened.
Step 3 of path 1 in StRS-MDOKFSTUDIO-TOOLBAR-009: from “The place is recorded” to “The reader has pressed Back”.
Scenarios 8
The situations the tests check; open one to read it.
boundaryStart disabled
nominalState enables
boundaryOnly true enables
nominalPress posts a move
| Input | Outcome |
|---|---|
| An enabled Back button is pressed | One previewHistoryGo with direction back is posted, with the page's document, revision and request identifiers |
| An enabled Next button is pressed | One previewHistoryGo with direction forward is posted, with the same identifiers |
refusalNowhere to go
refusalDocument cannot be opened
| Input | Outcome |
|---|---|
| Back to a place whose file was deleted | The warning "Markdown OKF-Schema Studio could not go back: {reason}" is shown with the reason of the error |
| Next to a place whose file cannot be opened | The warning "Markdown OKF-Schema Studio could not go forward: {reason}" is shown |
| Either move that fails | The history position and the list stay as they were, and the state posted afterwards enables Back and Next as before the press |
refusalA history state of another render is ignored
| Input | Outcome |
|---|---|
| a state with an older or different revision (for example 99 for a page at 7) | the buttons keep their state |
| a state for another document | ignored in the same way |
| a state for another request | ignored in the same way |
| a state with the page's identifiers (the current render) | the buttons follow it (nominal row) |
refusalThe host accepts only back or forward
| Input | Outcome |
|---|---|
| a previewHistoryGo with direction back or forward | accepted |
| the direction up, an empty string or a missing direction | refused |
| a previewHistoryGo that names a render other than the shown one | refused by the render gate (see SwRS-MDOKFSTUDIO-TRUST-065) |
Implemented in 4
Tested by 7
- test/core/preview/previewStyles.test.tsunit
- test/core/protocol/pageToHost.test.tsunit
- test/integration/previewHistory.test.tsintegration
- test/page/runtimePageControls.test.tsunit
- test/page/toolbarReq.runtime.requirements.test.tsunit
- test/session/toolbarReq.requirements.test.tsunit
- test/visual/scenarioDefinitions2.tsvisual