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

Improve comment rendering: human-readable paragraph labels, use authorHandle

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

+7 -4
+7 -4
templates/document_edit.html
··· 834 834 byParagraph[pid].push(c); 835 835 } 836 836 837 - container.innerHTML = Object.entries(byParagraph).map(([pid, thread]) => ` 837 + container.innerHTML = Object.entries(byParagraph).map(([pid, thread]) => { 838 + const label = pid === 'general' ? 'General' : 'Paragraph ' + (parseInt(pid.replace('p-', ''), 10) + 1); 839 + return ` 838 840 <div class="comment-thread" data-paragraph="${escHtml(pid)}"> 839 - <div class="comment-thread-label">¶ ${escHtml(pid)}</div> 841 + <div class="comment-thread-label">¶ ${escHtml(label)}</div> 840 842 ${thread.map(c => ` 841 843 <div class="comment-item"> 842 - <div class="comment-author">${escHtml(c.authorName || c.author)}</div> 844 + <div class="comment-author">${escHtml(c.authorHandle || c.author)}</div> 843 845 <div class="comment-text">${escHtml(c.text)}</div> 844 846 <div class="comment-time">${formatTime(c.createdAt)}</div> 845 847 </div> 846 848 `).join('')} 847 849 </div> 848 - `).join(''); 850 + `; 851 + }).join(''); 849 852 } 850 853 851 854 function formatTime(ts) {