feat(ui): Interactive chip for tasks with an open ConPTY session

A task driven by hand in Mission Control is Idle with an Active worktree, so its
lifecycle chip read "Parked" — indistinguishable from a task genuinely set aside.
The shell now mirrors Mission Control's open panes onto the rows, which show an
accent "Interactive" chip instead; tapping it surfaces Mission Control and
focuses that pane (the open command already dedupes by task id).
This commit is contained in:
Mika Kuns
2026-07-27 15:02:51 +02:00
parent 1466d0fbab
commit c93a20f20c
8 changed files with 92 additions and 9 deletions
+2 -1
View File
@@ -152,6 +152,7 @@
"removeFromQueueTip": "Aus Warteschlange entfernen",
"toggleSubtasksTip": "Unteraufgaben ein-/ausklappen",
"agentSuggestedTip": "Vom Agenten vorgeschlagen",
"interactiveChipTip": "Interaktive Sitzung offen — klicken, um im Mission Control dorthin zu springen",
"scheduleTitle": "Aufgabe planen",
"scheduleWhen": "WANN",
"scheduleConfirm": "Planen",
@@ -523,7 +524,7 @@
"connection": { "online": "Online", "connecting": "Verbinden…", "offline": "Offline" },
"shell": { "restartingWorker": "Worker wird neu gestartet…" },
"agentStatus": { "idle": "Leerlauf", "queued": "In Warteschlange", "running": "Läuft", "review": "Prüfung", "children": "Wartet auf Teilaufgaben", "done": "Fertig", "failed": "Fehlgeschlagen", "cancelled": "Abgebrochen" },
"taskStatus": { "idle": "Leerlauf", "queued": "In Warteschlange", "running": "Läuft", "waitingForReview": "Wartet auf Prüfung", "waitingForChildren": "Wartet auf Teilaufgaben", "done": "Fertig", "failed": "Fehlgeschlagen", "cancelled": "Abgebrochen", "parked": "Geparkt" },
"taskStatus": { "idle": "Leerlauf", "queued": "In Warteschlange", "running": "Läuft", "waitingForReview": "Wartet auf Prüfung", "waitingForChildren": "Wartet auf Teilaufgaben", "done": "Fertig", "failed": "Fehlgeschlagen", "cancelled": "Abgebrochen", "parked": "Geparkt", "interactive": "Interaktiv" },
"planningBadge": { "active": "PLANUNG", "finalized": "GEPLANT" },
"taskRow": { "createdPrefix": "Erstellt {0}", "stepsText": "{0}/{1} Schritte" },
"tasksIsland": { "completedHeader": "ABGESCHLOSSEN", "completedHeaderCount": "ABGESCHLOSSEN · {0}", "planningOpenFailed": "Planungssitzung konnte nicht geöffnet werden: {0}", "planningResumeFailed": "Planungssitzung konnte nicht fortgesetzt werden: {0}", "pickUpInTerminalFailed": "Im Terminal fortsetzen fehlgeschlagen: {0}", "approveFailed": "Genehmigen & Mergen fehlgeschlagen: {0}" },
+2 -1
View File
@@ -152,6 +152,7 @@
"removeFromQueueTip": "Remove from queue",
"toggleSubtasksTip": "Expand / collapse subtasks",
"agentSuggestedTip": "Suggested by the agent",
"interactiveChipTip": "Interactive session open — click to jump to it in Mission Control",
"scheduleTitle": "Schedule task",
"scheduleWhen": "WHEN",
"scheduleConfirm": "Schedule",
@@ -523,7 +524,7 @@
"connection": { "online": "Online", "connecting": "Connecting…", "offline": "Offline" },
"shell": { "restartingWorker": "Restarting worker…" },
"agentStatus": { "idle": "Idle", "queued": "Queued", "running": "Running", "review": "Review", "children": "Waiting for Subtasks", "done": "Done", "failed": "Failed", "cancelled": "Cancelled" },
"taskStatus": { "idle": "Idle", "queued": "Queued", "running": "Running", "waitingForReview": "Waiting for Review", "waitingForChildren": "Waiting for Subtasks", "done": "Done", "failed": "Failed", "cancelled": "Cancelled", "parked": "Parked" },
"taskStatus": { "idle": "Idle", "queued": "Queued", "running": "Running", "waitingForReview": "Waiting for Review", "waitingForChildren": "Waiting for Subtasks", "done": "Done", "failed": "Failed", "cancelled": "Cancelled", "parked": "Parked", "interactive": "Interactive" },
"planningBadge": { "active": "PLANNING", "finalized": "PLANNED" },
"taskRow": { "createdPrefix": "Created {0}", "stepsText": "{0}/{1} steps" },
"tasksIsland": { "completedHeader": "COMPLETED", "completedHeaderCount": "COMPLETED · {0}", "planningOpenFailed": "Couldn't open planning session: {0}", "planningResumeFailed": "Couldn't resume planning session: {0}", "pickUpInTerminalFailed": "Pick up in terminal failed: {0}", "approveFailed": "Approve & merge failed: {0}" },
+15
View File
@@ -247,6 +247,21 @@
<Setter Property="Foreground" Value="#8FB9D6" />
</Style>
<!-- interactive → accent, the "live" family shared with running: the task has a ConPTY session
open in Mission Control. Clickable (jumps to that pane), hence the hand cursor + hover lift.
Deliberately NOT the slate-blue parked treatment — telling the two apart is the whole point. -->
<Style Selector="Border.chip.interactive">
<Setter Property="Background" Value="{StaticResource RunningTintBrush}" />
<Setter Property="BorderBrush" Value="{StaticResource AccentBrush}" />
<Setter Property="Cursor" Value="Hand" />
</Style>
<Style Selector="Border.chip.interactive > TextBlock">
<Setter Property="Foreground" Value="{StaticResource AccentBrush}" />
</Style>
<Style Selector="Border.chip.interactive:pointerover">
<Setter Property="Background" Value="{StaticResource AccentSoftBrush}" />
</Style>
<!-- Worktree-state chips (worktrees overview) -->
<!-- active → slate-blue (same hue as parked: a live worktree) -->
<Style Selector="Border.chip.wt-active">
@@ -35,6 +35,10 @@ public sealed partial class TaskRowViewModel : ViewModelBase
[ObservableProperty] private bool _parentInView = true;
[ObservableProperty] private int _roadblockCount;
[ObservableProperty] private bool _isRefining;
// Set by the shell from Mission Control's open ConPTY panes: this task has a live hand-driven
// session, which outranks the persisted status on the lifecycle chip (an interactive task is
// typically Idle+Active-worktree, i.e. would otherwise read "Parked").
[ObservableProperty] private bool _hasInteractiveSession;
// Set by the custom drag while this row is being dragged — drives the "grabbed" row style.
[ObservableProperty] private bool _isDragging;
@@ -84,8 +88,10 @@ public sealed partial class TaskRowViewModel : ViewModelBase
public bool IsOverdue => ScheduledFor is { } d && d.Date < DateTime.Today && !Done;
public bool IsRunning => Status == TaskStatus.Running;
public bool IsWaitingForReview => Status == TaskStatus.WaitingForReview;
// Parked = set aside from review: Idle but still holding its Active worktree (vs a plain Idle task).
public bool IsParked => Status == TaskStatus.Idle && WorktreeState == ClaudeDo.Data.Models.WorktreeState.Active;
// Parked = set aside from review: Idle but still holding its Active worktree (vs a plain Idle
// task). A live ConPTY session is that same shape but not parked — it reads "Interactive".
public bool IsParked => Status == TaskStatus.Idle && WorktreeState == ClaudeDo.Data.Models.WorktreeState.Active
&& !HasInteractiveSession;
public bool IsQueued => Status == TaskStatus.Queued && string.IsNullOrEmpty(BlockedByTaskId);
public bool IsWaiting => Status == TaskStatus.Queued && !string.IsNullOrEmpty(BlockedByTaskId);
public bool CanRemoveFromQueue => IsQueued || HasQueuedSubtasks;
@@ -115,7 +121,14 @@ public sealed partial class TaskRowViewModel : ViewModelBase
public string DiffDeletionsText => $"{DiffDeletions}";
public string StepsText => Loc.T("vm.taskRow.stepsText", StepsCompleted, StepsCount);
public string StatusLabel => IsParked ? Loc.T("vm.taskStatus.parked") : Status switch
// Null on a plain status chip so no tooltip shows there — the chip is only actionable
// while a session is open.
public string? InteractiveChipTooltip
=> HasInteractiveSession ? Loc.T("tasks.interactiveChipTip") : null;
public string StatusLabel
=> HasInteractiveSession ? Loc.T("vm.taskStatus.interactive")
: IsParked ? Loc.T("vm.taskStatus.parked") : Status switch
{
TaskStatus.Idle => Loc.T("vm.taskStatus.idle"),
TaskStatus.Queued => Loc.T("vm.taskStatus.queued"),
@@ -130,10 +143,14 @@ public sealed partial class TaskRowViewModel : ViewModelBase
// A planning parent that is still Idle (Active planning, or Finalized-but-not-yet-queued)
// already shows its state via the PLANNING/PLANNED badge next to the title. The lifecycle
// chip would read "Idle" (or "Parked"), which is misleading, so hide it in that case.
public bool ShowStatusChip => !(PlanningPhase != PlanningPhase.None && Status == TaskStatus.Idle);
// chip would read "Idle" (or "Parked"), which is misleading, so hide it in that case
// unless there's a live session, where "Interactive" is exactly what the user needs to see.
public bool ShowStatusChip => HasInteractiveSession
|| !(PlanningPhase != PlanningPhase.None && Status == TaskStatus.Idle);
public string StatusChipClass => (Status, IsBlocked: !string.IsNullOrEmpty(BlockedByTaskId)) switch
public string StatusChipClass => HasInteractiveSession
? "interactive"
: (Status, IsBlocked: !string.IsNullOrEmpty(BlockedByTaskId)) switch
{
(TaskStatus.Running, _) => "running",
(TaskStatus.WaitingForReview, _) => "review",
@@ -208,6 +225,15 @@ public sealed partial class TaskRowViewModel : ViewModelBase
partial void OnIsRefiningChanged(bool value) => OnPropertyChanged(nameof(CanRefine));
partial void OnHasInteractiveSessionChanged(bool value)
{
OnPropertyChanged(nameof(IsParked));
OnPropertyChanged(nameof(StatusChipClass));
OnPropertyChanged(nameof(StatusLabel));
OnPropertyChanged(nameof(ShowStatusChip));
OnPropertyChanged(nameof(InteractiveChipTooltip));
}
partial void OnHasQueuedSubtasksChanged(bool value)
{
OnPropertyChanged(nameof(CanRemoveFromQueue));
@@ -21,6 +21,9 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
private readonly Dictionary<string, bool> _expandedState = new();
private ListNavItemViewModel? _currentList;
private CancellationTokenSource? _loadCts;
// Task ids with a live ConPTY pane in Mission Control; kept here so rows loaded later still
// pick the flag up (see SyncInteractiveSessions).
private readonly HashSet<string> _interactiveSessionIds = new();
private static readonly TaskListFilterRegistry _filters = new();
public event EventHandler? SelectionChanged;
@@ -274,6 +277,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
{
var row = TaskRowViewModel.FromEntity(t);
row.ShowListChip = showListChip;
row.HasInteractiveSession = _interactiveSessionIds.Contains(row.Id);
Items.Add(row);
}
@@ -441,6 +445,17 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
TasksChanged?.Invoke(this, EventArgs.Empty);
}
/// <summary>Replaces the set of tasks that currently have an open interactive (ConPTY) session,
/// so their lifecycle chip reads "Interactive" instead of "Parked".</summary>
public void SyncInteractiveSessions(IEnumerable<string> taskIds)
{
_interactiveSessionIds.Clear();
foreach (var id in taskIds)
_interactiveSessionIds.Add(id);
foreach (var r in Items)
r.HasInteractiveSession = _interactiveSessionIds.Contains(r.Id);
}
public bool CanReorder => _currentList?.Kind == ListKind.User;
public void ClearDropHints()
@@ -215,6 +215,8 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
MissionControl.ShowDetached = (monitor, reDock) => Dialogs?.ShowDetachedMonitor(monitor, reDock);
MissionControl.OpenSettingsRequested = () => Lists.OpenSettingsCommand.Execute(null);
MissionControl.ErrorReported += FlashFooterError;
// Keep the task rows' "Interactive" chip in step with Mission Control's open ConPTY panes.
MissionControl.ConPtySessions.CollectionChanged += (_, _) => SyncInteractiveSessionChips();
_updateCheck = updateCheck;
_installerLocator = installerLocator;
_workerLocator = workerLocator;
@@ -330,6 +332,16 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
Dialogs.ShowMissionControl(MissionControl);
}
private void SyncInteractiveSessionChips()
{
if (MissionControl is null) return;
Tasks.SyncInteractiveSessions(
MissionControl.ConPtySessions
.Select(s => s.TaskId)
.Where(id => !string.IsNullOrEmpty(id))
.Select(id => id!));
}
[RelayCommand]
private async Task OpenAbout()
{
@@ -154,9 +154,13 @@
IsVisible="{Binding IsAgentSuggested}"
ToolTip.Tip="{loc:Tr tasks.agentSuggestedTip}"/>
<!-- Status chip -->
<!-- Status chip. When a ConPTY session is open it reads "Interactive" and is tappable —
it jumps to that pane in Mission Control. -->
<Border Classes="chip"
IsVisible="{Binding ShowStatusChip}"
Tapped="OnStatusChipTapped"
ToolTip.Tip="{Binding InteractiveChipTooltip}"
Classes.interactive="{Binding HasInteractiveSession}"
Classes.parked="{Binding IsParked}"
Classes.running="{Binding Status, Converter={StaticResource EqStatus}, ConverterParameter=Running}"
Classes.review="{Binding Status, Converter={StaticResource EqStatus}, ConverterParameter=WaitingForReview}"
@@ -67,6 +67,15 @@ public partial class TaskRowView : UserControl
vm.OpenConPtySessionCommand.Execute(row);
}
// The status chip is only actionable while a ConPTY session is open; the open command dedupes
// by task id, so it surfaces Mission Control and focuses the existing pane.
private void OnStatusChipTapped(object? sender, RoutedEventArgs e)
{
if (DataContext is not TaskRowViewModel { HasInteractiveSession: true } row) return;
if (FindTasksVm() is { } vm)
vm.OpenConPtySessionCommand.Execute(row);
}
private async void OnPickUpInTerminalClick(object? sender, RoutedEventArgs e)
{
if (DataContext is TaskRowViewModel row && FindTasksVm() is { } vm)