feat(ui): show transient prime status in footer
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,9 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
|
||||
private readonly System.Timers.Timer _clearTimer = new(30_000) { AutoReset = false };
|
||||
|
||||
[ObservableProperty] private string? _primeStatus;
|
||||
private readonly System.Timers.Timer _primeStatusTimer = new(5_000) { AutoReset = false };
|
||||
|
||||
[RelayCommand]
|
||||
private void FocusSearch() => Lists?.RequestFocusSearch();
|
||||
|
||||
@@ -95,6 +98,16 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
WorkerLogText = null;
|
||||
}
|
||||
|
||||
private void OnPrimeFired(PrimeFiredEvent evt)
|
||||
{
|
||||
var when = evt.FiredAt.LocalDateTime.ToString("HH:mm");
|
||||
PrimeStatus = evt.Success
|
||||
? $"✓ Primed Claude at {when}"
|
||||
: $"⚠ Prime failed: {evt.Message}";
|
||||
_primeStatusTimer.Stop();
|
||||
_primeStatusTimer.Start();
|
||||
}
|
||||
|
||||
private void OnPlanningMergeConflict(string planningTaskId, string subtaskId, IReadOnlyList<string> conflictedFiles)
|
||||
{
|
||||
// Already on UI thread (WorkerClient dispatches via Dispatcher.UIThread.Post).
|
||||
@@ -177,6 +190,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
};
|
||||
Worker.WorkerLogReceivedEvent += OnWorkerLogReceived;
|
||||
Worker.PlanningMergeConflictEvent += OnPlanningMergeConflict;
|
||||
Worker.PrimeFired += OnPrimeFired;
|
||||
_clearTimer.Elapsed += (_, _) =>
|
||||
{
|
||||
if (Dispatcher.UIThread.CheckAccess())
|
||||
@@ -184,6 +198,8 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
else
|
||||
Dispatcher.UIThread.Post(ClearWorkerLog);
|
||||
};
|
||||
_primeStatusTimer.Elapsed += (_, _) =>
|
||||
Avalonia.Threading.Dispatcher.UIThread.Post(() => PrimeStatus = null);
|
||||
_ = Lists.LoadAsync();
|
||||
_updateCheck.PropertyChanged += (_, e) =>
|
||||
{
|
||||
|
||||
@@ -217,6 +217,15 @@
|
||||
TextTrimming="CharacterEllipsis"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!-- Right: prime status notification -->
|
||||
<TextBlock DockPanel.Dock="Right"
|
||||
Text="{Binding PrimeStatus}"
|
||||
Foreground="{DynamicResource TextDimBrush}"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12,0,0,0"
|
||||
IsVisible="{Binding PrimeStatus, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
|
||||
<!-- Spacer between pill and log -->
|
||||
<Panel/>
|
||||
</DockPanel>
|
||||
|
||||
Reference in New Issue
Block a user