feat(ui): rework work console — single Session tab, right-aligned header, turns x/y
- Merge "Actions" + "Session" into one state-aware Session tab: review controls on top, then merge/worktree management, then child outcomes — each gated on the current state, with an empty-state hint when there's nothing to manage. This is the home the real merge/diff work (task 09eb5d52) will slot into. - Move the model · turns · diff info block to the right of the title bar. - Show turns as current/max using the resolved turn budget (task → list → global). - Output terminal now fills the console body cleanly: clip the console to its rounded corners and inset the embedded terminal instead of clipping its bottom. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -133,23 +133,42 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
EditableTitle, EditableDescription, Subtasks.Select(s => (s.Title, s.Done)));
|
||||
|
||||
// ── Work console (redesign) ────────────────────────────────────────
|
||||
// Two tabs: Output (live log) and Session (review + merge/worktree +
|
||||
// outcomes, each section gated on the relevant state).
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsOutputTab))]
|
||||
[NotifyPropertyChangedFor(nameof(IsActionsTab))]
|
||||
[NotifyPropertyChangedFor(nameof(IsSessionTab))]
|
||||
private string _selectedTab = "output";
|
||||
|
||||
public bool IsOutputTab => SelectedTab == "output";
|
||||
public bool IsActionsTab => SelectedTab == "actions";
|
||||
public bool IsSessionTab => SelectedTab == "session";
|
||||
|
||||
[RelayCommand]
|
||||
private void SelectTab(string? tab) => SelectedTab = tab ?? "output";
|
||||
|
||||
public string TurnsText => $"{Turns} turns";
|
||||
// Merge/worktree controls only matter once there's a worktree to manage
|
||||
// (standalone task), or a planning parent / improvement parent with children.
|
||||
public bool ShowMergeSection =>
|
||||
WorktreePath != null || Task?.IsPlanningParent == true || HasChildOutcomes;
|
||||
|
||||
// Nothing to manage yet (idle/queued/running standalone): show a hint.
|
||||
public bool ShowSessionEmpty =>
|
||||
!IsWaitingForReview && !ShowMergeSection && !HasChildOutcomes;
|
||||
|
||||
private void NotifySessionSections()
|
||||
{
|
||||
OnPropertyChanged(nameof(ShowMergeSection));
|
||||
OnPropertyChanged(nameof(ShowSessionEmpty));
|
||||
}
|
||||
|
||||
public string TurnsText => $"{Turns}/{EffectiveMaxTurns}";
|
||||
public string DiffAddText => $"+{DiffAdditions}";
|
||||
public string DiffDelText => $"-{DiffDeletions}";
|
||||
|
||||
// Resolved turn budget: per-task override → list default → global default.
|
||||
public int EffectiveMaxTurns =>
|
||||
TaskMaxTurns is decimal t ? (int)t : (_listMaxTurns ?? _globalMaxTurns);
|
||||
|
||||
public bool ShowRoadblock => IsFailed || IsCancelled;
|
||||
public string RoadblockMessage =>
|
||||
IsFailed ? "The session ended with an error." :
|
||||
@@ -201,6 +220,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
OnPropertyChanged(nameof(IsAgentSectionEnabled));
|
||||
OnPropertyChanged(nameof(ShowRoadblock));
|
||||
OnPropertyChanged(nameof(RoadblockMessage));
|
||||
NotifySessionSections();
|
||||
}
|
||||
[ObservableProperty] private string? _model;
|
||||
|
||||
@@ -223,7 +243,13 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
private string? _listAgentName;
|
||||
|
||||
partial void OnTaskModelSelectionChanged(string? value) { RecomputeModelBadge(); QueueAgentSave(); }
|
||||
partial void OnTaskMaxTurnsChanged(decimal? value) { RecomputeTurnsBadge(); QueueAgentSave(); }
|
||||
partial void OnTaskMaxTurnsChanged(decimal? value)
|
||||
{
|
||||
RecomputeTurnsBadge();
|
||||
OnPropertyChanged(nameof(EffectiveMaxTurns));
|
||||
OnPropertyChanged(nameof(TurnsText));
|
||||
QueueAgentSave();
|
||||
}
|
||||
|
||||
private void RecomputeModelBadge()
|
||||
{
|
||||
@@ -460,6 +486,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
{
|
||||
RecomputeCanMergeAll();
|
||||
ReviewCombinedDiffCommand.NotifyCanExecuteChanged();
|
||||
NotifySessionSections();
|
||||
};
|
||||
|
||||
PrepLog.CollectionChanged += (_, _) => OnPropertyChanged(nameof(ShowPrepEmptyState));
|
||||
@@ -637,6 +664,8 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
RecomputeModelBadge();
|
||||
RecomputeTurnsBadge();
|
||||
RecomputeAgentBadge();
|
||||
OnPropertyChanged(nameof(EffectiveMaxTurns));
|
||||
OnPropertyChanged(nameof(TurnsText));
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -1113,8 +1142,11 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
{
|
||||
OpenDiffCommand.NotifyCanExecuteChanged();
|
||||
OpenWorktreeCommand.NotifyCanExecuteChanged();
|
||||
NotifySessionSections();
|
||||
}
|
||||
|
||||
partial void OnTaskChanged(TaskRowViewModel? value) => NotifySessionSections();
|
||||
|
||||
[RelayCommand]
|
||||
private void CloseDetails() => CloseDetail?.Invoke();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user