Add Git overlay, operation tools, and virtualized preview so large folders stay responsive.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-24 15:04:04 +02:00
parent 9bf451932f
commit a3c54bbb03
127 changed files with 14748 additions and 633 deletions

View File

@@ -113,7 +113,8 @@ public class SourceManagerTests
var env = new FakeEnv(Path.GetDirectoryName(db)!);
var mgr = new SourceManager(store, volumes, env, new SystemClock(), NullLogger<SourceManager>.Instance);
await mgr.InitializeAsync();
var source = (await store.Sources.GetAllAsync()).Single();
var source = await mgr.EnsureForPathAsync(@"Z:\");
Assert.NotNull(source);
await store.Entries.UpsertAsync(new IndexEntry
{
SourceId = source.Id,
@@ -185,6 +186,89 @@ public class SourceManagerTests
Assert.Empty(await store.Sources.GetAllAsync());
Assert.Empty(File.ReadAllLines(Path.Combine(dir, "recents.txt")));
}
[Fact]
public async Task Forget_then_rediscover_same_volume_guid()
{
var db = Path.Combine(Path.GetTempPath(), "ew-app", Guid.NewGuid().ToString("N"), "index.db");
await using var store = new SqliteIndexStore(db, NullLogger<SqliteIndexStore>.Instance);
await store.OpenAsync();
var guid = @"\\?\Volume{phase2}\";
var volumes = new FakeVolumes
{
Online =
[
new VolumeFingerprint
{
Kind = SourceKind.Removable,
VolumeGuid = guid,
RootPath = @"E:\",
DisplayName = "Stick",
VolumeSerial = 9,
CapacityBytes = 64
}
]
};
var env = new FakeEnv(Path.GetDirectoryName(db)!);
var mgr = new SourceManager(store, volumes, env, new SystemClock(), NullLogger<SourceManager>.Instance);
await mgr.InitializeAsync();
Assert.Equal(guid, (await store.Sources.GetAllAsync()).Single().VolumeGuid);
volumes.Online = [];
await mgr.RefreshOnlineStateAsync();
Assert.True(await mgr.ForgetDisconnectedAsync(@"E:\"));
Assert.Empty(await store.Sources.GetAllAsync());
volumes.Online =
[
new VolumeFingerprint
{
Kind = SourceKind.Removable,
VolumeGuid = guid,
RootPath = @"F:\",
DisplayName = "Stick",
VolumeSerial = 9,
CapacityBytes = 64
}
];
await mgr.RefreshOnlineStateAsync();
var restored = Assert.Single(await store.Sources.GetAllAsync());
Assert.Equal(guid, restored.VolumeGuid);
Assert.Equal(@"F:\", restored.LastRootPath);
}
[Fact]
public async Task Mapped_network_drive_is_not_auto_added_until_imported()
{
var db = Path.Combine(Path.GetTempPath(), "ew-app", Guid.NewGuid().ToString("N"), "index.db");
await using var store = new SqliteIndexStore(db, NullLogger<SqliteIndexStore>.Instance);
await store.OpenAsync();
var volumes = new FakeVolumes
{
Online =
[
new VolumeFingerprint
{
Kind = SourceKind.Smb,
RootPath = @"Z:\",
DisplayName = "Z: (Network)",
Filesystem = "SMB"
}
]
};
var env = new FakeEnv(Path.GetDirectoryName(db)!);
var mgr = new SourceManager(store, volumes, env, new SystemClock(), NullLogger<SourceManager>.Instance);
await mgr.InitializeAsync();
Assert.Empty(await store.Sources.GetAllAsync());
var untracked = Assert.Single(await mgr.ListUntrackedOnlineVolumesAsync());
Assert.Equal(@"Z:\", untracked.RootPath);
var imported = await mgr.EnsureForPathAsync(@"Z:\");
Assert.NotNull(imported);
Assert.False(imported!.IsIndexed);
Assert.Empty(await mgr.ListUntrackedOnlineVolumesAsync());
Assert.Equal(imported.Id, (await store.Sources.GetAllAsync()).Single().Id);
}
}
file sealed class FakeVolumes : IVolumeService