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

@@ -0,0 +1,88 @@
using Explorer.Domain;
using Explorer.Domain.Abstractions;
namespace Explorer.FileOperations;
internal static class OperationAvailability
{
public static bool IsReady(IVolumeService volumes, TransferJob job)
{
foreach (var path in PathsToCheck(job))
{
if (!IsVolumeReachable(volumes, path))
{
return false;
}
}
return true;
}
public static IEnumerable<string> PathsToCheck(TransferJob job)
{
switch (job.Op)
{
case TransferOp.Delete:
if (job.AdditionalSources.Count > 0)
{
foreach (var src in job.AdditionalSources)
{
yield return src;
}
yield break;
}
foreach (var src in job.SourcePath.Split('|', StringSplitOptions.RemoveEmptyEntries))
{
yield return src;
}
yield break;
case TransferOp.Copy:
case TransferOp.Move:
case TransferOp.Rename:
case TransferOp.Extract:
case TransferOp.Compress:
case TransferOp.AddToArchive:
if (!string.IsNullOrWhiteSpace(job.DestinationPath))
{
yield return PathRules.Parent(job.DestinationPath);
}
yield break;
case TransferOp.VerifyArchive:
yield return job.SourcePath;
yield break;
case TransferOp.EmptyRecycleBin:
yield break;
}
}
public static bool IsVolumeReachable(IVolumeService volumes, string path)
{
if (string.IsNullOrWhiteSpace(path))
{
return true;
}
if (volumes.IsPathReachable(path))
{
return true;
}
var root = PathRules.VolumeRoot(path);
if (string.IsNullOrWhiteSpace(root))
{
return false;
}
if (!string.Equals(root, path, StringComparison.OrdinalIgnoreCase) && volumes.IsPathReachable(root))
{
return true;
}
var slashed = root.EndsWith('\\') ? root : root + "\\";
return volumes.IsPathReachable(slashed);
}
}