Add ellipsis to auto-generated titles with >4 words and truncate titles >120 chars

This commit is contained in:
Golwhit
2025-12-29 19:00:42 -06:00
parent a42a502a89
commit 2983457fc0
+9
View File
@@ -613,6 +613,15 @@
const words = noteText.split(/\s+/).filter(w => w.length > 0);
const firstFour = words.slice(0, 4).join(' ');
noteTitle = 'Untitled: ' + (firstFour || 'note');
// Add ellipsis if note has more than 4 words
if (words.length > 4) {
noteTitle += '...';
}
}
// Truncate title if it exceeds 120 characters
if (noteTitle.length > 120) {
noteTitle = noteTitle.substring(0, 120) + '...';
}
try {