Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol diffdown.com

Fix comment highlight: use box-shadow animation instead of color-mix background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

+4 -9
+3 -3
static/css/editor.css
··· 280 280 } 281 281 282 282 @keyframes para-highlight { 283 - 0% { background: color-mix(in srgb, var(--primary) 20%, transparent); } 284 - 100% { background: transparent; } 283 + 0% { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.7), 0 0 0 4px rgba(37, 99, 235, 0.15); } 284 + 100% { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0), 0 0 0 4px rgba(37, 99, 235, 0); } 285 285 } 286 286 287 287 .para-highlight { 288 - animation: para-highlight 1.2s ease-out forwards; 288 + animation: para-highlight 1.4s ease-out forwards; 289 289 border-radius: 3px; 290 290 } 291 291
+1 -6
templates/document_edit.html
··· 823 823 container.addEventListener('click', e => { 824 824 const thread = e.target.closest('.comment-thread'); 825 825 if (!thread) return; 826 - const pid = thread.dataset.paragraph || ''; 827 - console.debug('[comment-click] pid:', pid, 'thread:', thread); 828 - jumpToParagraph(pid); 826 + jumpToParagraph(thread.dataset.paragraph || ''); 829 827 }); 830 828 })(); 831 829 ··· 882 880 } 883 881 884 882 function jumpToParagraph(pid) { 885 - console.debug('[jumpToParagraph] pid:', pid, 'milkdownEditor:', !!milkdownEditor); 886 883 if (pid === 'general') return; 887 884 const idx = parseInt(pid.replace('p-', ''), 10); 888 885 if (isNaN(idx)) return; 889 886 if (!milkdownEditor) return; 890 887 const pmView = milkdownEditor.action(ctx => ctx.get(editorViewCtx)); 891 - console.debug('[jumpToParagraph] pmView:', !!pmView, 'dom:', pmView && pmView.dom); 892 888 if (!pmView) return; 893 889 const pmEl = pmView.dom; 894 890 const blocks = Array.from(pmEl.children); 895 - console.debug('[jumpToParagraph] idx:', idx, 'blocks.length:', blocks.length, 'target:', blocks[idx]); 896 891 const target = blocks[idx]; 897 892 if (!target) return; 898 893 target.scrollIntoView({ behavior: 'smooth', block: 'center' });