feat(ui): animate folder expand in the sidebar

This commit is contained in:
mika kuns
2026-09-30 10:19:35 +02:00
parent 60358100be
commit 928e3905d9
4 changed files with 18 additions and 1 deletions
@@ -18,6 +18,8 @@ public sealed partial class ListFolderNavItemViewModel : ViewModelBase
[ObservableProperty] private string _iconKey = "Folder";
/// <summary>Hex colour for name + guide line; null = theme default.</summary>
[ObservableProperty] private string? _color;
/// <summary>Set on the first user toggle so the expand animation skips folders that load already open.</summary>
[ObservableProperty] private bool _animateExpand;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(ShowCount))]
private bool _isCollapsed;
@@ -730,6 +730,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
private void ToggleFolder(ListFolderNavItemViewModel? folder)
{
if (folder is null) return;
folder.AnimateExpand = true;
folder.IsCollapsed = !folder.IsCollapsed;
if (_folderCollapseCts.TryGetValue(folder.Id, out var previous)) previous.Cancel();
var cts = new CancellationTokenSource();