feat(mission-control): show running Worker operations in a Running now section
Registry of active verify/merge/rebase/worktree-creation operations in the Worker, GetActiveOperations snapshot + OperationStarted/OperationEnded hub events, and a Running now section in Mission Control with ticking elapsed time. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
488c28a9d5
commit
2dbec543df
@@ -185,7 +185,7 @@
|
||||
</Panel>
|
||||
|
||||
<GridSplitter x:Name="QueueSplitter" Grid.Column="1"
|
||||
IsVisible="{Binding HasQueued}"
|
||||
IsVisible="{Binding HasActivity}"
|
||||
Width="6"
|
||||
Background="Transparent"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
@@ -194,12 +194,49 @@
|
||||
|
||||
<!-- Read-only queue strip — collapses when nothing is queued -->
|
||||
<Border Grid.Column="2"
|
||||
IsVisible="{Binding HasQueued}"
|
||||
IsVisible="{Binding HasActivity}"
|
||||
Background="{DynamicResource DeepBrush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="1,0,0,0">
|
||||
<DockPanel LastChildFill="True" Margin="10,10">
|
||||
<!-- Worker operations running right now; hidden when nothing runs. -->
|
||||
<StackPanel DockPanel.Dock="Top" Margin="0,0,0,12" Spacing="4"
|
||||
IsVisible="{Binding HasRunningOperations}">
|
||||
<TextBlock Classes="eyebrow"
|
||||
Text="{loc:Tr missionControl.runningNow}"
|
||||
Foreground="{DynamicResource TextMuteBrush}"
|
||||
LetterSpacing="1.4" Margin="0,0,0,4" />
|
||||
<ItemsControl ItemsSource="{Binding RunningOperations}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:RunningOperationViewModel">
|
||||
<Panel Margin="0,0,0,4">
|
||||
<Border Background="{DynamicResource SurfaceBrush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="1" CornerRadius="6" />
|
||||
<Border Background="{DynamicResource RunningTintBrush}"
|
||||
BorderBrush="{DynamicResource RunningTintBorderBrush}"
|
||||
BorderThickness="1" CornerRadius="6" />
|
||||
<StackPanel Margin="8,6" Spacing="2">
|
||||
<TextBlock Text="{Binding Subject}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
ToolTip.Tip="{Binding Subject}"
|
||||
Foreground="{DynamicResource TextDimBrush}" />
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBlock Grid.Column="0" Classes="meta"
|
||||
Text="{Binding KindLabel}"
|
||||
Foreground="{DynamicResource StatusRunningBrush}" />
|
||||
<TextBlock Grid.Column="1" Classes="meta"
|
||||
Text="{Binding Elapsed}"
|
||||
Foreground="{DynamicResource TextMuteBrush}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
<TextBlock DockPanel.Dock="Top" Classes="eyebrow"
|
||||
IsVisible="{Binding HasQueued}"
|
||||
Text="{loc:Tr missionControl.activity}"
|
||||
Foreground="{DynamicResource TextMuteBrush}"
|
||||
LetterSpacing="1.4" Margin="0,0,0,8" />
|
||||
|
||||
@@ -40,6 +40,24 @@ public partial class MissionControlView : UserControl
|
||||
OverviewGrid.AddHandler(PointerReleasedEvent, OnTilePointerReleased);
|
||||
}
|
||||
|
||||
// Ticks the "Running now" elapsed times while the view is on screen.
|
||||
private Avalonia.Threading.DispatcherTimer? _elapsedTimer;
|
||||
|
||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
_elapsedTimer = new Avalonia.Threading.DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
|
||||
_elapsedTimer.Tick += (_, _) => _vm?.TickOperations();
|
||||
_elapsedTimer.Start();
|
||||
}
|
||||
|
||||
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
_elapsedTimer?.Stop();
|
||||
_elapsedTimer = null;
|
||||
base.OnDetachedFromVisualTree(e);
|
||||
}
|
||||
|
||||
private const double DragThreshold = 4;
|
||||
|
||||
/// <summary>Tile presenter whose header was pressed; null when no tile drag is pending.</summary>
|
||||
@@ -199,7 +217,7 @@ public partial class MissionControlView : UserControl
|
||||
{
|
||||
if (e.PropertyName == nameof(MissionControlViewModel.ColumnCount))
|
||||
RebuildOverviewGrid();
|
||||
else if (e.PropertyName == nameof(MissionControlViewModel.HasQueued))
|
||||
else if (e.PropertyName == nameof(MissionControlViewModel.HasActivity))
|
||||
UpdateQueueColumn();
|
||||
else if (e.PropertyName == nameof(MissionControlViewModel.IsFocusMode))
|
||||
// The now-visible layout's hosts must re-steal their pane views from the hidden
|
||||
@@ -221,7 +239,7 @@ public partial class MissionControlView : UserControl
|
||||
private void UpdateQueueColumn()
|
||||
{
|
||||
var queueColumn = BodyGrid.ColumnDefinitions[2];
|
||||
if (_vm?.HasQueued == true)
|
||||
if (_vm?.HasActivity == true)
|
||||
{
|
||||
queueColumn.MinWidth = MinQueueWidth;
|
||||
queueColumn.Width = _queueWidth;
|
||||
|
||||
Reference in New Issue
Block a user