Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

dansseg
Copy link

@dansseg dansseg commented Apr 11, 2024

📑 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

📏 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.

📋 Tasks

Make sure you

Copy link

netlify bot commented Apr 11, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 2b9d052
🔍 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.

Copy link

codecov bot commented Apr 11, 2024

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

@@            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 Coverage Δ
unit 5.72% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../mermaid/src/diagrams/sequence/sequenceRenderer.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

Copy link
Member

@sidharthv96 sidharthv96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dansseg, can you please add integration tests to cover all the cases that you are expecting this to fix?
The implementation seems to be working for some cases I tested.

File: cypress/integration/rendering/sequencediagram.spec.js

@dansseg dansseg marked this pull request as draft April 15, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Activation not working in sequence diagrams
2 participants