plantuml icon indicating copy to clipboard operation
plantuml copied to clipboard

Teoz: Shape of note changes only when "over" is used

Open danny-mhlv opened this issue 2 years ago • 3 comments

Describe the bug When using !pragma teoz true - shape of the note changes only when "over" position is used.

To Reproduce Steps to reproduce the behavior:

  1. Create basic sequence diagram (I've used PlantUML Web Server)
  2. Add !pragma teoz true
  3. Add hnote for example (same thing for rnote)
  4. Position it on the left
  5. See that note does not change it's shape
  6. Now position the note over a participant for example
  7. Now the shape's changed

Code for image 1, when shape stays default.

@startuml
!pragma teoz true
Bob -> Alice : hello
hnote left: text
@enduml

Code for image 2, when shape is changed.

@startuml
!pragma teoz true
Bob -> Alice : hello
hnote over Bob: text
@enduml

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Image 1. Screenshot from 2023-06-11 02-33-23 Image 2. Screenshot from 2023-06-11 02-39-27

Desktop:

  • OS: Ubuntu 22.04.2 LTS
  • Browser Firefox v113.0.2

danny-mhlv avatar Jun 10 '23 23:06 danny-mhlv

Propose to change title of issue to the wording you used in the description, e g:

shape of the note changes only when "over" position is used.

So perhaps:

  • Teoz: Shape of note changes only when "over" used

chipbite avatar Feb 28 '24 14:02 chipbite

[Just for the record] We can also add some label (here m:teoz). Ref.: QA-17257

The-Lum avatar Feb 28 '24 20:02 The-Lum

It looks like the problem isn't with the "over", but with the the cases where "left" or "right" on hnote or rnote does not specify a particular participant. Here is a script that tries all the combinations (i.e. left, right, over Bob; left,right,over Alice, left, right without specific participant).

@startuml
!pragma teoz true

Bob -> Alice : hello
rnote right: rnote\n just right
rnote left: rnote\n just left

Bob <- Alice: hello
hnote right: hnote\n just right
hnote left: hnote\n just left

hnote over Alice: hnote\n over \n Alice
hnote left Alice: hnote\n left \n Alice
hnote right Alice: hnote\n right \n Alice
rnote over Alice: rnote\n over \n Alice
rnote left Alice: rnote\n left \n Alice
rnote right Alice: rnote\n right \n Alice

hnote over Bob: hnote\n over \n Bob
hnote left Bob: hnote\n left \n Bob
hnote right Bob: hnote\n right \n Bob
rnote over Bob: rnote\n over \n Bob
rnote left Bob: rnote\n left \n Bob
rnote right Bob: rnote\n right \n Bob
@enduml

Notice in the following generated diagram that it's the first four instances, where no participant is specified, where rnote and hnote revert back to the normal note shape.

testteoz

If Teoz is not activated, Puma has the correct shapes on all positions:

testteoz

I haven't yet looked into the code. I was just looking at the example to understand the issue.

Regards, Jim Nelson

jimnelson372 avatar May 24 '24 15:05 jimnelson372

Okay, it turns out to be "message" notes that were only showing the normal note style. The ones that were left, over and right of a named participant would correctly show the Hexagon (hnote) and Box (rnote) styles. I have a test that now shows it working. I added one more message after the first two that just uses the traditional note style to demonstrate that still works:

testteoz_rnote_hnote

My test script is now:

@startuml
!pragma teoz true

Bob -> Alice : hello
rnote right: rnote\n just right
rnote left: rnote\n just left

Bob <- Alice: hello
hnote right: hnote\n just right
hnote left: hnote\n just left

hnote over Alice: hnote\n over \n Alice
hnote left Alice: hnote\n left \n Alice
hnote right Alice: hnote\n right \n Alice
rnote over Alice: rnote\n over \n Alice
rnote left Alice: rnote\n left \n Alice
rnote right Alice: rnote\n right \n Alice

hnote over Bob: hnote\n over \n Bob
hnote left Bob: hnote\n left \n Bob
hnote right Bob: hnote\n right \n Bob
rnote over Bob: rnote\n over \n Bob
rnote left Bob: rnote\n left \n Bob
rnote right Bob: rnote\n right \n Bob

Bob -> Alice : hello
note right: note\n just right
note left: note\n just left
@enduml

Let me know how you if this looks good to you. :)

Regards,

Jim Nelson

jimnelson372 avatar May 26 '24 17:05 jimnelson372

Hi @jimnelson372,

That seems good. 👍

But:

  • Could you just add this test?
note across: note\nacross
hnote across: hnote\nacross
rnote across: rnote\nacross

to now cover all the cases:

@startuml
!pragma teoz true

Bob -> Alice : hello
rnote right: rnote\n just right
rnote left: rnote\n just left

Bob <- Alice: hello
hnote right: hnote\n just right
hnote left: hnote\n just left

hnote over Alice: hnote\n over \n Alice
hnote left Alice: hnote\n left \n Alice
hnote right Alice: hnote\n right \n Alice
rnote over Alice: rnote\n over \n Alice
rnote left Alice: rnote\n left \n Alice
rnote right Alice: rnote\n right \n Alice

hnote over Bob: hnote\n over \n Bob
hnote left Bob: hnote\n left \n Bob
hnote right Bob: hnote\n right \n Bob
rnote over Bob: rnote\n over \n Bob
rnote left Bob: rnote\n left \n Bob
rnote right Bob: rnote\n right \n Bob

Bob -> Alice : hello
note right: note\n just right
note left: note\n just left

note across: note\nacross
hnote across: hnote\nacross
rnote across: rnote\nacross
@enduml

Regards, Th.

The-Lum avatar May 26 '24 19:05 The-Lum

Yes, @The-Lum, the across still works. I can see why you wanted to see this, since I had stressed that the problem was where there was not named participants, yet the across doesn't have named participants either.

The real issue is whether the note is considered to be connected to a message, or to one or all of the participants.

rnote across : Some text message

is a note (box style) that is connected to all the participants.

rnote left Bob: Some text message

is a note (box style) related to a particular participant: Bob. While:

rnote left : Some text message

is a note (box style) related to the message it follows. It's on this last kind of note where it is currently only displaying the normal style.

Here is the result of your script, with the fixes:

testteoz_rnote_hnote

Thanks for the request, to double check that I am handling all the cases correctly.

Jim N.

jimnelson372 avatar May 26 '24 22:05 jimnelson372

Hi all,

[This is an Issue Review] 👀 This is now fixed on V1.2024.6.

  • Thanks @danny-mhlv for the report.
  • Thanks @jimnelson372 for your work.

Regards.

The-Lum avatar Aug 09 '24 17:08 The-Lum