Fix note sync reliability and Unicode filename support

- Fixed critical bug where notes with empty category had malformed IDs (leading slash)
- Added URL encoding for Czech and Unicode characters in WebDAV paths
- Fixed filename sanitization to preserve Unicode characters (only remove filesystem-unsafe chars)
- Updated note preview to show first non-empty line after title instead of repeating title
- Adjusted default column widths for better proportions (increased window width to 1300px)
- Protection mechanism now works correctly with proper note ID matching
This commit is contained in:
drelich
2026-03-31 09:55:44 +02:00
parent 525413a08a
commit 12b50c2304
5 changed files with 144 additions and 28 deletions

View File

@@ -125,9 +125,17 @@ export function NotesList({
};
const getPreview = (content: string) => {
// grab first 100 characters of note's content, remove markdown syntax from the preview
const previewContent = content.substring(0, 100);
const cleanedPreview = previewContent.replace(/[#*`]/g, '');
// Skip first line (title) and find first non-empty line
const lines = content.split('\n');
const contentLines = lines.slice(1); // Skip first line
// Find first non-empty line
const firstContentLine = contentLines.find(line => line.trim().length > 0);
if (!firstContentLine) return '';
// Take up to 100 characters from the content lines
const previewContent = contentLines.join(' ').substring(0, 100);
const cleanedPreview = previewContent.replace(/[#*`]/g, '').trim();
return cleanedPreview;
};
@@ -160,7 +168,7 @@ export function NotesList({
<div
ref={containerRef}
className="bg-gray-50 dark:bg-gray-900 border-r border-gray-200 dark:border-gray-700 flex flex-col relative flex-shrink-0"
style={{ width: `${width}px`, minWidth: '240px', maxWidth: '600px' }}
style={{ width: `${width}px`, minWidth: '340px', maxWidth: '600px' }}
>
<div className="p-4 border-b border-gray-200 dark:border-gray-700">
<div className="flex items-center justify-between mb-3">