Improve search and show save errors

- Show search results in the right notebook or All Notes list
- Scroll to the selected note and highlight matching text
- Keep unsaved edits safe and ignore old or cancelled searches
- Show save errors with a Retry button
- Run graph and vault statistics scans in the background
- Fix folder checks when counting vault files
- Keep desktop window-close code out of mobile builds
This commit is contained in:
Yuri Karamian committed 2026-09-28 21:06:28 +02:00
1 parent 640b5e3d10
commit 923cb9571c
21 files changed
+1224 -117

No files matched your search

+16
View File
@@ -63,3 +63,19 @@ export function noteListWindow(offsets: number[], scrollTop: number, height: num
const end = Math.min(count, rowAt(offsets, Math.max(0, scrollTop + height)) + 1 + overscan);
return { start, end, anchor, top: offsets[start], bottom: offsets[count] - offsets[end] };
}
/** Keep visible rows stationary; request a centered offset for off-screen rows. */
export function noteListRevealScrollTop(
offsets: number[],
rowIndex: number,
scrollTop: number,
height: number,
listOrigin = 0,
): number {
if (rowIndex < 0 || rowIndex + 1 >= offsets.length || height <= 0) return scrollTop;
const top = listOrigin + offsets[rowIndex];
const bottom = listOrigin + offsets[rowIndex + 1];
if (top >= scrollTop && bottom <= scrollTop + height) return scrollTop;
// The scrolling element clamps the upper bound, including its bottom padding.
return Math.max(0, top - Math.max(0, height - (bottom - top)) / 2);
}