diff --git a/src/components/annotations/variants/ActiveVariantsDetails.vue b/src/components/annotations/variants/ActiveVariantsDetails.vue index 7b101a38..61ee0f87 100644 --- a/src/components/annotations/variants/ActiveVariantsDetails.vue +++ b/src/components/annotations/variants/ActiveVariantsDetails.vue @@ -12,37 +12,60 @@ .map(id => activeAnnotations[id]) }); + const activeVariantsGroupedByTarget = computed(() => + activeVariants.value.reduce((acc, cur) => { + cur.target + .forEach(target => { + const cssSelector = target.selector.value; + if (!acc[cssSelector]) { + acc[cssSelector] = { + content: target.source, + variants: [cur] + } + } else { + acc[cssSelector].variants.push(cur) + } + }) + return acc + }, {}) + ) + function getWitnessColor(witness: string) { return annotationStore.variantItemsColors[witness]; }