Improve file operations, layout memory, and drive status.

Add a sequential file-operations queue with pause, reorder, and optional auto-clear; persist window size and tree width; show free space; and clear leftover indexing status.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-24 01:52:30 +02:00
parent d79605cde9
commit 9bf451932f
41 changed files with 2855 additions and 275 deletions

View File

@@ -10,17 +10,20 @@ public sealed class FolderReconciler
private readonly IFileSystemEnumerator _enumerator;
private readonly StorageProviderRegistry _providers;
private readonly ArchiveContentsIndexer? _archives;
private readonly UiPreferencesStore? _preferences;
public FolderReconciler(
IIndexStore store,
IFileSystemEnumerator enumerator,
StorageProviderRegistry providers,
ArchiveContentsIndexer? archives = null)
ArchiveContentsIndexer? archives = null,
UiPreferencesStore? preferences = null)
{
_store = store;
_enumerator = enumerator;
_providers = providers;
_archives = archives;
_preferences = preferences;
}
public async Task ReconcileAsync(Source source, string pathRel, CancellationToken cancellationToken)
@@ -56,7 +59,7 @@ public sealed class FolderReconciler
return;
}
if (!Directory.Exists(full))
if (!Directory.Exists(full) || LocationClassifier.IsRecycleBinName(parent.Name))
{
return;
}
@@ -69,11 +72,18 @@ public sealed class FolderReconciler
var liveNames = new HashSet<string>(live.Select(i => NameNormalizer.Normalize(i.Name)), StringComparer.Ordinal);
var archivesToExpand = new List<IndexEntry>();
var archivesToTomb = new List<string>();
var prefs = _preferences?.Load() ?? UiPreferences.Default;
await _store.RunWriteAsync(async s =>
{
foreach (var item in live)
{
var location = LocationClassifier.Classify(item.FullPath, item.Name, item.Attributes, item.IsDirectory);
if (!LocationVisibility.ShouldShow(location, prefs) || location.IsRecycleBin)
{
continue;
}
var rel = PathRules.MakeRelative(source.LastRootPath, item.FullPath);
var entry = new IndexEntry
{