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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user