Behaviour SwRS-MDOKFSTUDIO-DIAG-105
JAR results replace the diagrams of the current render in order
When the JAR pipeline finishes the diagrams of the current render, the extension SHALL match each result to its diagram in document order with the diagram's source line and replace the content of its diagram element with an image of alt text "PlantUML diagram" and a data URI of the SVG and state rendered, or with a paragraph of class myst-plantuml-error holding the message and the state error or unavailable.
Step 3 of path 1 in StRS-MDOKFSTUDIO-DIAG-007: from “The JAR has drawn the diagrams of the render” to “Each diagram shows the picture the JAR drew”.
Scenarios 7
The situations the tests check; open one to read it.
nominalResults follow the document order
Giventhree diagrams that finish in another order
Whenthe results are collected
Thenresult i belongs to diagram i and carries its source line
a document with one diagram matches that one result to that diagram with its line
a document with one diagram matches that one result to that diagram with its line
nominalA result replaces the content of its diagram
Givena successful result and a failed result
Whenthey are injected
Thenthe diagram element of the successful result holds the image of alt text "PlantUML diagram" and data-render-state rendered
the diagram element of the failed result holds the paragraph of class myst-plantuml-error with the message and the failure's state (error or unavailable)
the diagram element of the failed result holds the paragraph of class myst-plantuml-error with the message and the failure's state (error or unavailable)
nominalA working installation draws a loaded picture in both themes
Givena working JAR or plantuml command and a PlantUML diagram
Whenthe preview is shown in a light theme and then in a dark theme
Thena loaded picture without an error appears in each and the expandable source disclosure is kept
the pipeline asks for no dark variant
the pipeline asks for no dark variant
boundaryOne failing diagram does not affect the others
| Input | Outcome |
|---|---|
| one failing diagram among three | the other two are pictures and the failing one shows its message |
| three failing diagrams | each shows its own message |
boundaryResults reach the page in place or as a full page
| Input | Outcome |
|---|---|
| incremental updates on, a page ready for the render stage, status lines that fit a patch and a plannable content patch | the page receives a content patch and keeps its state; the page is not reloaded |
| incremental updates on, a ready page, status lines that do not fit a patch | the whole page HTML is set |
| incremental updates off, a page not ready for the stage, or no plannable content patch | the whole page HTML is set |
| the injected page equals the current one and there are no warnings | nothing is done |
refusalResults of an older render stage are dropped
Givena render superseded while its diagrams were drawing
Whenthe old results arrive
Thenthey are not applied
the results of the current render, when they arrive, are applied
the results of the current render, when they arrive, are applied
nominalResults wait for an open block edit
Givenan open block editor and arriving JAR results (see SwRS-MDOKFSTUDIO-BLOCK-041)
Whenthe results are ready
Thenthey are held and the editor stays open
when the edit ends the held results are applied, the latest one winning
when the edit ends the held results are applied, the latest one winning
Implemented in 2
Tested by 6
Known limits (3)
- When the injected page equals the current one and there are no warnings, nothing is done.
- Environment dependent: the visual scenarios of the working installation fail when plantuml is not on the PATH and are not routed through useJar.
- The JAR and PATH pipeline draws the same SVG in the light and dark preview; only the built-in engine asks PlantUML for a dark variant.
Replaces
SwRS-MDOKFSTUDIO-DIAG-106JAR results replace the diagrams in the open preview superseded superseded by SwRS-MDOKFSTUDIO-DIAG-105 Markdown file
SwRS-MDOKFSTUDIO-DIAG-108JAR results reach a ready page in place superseded superseded by SwRS-MDOKFSTUDIO-DIAG-105 Markdown file
SwRS-MDOKFSTUDIO-DIAG-109Results of an older render stage are dropped superseded superseded by SwRS-MDOKFSTUDIO-DIAG-105 Markdown file
SwRS-MDOKFSTUDIO-DIAG-110JAR results wait for an open block edit superseded superseded by SwRS-MDOKFSTUDIO-DIAG-105 Markdown file
SwRS-MDOKFSTUDIO-DIAG-111A working JAR draws a diagram as a loaded picture superseded superseded by SwRS-MDOKFSTUDIO-DIAG-105 Markdown file
SwRS-MDOKFSTUDIO-DIAG-117One failing JAR diagram does not affect the others superseded superseded by SwRS-MDOKFSTUDIO-DIAG-105 Markdown file