Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/Filee.App/Services/RadialController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ private RadialWindow EnsureWindow()
}
};
// 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 += (_, _) =>
{
Expand Down Expand Up @@ -322,13 +322,19 @@ private void Convert(int index, int sub, IReadOnlyList<string> files, WebDrop? w
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;
}

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)
Expand Down
10 changes: 5 additions & 5 deletions src/Filee.App/Views/RadialWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public RadialWindow()
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;
Expand Down Expand Up @@ -88,15 +88,15 @@ private void OnDragOver(object? sender, DragEventArgs e)

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();
}

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;
Expand Down
Loading