diff --git a/src/components/EventOverlay.vue b/src/components/EventOverlay.vue index 903c448..215f01d 100644 --- a/src/components/EventOverlay.vue +++ b/src/components/EventOverlay.vue @@ -61,6 +61,12 @@ const eventSpans = computed(() => { const spanB = b.endIdx - b.startIdx if (spanA !== spanB) return spanB - spanA if (a.startIdx !== b.startIdx) return a.startIdx - b.startIdx + // For one-day events that are otherwise equal, sort by color (0 first) + if (spanA === 0 && spanB === 0 && a.startIdx === b.startIdx) { + const colorA = a.colorId || 0 + const colorB = b.colorId || 0 + if (colorA !== colorB) return colorA - colorB + } return String(a.id).localeCompare(String(b.id)) }) // Assign non-overlapping rows