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 };
|
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]
|
[RelayCommand]
|
||||||
private void FocusSearch() => Lists?.RequestFocusSearch();
|
private void FocusSearch() => Lists?.RequestFocusSearch();
|
||||||
|
|
||||||
@@ -95,6 +98,16 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
|||||||
WorkerLogText = null;
|
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)
|
private void OnPlanningMergeConflict(string planningTaskId, string subtaskId, IReadOnlyList<string> conflictedFiles)
|
||||||
{
|
{
|
||||||
// Already on UI thread (WorkerClient dispatches via Dispatcher.UIThread.Post).
|
// Already on UI thread (WorkerClient dispatches via Dispatcher.UIThread.Post).
|
||||||
@@ -177,6 +190,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
|||||||
};
|
};
|
||||||
Worker.WorkerLogReceivedEvent += OnWorkerLogReceived;
|
Worker.WorkerLogReceivedEvent += OnWorkerLogReceived;
|
||||||
Worker.PlanningMergeConflictEvent += OnPlanningMergeConflict;
|
Worker.PlanningMergeConflictEvent += OnPlanningMergeConflict;
|
||||||
|
Worker.PrimeFired += OnPrimeFired;
|
||||||
_clearTimer.Elapsed += (_, _) =>
|
_clearTimer.Elapsed += (_, _) =>
|
||||||
{
|
{
|
||||||
if (Dispatcher.UIThread.CheckAccess())
|
if (Dispatcher.UIThread.CheckAccess())
|
||||||
@@ -184,6 +198,8 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
|||||||
else
|
else
|
||||||
Dispatcher.UIThread.Post(ClearWorkerLog);
|
Dispatcher.UIThread.Post(ClearWorkerLog);
|
||||||
};
|
};
|
||||||
|
_primeStatusTimer.Elapsed += (_, _) =>
|
||||||
|
Avalonia.Threading.Dispatcher.UIThread.Post(() => PrimeStatus = null);
|
||||||
_ = Lists.LoadAsync();
|
_ = Lists.LoadAsync();
|
||||||
_updateCheck.PropertyChanged += (_, e) =>
|
_updateCheck.PropertyChanged += (_, e) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -217,6 +217,15 @@
|
|||||||
TextTrimming="CharacterEllipsis"
|
TextTrimming="CharacterEllipsis"
|
||||||
VerticalAlignment="Center"/>
|
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 -->
|
<!-- Spacer between pill and log -->
|
||||||
<Panel/>
|
<Panel/>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|||||||
Reference in New Issue
Block a user