From bfc53d59b75cad037c1b37aeeaf0ad9febeb0e72 Mon Sep 17 00:00:00 2001 From: Phil Bastian Date: Fri, 11 Apr 2025 09:49:01 +0800 Subject: [PATCH 1/7] selection of messages and navigation to selection --- .../SequenceDiagram/HandlersComponent.vue | 40 ++++++++++++++-- .../SequenceDiagram/RoutesComponent.vue | 46 ++++++++++++++++--- .../src/stores/SequenceDiagramStore.ts | 21 +++++++-- 3 files changed, 93 insertions(+), 14 deletions(-) diff --git a/src/Frontend/src/components/messages2/SequenceDiagram/HandlersComponent.vue b/src/Frontend/src/components/messages2/SequenceDiagram/HandlersComponent.vue index b7a23eb27..630f799e6 100644 --- a/src/Frontend/src/components/messages2/SequenceDiagram/HandlersComponent.vue +++ b/src/Frontend/src/components/messages2/SequenceDiagram/HandlersComponent.vue @@ -10,7 +10,7 @@ const Handler_Gap = 20; const Handler_Width = 14; const store = useSequenceDiagramStore(); -const { handlers, endpointCentrePoints, highlightId } = storeToRefs(store); +const { handlers, endpointCentrePoints, highlightId, selectedId } = storeToRefs(store); const messageTypeRefs = ref([]); @@ -27,6 +27,7 @@ const handlerItems = computed(() => { const fill = (() => { if (handler.id === "First") return "black"; if (handler.state === HandlerState.Fail) return "var(--error)"; + if (handler.route?.name === selectedId.value) return "var(--highlight)"; if (handler.route?.name === highlightId.value) return "var(--highlight-background)"; return "var(--gray60)"; })(); @@ -51,6 +52,8 @@ const handlerItems = computed(() => { return { id: handler.id, + messageId: { id: handler.selectedMessage?.message_id, uniqueId: handler.selectedMessage?.id }, + isError: handler.state === HandlerState.Fail, endpointName: handler.endpoint.name, incomingId: handler.route?.name, left, @@ -63,6 +66,7 @@ const handlerItems = computed(() => { messageType: handler.name, messageTypeOffset, messageTypeHighlight: handler.route?.name === highlightId.value, + messageTypeSelected: handler.route?.name === selectedId.value, setUIRef: (el: SVGElement) => (handler.uiRef = el), }; }); @@ -81,18 +85,32 @@ function setMessageTypeRef(el: SVGTextElement, index: number) { diff --git a/src/Frontend/src/components/messages2/SequenceDiagram/EndpointsComponent.vue b/src/Frontend/src/components/messages2/SequenceDiagram/EndpointsComponent.vue index df2890cd7..ded1ec7b2 100644 --- a/src/Frontend/src/components/messages2/SequenceDiagram/EndpointsComponent.vue +++ b/src/Frontend/src/components/messages2/SequenceDiagram/EndpointsComponent.vue @@ -25,6 +25,10 @@ interface EndpointSurround { const Endpoint_Gap = 30; const Endpoint_Image_Width = 20; +defineProps<{ + yOffset: number; +}>(); + const store = useSequenceDiagramStore(); const { startX, endpoints } = storeToRefs(store); @@ -79,7 +83,7 @@ function setEndpointTextRef(el: SVGTextElement, index: number) {