feat(ui): add starting state feedback to task list
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ public partial class TaskItemViewModel : ViewModelBase
|
||||
[ObservableProperty] private string _commitType;
|
||||
[ObservableProperty] private string? _description;
|
||||
[ObservableProperty] private TaskStatus _status;
|
||||
[ObservableProperty] private bool _isStarting;
|
||||
|
||||
public string Id { get; }
|
||||
public string ListId { get; }
|
||||
@@ -66,6 +67,7 @@ public partial class TaskItemViewModel : ViewModelBase
|
||||
RunNowCommand.NotifyCanExecuteChanged();
|
||||
OnPropertyChanged(nameof(IsDone));
|
||||
OnPropertyChanged(nameof(IsRunning));
|
||||
IsStarting = false;
|
||||
OnPropertyChanged(nameof(CanToggleDone));
|
||||
OnPropertyChanged(nameof(TitleDecorations));
|
||||
OnPropertyChanged(nameof(TitleForeground));
|
||||
@@ -73,6 +75,19 @@ public partial class TaskItemViewModel : ViewModelBase
|
||||
ToggleDoneCommand.NotifyCanExecuteChanged();
|
||||
}
|
||||
|
||||
public void SetStarting()
|
||||
{
|
||||
IsStarting = true;
|
||||
StatusText = "starting...";
|
||||
RunNowCommand.NotifyCanExecuteChanged();
|
||||
}
|
||||
|
||||
public void ClearStarting()
|
||||
{
|
||||
IsStarting = false;
|
||||
RunNowCommand.NotifyCanExecuteChanged();
|
||||
}
|
||||
|
||||
[RelayCommand(CanExecute = nameof(CanRunNow))]
|
||||
private async Task RunNowAsync()
|
||||
{
|
||||
@@ -81,7 +96,7 @@ public partial class TaskItemViewModel : ViewModelBase
|
||||
}
|
||||
|
||||
private bool CanRunNow() =>
|
||||
_canRunNow() && Status != TaskStatus.Running;
|
||||
_canRunNow() && Status != TaskStatus.Running && !IsStarting;
|
||||
|
||||
[RelayCommand(CanExecute = nameof(CanToggleDone))]
|
||||
private async Task ToggleDone()
|
||||
|
||||
Reference in New Issue
Block a user