feat: persistent recent files history + fix limit enforcement + fix settings data loss

- Recent files are now persisted to disk and survive restarts
- Max items limit is applied on load (in case setting was reduced)
- Omitted paths regex filtering is now wired up in addToRecentFiles
- Fixed saveAndRefresh() overwriting entire plugin data on settings change
- Debounced disk writes (300ms) to avoid excessive saves on rapid opens
This commit is contained in:
2026-06-21 22:36:03 -04:00
parent 993017f669
commit 49c8da9863
7 changed files with 49 additions and 11 deletions
+2 -2
View File
@@ -304,7 +304,7 @@ export class WaypointView extends ItemView {
removeBtn.addEventListener('click', (e) => {
e.stopPropagation();
this.plugin.recentFiles = this.plugin.recentFiles.filter(f => f.path !== file.path);
this.plugin.saveSettings();
this.plugin.persistRecentFiles();
this.redraw();
});
setTooltip(navFile, file.path);
@@ -384,7 +384,7 @@ export class WaypointView extends ItemView {
} else {
new Notice('Cannot find file');
this.plugin.recentFiles = this.plugin.recentFiles.filter(f => f.path !== file.path);
this.plugin.saveSettings();
this.plugin.persistRecentFiles();
this.redraw();
}
}