feat(ui): add queueing and scheduling from task row context menu

- Right-click on a task row exposes Send to queue / Remove from queue
  and Schedule for... / Clear schedule actions.
- New virtual:queued list in the sidebar with live count.
- Sidebar counts are now computed (open per list, running, queued,
  review) and refreshed on task- and worker-side events.
- Sending a task to the queue wakes the worker so it starts immediately.
This commit is contained in:
mika kuns
2026-04-23 13:07:48 +02:00
parent 9952ff98f2
commit 6f725d12f5
7 changed files with 280 additions and 21 deletions

View File

@@ -19,11 +19,22 @@
Margin="0"
Classes.selected="{Binding IsSelected}"
Classes.done="{Binding Done}">
<Grid ColumnDefinitions="4,32,*,32" Margin="6,8,10,8">
<!-- Left accent bar (visible when selected) -->
<Border Grid.Column="0" Classes="task-row-accent"
IsVisible="{Binding IsSelected}"/>
<Border.ContextMenu>
<ContextMenu>
<MenuItem Header="Send to queue"
IsVisible="{Binding !IsQueued}"
Click="OnSendToQueueClick"/>
<MenuItem Header="Remove from queue"
IsVisible="{Binding IsQueued}"
Click="OnRemoveFromQueueClick"/>
<Separator/>
<MenuItem Header="Schedule for..." Click="OnScheduleForClick"/>
<MenuItem Header="Clear schedule"
IsVisible="{Binding HasSchedule}"
Click="OnClearScheduleClick"/>
</ContextMenu>
</Border.ContextMenu>
<Grid ColumnDefinitions="0,32,*,32" Margin="6,8,10,8">
<!-- Done toggle -->
<Button Grid.Column="1" Classes="flat" VerticalAlignment="Top"
@@ -53,6 +64,15 @@
<TextBlock Text="{Binding Status}"/>
</Border>
<!-- Dequeue button (only when Queued) -->
<Button Classes="icon-btn dequeue-btn"
IsVisible="{Binding IsQueued}"
ToolTip.Tip="Remove from queue"
Command="{Binding $parent[ItemsControl].((vm:TasksIslandViewModel)DataContext).RemoveFromQueueCommand}"
CommandParameter="{Binding}">
<PathIcon Width="10" Height="10" Data="{StaticResource Icon.X}"/>
</Button>
<!-- List chip with dot -->
<Border Classes="chip chip-list">
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
@@ -129,5 +149,45 @@
<Border Height="2" VerticalAlignment="Center" Margin="4,0"
Background="{DynamicResource MossBrush}" CornerRadius="1"/>
</Grid>
<!-- Hidden schedule anchor (its Flyout is shown from the context menu) -->
<Button Grid.Row="1" x:Name="ScheduleAnchor"
Width="1" Height="1" Opacity="0"
HorizontalAlignment="Left" VerticalAlignment="Top"
IsHitTestVisible="False" Focusable="False">
<Button.Flyout>
<Flyout Placement="Bottom" ShowMode="Standard">
<Border Background="{DynamicResource Surface2Brush}"
BorderBrush="{DynamicResource BorderBrush}"
BorderThickness="1" CornerRadius="10"
Padding="16" Width="300">
<StackPanel Spacing="12">
<TextBlock Text="Schedule task"
FontWeight="SemiBold" FontSize="13"
Foreground="{DynamicResource TextBrush}"/>
<StackPanel Spacing="6">
<TextBlock Text="DATE" FontSize="10" Opacity="0.6"
Foreground="{DynamicResource TextDimBrush}"/>
<DatePicker x:Name="ScheduleDate" HorizontalAlignment="Stretch"/>
</StackPanel>
<StackPanel Spacing="6">
<TextBlock Text="TIME" FontSize="10" Opacity="0.6"
Foreground="{DynamicResource TextDimBrush}"/>
<TimePicker x:Name="ScheduleTime" ClockIdentifier="24HourClock"
HorizontalAlignment="Stretch"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8"
HorizontalAlignment="Right" Margin="0,4,0,0">
<Button Content="Cancel" Click="OnScheduleCancelClick" MinWidth="76"/>
<Button Content="Schedule" Classes="accent" Click="OnScheduleSetClick" MinWidth="76"/>
</StackPanel>
</StackPanel>
</Border>
</Flyout>
</Button.Flyout>
</Button>
</Grid>
</UserControl>