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();
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
|
||||
<!-- Outer terminal card — Padding="0" so header/strip span edge-to-edge -->
|
||||
<Border Classes="terminal" Padding="0">
|
||||
<!-- Outer terminal card — Padding="0" so header/strip span edge-to-edge;
|
||||
ClipToBounds keeps tab content inside the rounded corners (no bottom clip). -->
|
||||
<Border Classes="terminal" Padding="0" ClipToBounds="True">
|
||||
<DockPanel LastChildFill="True">
|
||||
|
||||
<!-- ── Title bar ── -->
|
||||
@@ -42,47 +43,50 @@
|
||||
<Ellipse Classes="dot-green" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Info header: model · turns · +add -del -->
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="6"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Classes="meta" Text="{Binding Model}"
|
||||
Foreground="{DynamicResource TextMuteBrush}" />
|
||||
<TextBlock Classes="meta" Text="·"
|
||||
Foreground="{DynamicResource TextFaintBrush}" />
|
||||
<TextBlock Classes="meta" Text="{Binding TurnsText}"
|
||||
Foreground="{DynamicResource TextMuteBrush}" />
|
||||
<TextBlock Classes="meta" Text="·"
|
||||
Foreground="{DynamicResource TextFaintBrush}" />
|
||||
<TextBlock Classes="diff-add" Text="{Binding DiffAddText}" />
|
||||
<TextBlock Classes="diff-del" Text="{Binding DiffDelText}" />
|
||||
</StackPanel>
|
||||
<!-- Right cluster: info header (model · turns · diff) + status chip -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="12"
|
||||
Margin="0,0,8,0" VerticalAlignment="Center">
|
||||
|
||||
<!-- Status chips (LIVE / DONE / FAILED) -->
|
||||
<Panel Grid.Column="2" Margin="0,0,8,0" VerticalAlignment="Center">
|
||||
<Border Classes="live-chip pulsing"
|
||||
IsVisible="{Binding IsRunning}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
|
||||
<Ellipse VerticalAlignment="Center" />
|
||||
<TextBlock Text="{loc:Tr session.chipLive}" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Classes="live-chip done"
|
||||
IsVisible="{Binding IsDone}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
|
||||
<Ellipse VerticalAlignment="Center" Fill="{DynamicResource MossBrush}" />
|
||||
<TextBlock Text="{loc:Tr session.chipDone}" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource MossBrush}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Classes="live-chip failed"
|
||||
IsVisible="{Binding IsFailed}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
|
||||
<Ellipse VerticalAlignment="Center" Fill="{DynamicResource BloodBrush}" />
|
||||
<TextBlock Text="{loc:Tr session.chipFailed}" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource BloodBrush}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Panel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center">
|
||||
<TextBlock Classes="meta" Text="{Binding Model}"
|
||||
Foreground="{DynamicResource TextMuteBrush}" />
|
||||
<TextBlock Classes="meta" Text="·"
|
||||
Foreground="{DynamicResource TextFaintBrush}" />
|
||||
<TextBlock Classes="meta" Text="{Binding TurnsText}"
|
||||
Foreground="{DynamicResource TextMuteBrush}" />
|
||||
<TextBlock Classes="meta" Text="·"
|
||||
Foreground="{DynamicResource TextFaintBrush}" />
|
||||
<TextBlock Classes="diff-add" Text="{Binding DiffAddText}" />
|
||||
<TextBlock Classes="diff-del" Text="{Binding DiffDelText}" />
|
||||
</StackPanel>
|
||||
|
||||
<Panel VerticalAlignment="Center">
|
||||
<Border Classes="live-chip pulsing"
|
||||
IsVisible="{Binding IsRunning}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
|
||||
<Ellipse VerticalAlignment="Center" />
|
||||
<TextBlock Text="{loc:Tr session.chipLive}" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Classes="live-chip done"
|
||||
IsVisible="{Binding IsDone}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
|
||||
<Ellipse VerticalAlignment="Center" Fill="{DynamicResource MossBrush}" />
|
||||
<TextBlock Text="{loc:Tr session.chipDone}" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource MossBrush}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Classes="live-chip failed"
|
||||
IsVisible="{Binding IsFailed}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
|
||||
<Ellipse VerticalAlignment="Center" Fill="{DynamicResource BloodBrush}" />
|
||||
<TextBlock Text="{loc:Tr session.chipFailed}" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource BloodBrush}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Panel>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -124,11 +128,6 @@
|
||||
Content="Output"
|
||||
Command="{Binding SelectTabCommand}"
|
||||
CommandParameter="output" />
|
||||
<Button Classes="tab-btn"
|
||||
Classes.active="{Binding IsActionsTab}"
|
||||
Content="Actions"
|
||||
Command="{Binding SelectTabCommand}"
|
||||
CommandParameter="actions" />
|
||||
<Button Classes="tab-btn"
|
||||
Classes.active="{Binding IsSessionTab}"
|
||||
Content="Session"
|
||||
@@ -140,56 +139,23 @@
|
||||
<!-- ── Tab body ── -->
|
||||
<Grid>
|
||||
|
||||
<!-- Output: embedded SessionTerminalView -->
|
||||
<!-- Output: embedded terminal, inset so it reads as its own card -->
|
||||
<islands:SessionTerminalView
|
||||
IsVisible="{Binding IsOutputTab}"
|
||||
Margin="10,8,10,10"
|
||||
Entries="{Binding Log}"
|
||||
Label="{Binding SessionLabel}"
|
||||
IsRunning="{Binding IsRunning}"
|
||||
IsDone="{Binding IsDone}"
|
||||
IsFailed="{Binding IsFailed}" />
|
||||
|
||||
<!-- Actions: merge-target + worktree controls -->
|
||||
<ScrollViewer IsVisible="{Binding IsActionsTab}" Padding="14,10">
|
||||
<StackPanel Spacing="10">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="Merge target" />
|
||||
<ComboBox ItemsSource="{Binding MergeTargetBranches}"
|
||||
SelectedItem="{Binding SelectedMergeTarget, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</StackPanel>
|
||||
<WrapPanel Orientation="Horizontal">
|
||||
<Button Classes="btn" Content="Open Diff" Margin="0,0,8,8"
|
||||
Command="{Binding OpenDiffCommand}" />
|
||||
<Button Classes="btn" Margin="0,0,8,8"
|
||||
Command="{Binding OpenWorktreeCommand}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock Text="Worktree" />
|
||||
<PathIcon Data="{StaticResource Icon.ArrowOut}" Width="11" Height="11" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Classes="btn" Content="Review Combined Diff" Margin="0,0,8,8"
|
||||
Command="{Binding ReviewCombinedDiffCommand}" />
|
||||
<Button Classes="btn accent" Content="Merge All Subtasks" Margin="0,0,0,8"
|
||||
Command="{Binding MergeAllCommand}"
|
||||
IsEnabled="{Binding CanMergeAll}"
|
||||
ToolTip.Tip="{Binding MergeAllDisabledReason}" />
|
||||
</WrapPanel>
|
||||
<TextBlock Text="{Binding MergeAllError}"
|
||||
Foreground="{DynamicResource BloodBrush}"
|
||||
TextWrapping="Wrap"
|
||||
IsVisible="{Binding MergeAllError,
|
||||
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- Session: review block + child outcomes -->
|
||||
<!-- Session: review (top) + merge/worktree + outcomes — each gated on state -->
|
||||
<ScrollViewer IsVisible="{Binding IsSessionTab}" Padding="14,10">
|
||||
<StackPanel Spacing="10">
|
||||
<StackPanel Spacing="14">
|
||||
|
||||
<!-- Review block -->
|
||||
<!-- Review controls -->
|
||||
<StackPanel Spacing="8" IsVisible="{Binding IsWaitingForReview}">
|
||||
<TextBlock Classes="section-label" Text="REVIEW" Margin="0,0,0,2" />
|
||||
<TextBlock Classes="section-label" Text="REVIEW" />
|
||||
<TextBlock Classes="field-label" Text="Feedback" />
|
||||
<TextBox Text="{Binding ReviewFeedback, Mode=TwoWay}"
|
||||
AcceptsReturn="True"
|
||||
@@ -214,9 +180,42 @@
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Merge & worktree management -->
|
||||
<StackPanel Spacing="10" IsVisible="{Binding ShowMergeSection}">
|
||||
<TextBlock Classes="section-label" Text="MERGE & WORKTREE" />
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="Merge target" />
|
||||
<ComboBox ItemsSource="{Binding MergeTargetBranches}"
|
||||
SelectedItem="{Binding SelectedMergeTarget, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</StackPanel>
|
||||
<WrapPanel Orientation="Horizontal">
|
||||
<Button Classes="btn" Content="Open Diff" Margin="0,0,8,8"
|
||||
Command="{Binding OpenDiffCommand}" />
|
||||
<Button Classes="btn" Margin="0,0,8,8"
|
||||
Command="{Binding OpenWorktreeCommand}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock Text="Worktree" />
|
||||
<PathIcon Data="{StaticResource Icon.ArrowOut}" Width="11" Height="11" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Classes="btn" Content="Review Combined Diff" Margin="0,0,8,8"
|
||||
Command="{Binding ReviewCombinedDiffCommand}" />
|
||||
<Button Classes="btn accent" Content="Merge All Subtasks" Margin="0,0,0,8"
|
||||
Command="{Binding MergeAllCommand}"
|
||||
IsEnabled="{Binding CanMergeAll}"
|
||||
ToolTip.Tip="{Binding MergeAllDisabledReason}" />
|
||||
</WrapPanel>
|
||||
<TextBlock Text="{Binding MergeAllError}"
|
||||
Foreground="{DynamicResource BloodBrush}"
|
||||
TextWrapping="Wrap"
|
||||
IsVisible="{Binding MergeAllError,
|
||||
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Child outcomes -->
|
||||
<StackPanel Spacing="6" IsVisible="{Binding HasChildOutcomes}">
|
||||
<TextBlock Classes="section-label" Text="OUTCOMES" Margin="0,0,0,2" />
|
||||
<TextBlock Classes="section-label" Text="OUTCOMES" />
|
||||
<ItemsControl ItemsSource="{Binding ChildOutcomes}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:ChildOutcomeRowViewModel">
|
||||
@@ -236,6 +235,13 @@
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Empty state: nothing to manage yet -->
|
||||
<TextBlock IsVisible="{Binding ShowSessionEmpty}"
|
||||
Classes="meta"
|
||||
Foreground="{DynamicResource TextMuteBrush}"
|
||||
TextWrapping="Wrap"
|
||||
Text="Nothing to manage yet — review and merge controls appear here once the run finishes." />
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:loc="using:ClaudeDo.Ui.Localization"
|
||||
x:Class="ClaudeDo.Ui.Views.Islands.SessionTerminalView"
|
||||
x:Name="Root">
|
||||
<Border Classes="terminal" Margin="18,8,18,0">
|
||||
<Border Classes="terminal" Margin="0">
|
||||
<DockPanel LastChildFill="True">
|
||||
|
||||
<!-- ── Terminal header bar ── -->
|
||||
|
||||
Reference in New Issue
Block a user