diff --git a/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue b/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue index 9315ae31..0c3c3da8 100644 --- a/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue +++ b/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue @@ -32,6 +32,7 @@ :labelText="labelText" :labelPositions="labelPositions" :assignee="entity.assignee" + :assigneePositions="assigneePositions" /> @@ -63,9 +64,22 @@ export default { return { translate: 0, participant }; } - const labelPositions = computed(() => - store.getters.participants.Positions().get(props.entity.name), - ); + const labelPositions = computed(() => { + const positions = store.getters.participants.GetPositions( + props.entity.name, + ); + // Sort the label positions in descending order to avoid index shifting when updating code + const positionArray = Array.from(positions ?? []); + return positionArray.sort((a, b) => b[0] - a[0]); + }); + const assigneePositions = computed(() => { + // Sort the label positions in descending order to avoid index shifting when updating code + const assigneePositions = store.getters.participants.GetAssigneePositions( + props.entity.name, + ); + const positionArray = Array.from(assigneePositions ?? []); + return positionArray.sort((a, b) => b[0] - a[0]); + }); const intersectionTop = useIntersectionTop(); const [scrollTop] = useDocumentScroll(); const translate = computed(() => { @@ -86,7 +100,7 @@ export default { participantOffsetTop ); }); - return { translate, participant, labelPositions }; + return { translate, participant, labelPositions, assigneePositions }; }, props: { entity: { diff --git a/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/ParticipantLabel.vue b/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/ParticipantLabel.vue index 779b8f7c..fdb0da99 100644 --- a/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/ParticipantLabel.vue +++ b/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/ParticipantLabel.vue @@ -1,19 +1,38 @@