feat(ui): animate folder expand in the sidebar
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user