Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

Log whether a donut drag ended in a drop, and why a drop didn't convert

KnifeLemonfc3775eb7633
diff --git a/src/Filee.App/Services/RadialController.cs b/src/Filee.App/Services/RadialController.cs
index bfcd335b..c3ad8b5d 100644
--- a/src/Filee.App/Services/RadialController.cs
+++ b/src/Filee.App/Services/RadialController.cs
@@ -262,10 +262,10 @@ public sealed class RadialController(
}
};
// One line per drag, to tell "the drag never reached the donut" from "it did but nothing lit up" when someone
- // reports a donut that doesn't react.
- window.DragSummary += (events, hit, lit) =>
- log.LogInformation("Drag over the donut: {Events} move event(s), ended on {Kind} {Index}, drawn lit {Lit:0.00}",
- events, hit.Kind, hit.Index, lit);
+ // reports a donut that doesn't react, and a drop from a drag the system ended without one (#784).
+ window.DragSummary += (events, hit, lit, dropped) =>
+ log.LogInformation("Drag over the donut: {Events} move event(s), ended on {Kind} {Index}, drawn lit {Lit:0.00}{Drop}",
+ events, hit.Kind, hit.Index, lit, dropped ? "" : ", left without a drop");
window.EscapePressed += () => Close();
window.Deactivated += (_, _) =>
{
@@ -322,6 +322,11 @@ public sealed class RadialController(
var orphaned = web is null && files.Any(WebDrop.IsPlaceholder);
if (viewModel.PresetAt(index, sub) is not { } preset || SourcesFor(preset, files) is not { Count: > 0 } sources || orphaned)
{
+ // Said in the log, as a drop that closes the donut looks the same as one the system never delivered (#784).
+ log.LogInformation("The donut closed without converting: {Reason}",
+ viewModel.PresetAt(index, sub) is not { } slice ? $"no preset at slice {index}/{sub}"
+ : orphaned ? "the browser drop behind the files is gone"
+ : $"none of the {files.Count} file(s) fit preset {slice.Id}");
web?.Dispose();
Close();
return;
@@ -329,6 +334,7 @@ public sealed class RadialController(
if (preset.IsTool)
{
+ log.LogInformation("Opening {Preset} for {Count} file(s)", preset.Id, sources.Count);
var near = _window?.Position;
Close(animate: false);
if (web is null)
diff --git a/src/Filee.App/Views/RadialWindow.axaml.cs b/src/Filee.App/Views/RadialWindow.axaml.cs
index c5af280e..622b4d99 100644
--- a/src/Filee.App/Views/RadialWindow.axaml.cs
+++ b/src/Filee.App/Views/RadialWindow.axaml.cs
@@ -42,10 +42,10 @@ public partial class RadialWindow : Window
public event Action? DragLeft;
/// <summary>
- /// After a drag ends (drop or leave): how many drag-over events came in, where the last one was and how far that
- /// slice was drawn lit up (0 to 1).
+ /// After a drag ends (drop or leave): how many drag-over events came in, where the last one was, how far that
+ /// slice was drawn lit up (0 to 1) and whether it ended in a drop.
/// </summary>
- public event Action<int, DonutHit, double>? DragSummary;
+ public event Action<int, DonutHit, double, bool>? DragSummary;
private int _dragOverEvents;
private bool _dragOffersFiles;
@@ -88,7 +88,7 @@ public partial class RadialWindow : Window
private void OnDragLeave(object? sender, DragEventArgs e)
{
- DragSummary?.Invoke(_dragOverEvents, _lastDragHit, Donut.LitAmount(_lastDragHit.Index));
+ DragSummary?.Invoke(_dragOverEvents, _lastDragHit, Donut.LitAmount(_lastDragHit.Index), false);
Donut.ExternalDragLeft(_lastDragAt);
DragLeft?.Invoke();
}
@@ -96,7 +96,7 @@ public partial class RadialWindow : Window
private void OnDrop(object? sender, DragEventArgs e)
{
var hit = Donut.HitTest(e.GetPosition(Donut));
- DragSummary?.Invoke(_dragOverEvents, hit, Donut.LitAmount(hit.Index));
+ DragSummary?.Invoke(_dragOverEvents, hit, Donut.LitAmount(hit.Index), true);
Donut.CollapseGroup();
Donut.SetExternalHighlight(-1);
e.DragEffects = Donut.Converts(hit) ? DragDropEffects.Copy : DragDropEffects.None;