From 3fc3a7a15079f94f7762440db441135859a8be52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Sat, 25 Jul 2026 19:06:15 +0200 Subject: [PATCH] author fix --- static/js/note-editor.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/static/js/note-editor.js b/static/js/note-editor.js index 4df9df8..9bd44c8 100644 --- a/static/js/note-editor.js +++ b/static/js/note-editor.js @@ -63,12 +63,26 @@ function renderGutter() { const top = paddingTop - editor.scrollTop; ownerLabels.innerHTML = `${escapeHtml(ownerName(owner))}`; } else { + let previousAuthorSignature = null; ownerLabels.innerHTML = lines.map((_, i) => { const authors = authorsByLine[i] || []; if (!authors.length) return ""; + const top = paddingTop + i * lineHeight - editor.scrollTop; - const badges = authors.map(owner => `${escapeHtml(ownerName(owner))}`).join(""); - return `${badges}`; + const signature = authors + .map(owner => ownerName(owner)) + .sort((a, b) => a.localeCompare(b)) + .join("\u0000"); + const startsOwnershipBlock = signature !== previousAuthorSignature; + previousAuthorSignature = signature; + + const lineMarker = ``; + if (!startsOwnershipBlock) return lineMarker; + + const badges = authors + .map(owner => `${escapeHtml(ownerName(owner))}`) + .join(""); + return `${lineMarker}${badges}`; }).join(""); } if (showAuthorship) renderAuthorshipLayer(authorshipLayer, editor, authorship, colorFor);