Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/Filee.App/ViewModels/RadialViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ private void ShowFace(bool back, bool checkBack = true)
Items = face.Items;
}
var other = back ? _front : checkBack ? BackFace() : _back;
CanFlip = other?.IsUsable == true;
// The front was already shown, even when every slice was disabled. Do not strand the user on the back face.
CanFlip = back ? _front.Items.Count > 0 : other?.IsUsable == true;
var how = FlipKey is { } key ? KeyNames.Display(key) : "";
FlipHint = CanFlip && (FlipKey is not null || FlipWithWheel)
? loc.Format(back ? "donut.flip_to_front" : "donut.flip_to_back", how).Trim()
Expand Down
18 changes: 18 additions & 0 deletions tests/Filee.App.Tests/DonutFlipTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,24 @@ public void A_donut_without_a_back_face_does_not_flip() => With(animations: true
window.Close();
});

[AvaloniaFact]
public void A_disabled_front_face_is_still_reachable_after_flipping_to_a_usable_back() =>
With(animations: false, back: ["to-gif"], () =>
{
Images.PresetIds = ["to-wav"];
var (vm, window, donut) = OpenClickMode();
try
{
Assert.All(vm.Items, item => Assert.False(item.IsEnabled));
Assert.True(donut.Flip());
Assert.True(vm.IsBackFace);
Assert.True(vm.CanFlip);
Assert.True(donut.Flip());
Assert.False(vm.IsBackFace);
}
finally { window.Close(); }
});

[AvaloniaFact]
public void The_back_face_greys_out_what_cannot_convert_the_files_and_one_with_nothing_left_does_not_flip()
{
Expand Down
Loading