mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
71.11k stars 6.4k forks source link

fix: SequenceDiagram: draw activations even without explicit deactivation #5457

Open dansseg opened 5 months ago

dansseg commented 5 months ago

:bookmark_tabs: Summary

Activations will now also be drawn, even if there is no deactivation for a participant. The activation will reach down to the bottom or to the point where the participant gets destroyed.

sequenceDiagram
    A ->>+ B : ActivateMe
    B ->> A : NoNeedToDeactivate

Resolves #3849

:straight_ruler: Design Decisions

All activations were already parsed correctly and stored in 'bounds.activations'. If no deactivation was existing, it would remain inside this array. This information is now used to draw the 'missing' activations after all actors and messages were drawn already. If an actor was destroyed, it's last y position is also stored already (bounds.models.actors[].stopy), which will then be used as the end of the activation, instead of the end of the diagram.

:clipboard: Tasks

Make sure you

netlify[bot] commented 5 months ago

Deploy Preview for mermaid-js ready!

Name Link
Latest commit 2b9d0520382716bd650c678e13e181929aa6bf9b
Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/661fa716b942050008cb3d61
Deploy Preview https://deploy-preview-5457--mermaid-js.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 0% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 5.72%. Comparing base (3809732) to head (2b9d052).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5457/graphs/tree.svg?width=650&height=150&src=pr&token=BaET4V1BdM&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js)](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5457?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) ```diff @@ Coverage Diff @@ ## develop #5457 +/- ## ========================================== - Coverage 5.72% 5.72% -0.01% ========================================== Files 278 277 -1 Lines 42013 42019 +6 Branches 490 515 +25 ========================================== Hits 2407 2407 - Misses 39606 39612 +6 ``` | [Flag](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5457/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5457/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) | `5.72% <0.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5457?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) | Coverage Δ | | |---|---|---| | [.../mermaid/src/diagrams/sequence/sequenceRenderer.ts](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5457?src=pr&el=tree&filepath=packages%2Fmermaid%2Fsrc%2Fdiagrams%2Fsequence%2FsequenceRenderer.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js#diff-cGFja2FnZXMvbWVybWFpZC9zcmMvZGlhZ3JhbXMvc2VxdWVuY2Uvc2VxdWVuY2VSZW5kZXJlci50cw==) | `0.00% <0.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5457/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js)