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:
@@ -188,25 +188,34 @@ public sealed class StorageProviderRegistry
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ProviderQuota?> TryGetQuotaAsync(string rootPath, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var provider = Find(rootPath);
|
||||
if (provider is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return await provider.TryGetQuotaAsync(rootPath, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogDebug(ex, "Provider {Id} failed reading quota for {Path}", provider.Manifest.Id, rootPath);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CloudPresenceMapper
|
||||
{
|
||||
public static FileSystemItem Apply(FileSystemItem item, ProviderItemState state)
|
||||
=> new()
|
||||
{
|
||||
FullPath = item.FullPath,
|
||||
Name = item.Name,
|
||||
IsDirectory = item.IsDirectory,
|
||||
SizeBytes = item.SizeBytes,
|
||||
CreatedUtc = item.CreatedUtc,
|
||||
ModifiedUtc = item.ModifiedUtc,
|
||||
Attributes = item.Attributes,
|
||||
FileId = item.FileId,
|
||||
ReparseTag = item.ReparseTag,
|
||||
AllocatedSizeBytes = state.AllocatedSizeBytes ?? item.AllocatedSizeBytes,
|
||||
Cloud = ToPresence(state)
|
||||
};
|
||||
=> item.Overlay(
|
||||
allocatedSizeBytes: state.AllocatedSizeBytes ?? item.AllocatedSizeBytes,
|
||||
cloud: ToPresence(state),
|
||||
hydration: item.Hydration | ItemHydrationFlags.Provider);
|
||||
|
||||
public static CloudPresence ToPresence(ProviderItemState state)
|
||||
=> new(
|
||||
|
||||
Reference in New Issue
Block a user