feat(ui): always-visible Steps section at top of DetailsIsland with add-step input
This commit is contained in:
@@ -110,6 +110,8 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
|||||||
public ObservableCollection<LogLineViewModel> Log { get; } = new();
|
public ObservableCollection<LogLineViewModel> Log { get; } = new();
|
||||||
public ObservableCollection<SubtaskRowViewModel> Subtasks { get; } = new();
|
public ObservableCollection<SubtaskRowViewModel> Subtasks { get; } = new();
|
||||||
|
|
||||||
|
[ObservableProperty] private string _newSubtaskTitle = "";
|
||||||
|
|
||||||
// Claude CLI stream-json parser + buffer for partial text deltas
|
// Claude CLI stream-json parser + buffer for partial text deltas
|
||||||
private readonly StreamLineFormatter _formatter = new();
|
private readonly StreamLineFormatter _formatter = new();
|
||||||
private readonly StringBuilder _claudeBuf = new();
|
private readonly StringBuilder _claudeBuf = new();
|
||||||
@@ -487,6 +489,30 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
|||||||
CloseDetail?.Invoke();
|
CloseDetail?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
private async System.Threading.Tasks.Task AddSubtaskAsync()
|
||||||
|
{
|
||||||
|
if (Task is null) return;
|
||||||
|
var title = NewSubtaskTitle?.Trim();
|
||||||
|
if (string.IsNullOrEmpty(title)) return;
|
||||||
|
|
||||||
|
var entity = new ClaudeDo.Data.Models.SubtaskEntity
|
||||||
|
{
|
||||||
|
Id = Guid.NewGuid().ToString(),
|
||||||
|
TaskId = Task.Id,
|
||||||
|
Title = title,
|
||||||
|
Completed = false,
|
||||||
|
OrderNum = Subtasks.Count,
|
||||||
|
CreatedAt = DateTime.UtcNow,
|
||||||
|
};
|
||||||
|
|
||||||
|
await using var ctx = _dbFactory.CreateDbContext();
|
||||||
|
await new SubtaskRepository(ctx).AddAsync(entity);
|
||||||
|
|
||||||
|
Subtasks.Add(new SubtaskRowViewModel { Id = entity.Id, Title = entity.Title, Done = entity.Completed });
|
||||||
|
NewSubtaskTitle = "";
|
||||||
|
}
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
private async System.Threading.Tasks.Task SaveNotesAsync()
|
private async System.Threading.Tasks.Task SaveNotesAsync()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,7 +88,57 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- ── Main body: agent strip (auto) · terminal (flex) · steps+notes (auto/capped) · agent overrides (auto) ── -->
|
<!-- ── Steps section (always visible, above the terminal) ── -->
|
||||||
|
<Border DockPanel.Dock="Top"
|
||||||
|
Padding="18,10,18,10"
|
||||||
|
BorderBrush="{DynamicResource LineBrush}"
|
||||||
|
BorderThickness="0,0,0,1">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<TextBlock Classes="section-label" Text="STEPS" Margin="0,0,0,2"/>
|
||||||
|
<TextBox Text="{Binding NewSubtaskTitle, Mode=TwoWay}"
|
||||||
|
PlaceholderText="Add a step..."
|
||||||
|
Padding="8"
|
||||||
|
Background="{DynamicResource Surface2Brush}"
|
||||||
|
BorderBrush="{DynamicResource LineBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="6">
|
||||||
|
<TextBox.KeyBindings>
|
||||||
|
<KeyBinding Gesture="Enter" Command="{Binding AddSubtaskCommand}"/>
|
||||||
|
</TextBox.KeyBindings>
|
||||||
|
</TextBox>
|
||||||
|
<ScrollViewer MaxHeight="180"
|
||||||
|
VerticalScrollBarVisibility="Auto"
|
||||||
|
IsVisible="{Binding Subtasks.Count}">
|
||||||
|
<ItemsControl ItemsSource="{Binding Subtasks}">
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate DataType="vm:SubtaskRowViewModel">
|
||||||
|
<Border Classes="subtask-row"
|
||||||
|
Classes.done="{Binding Done}">
|
||||||
|
<Grid ColumnDefinitions="Auto,*">
|
||||||
|
<Ellipse Grid.Column="0"
|
||||||
|
Classes="task-check"
|
||||||
|
Classes.done="{Binding Done}"
|
||||||
|
Width="16" Height="16"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Cursor="Hand"
|
||||||
|
Margin="0,0,8,0"/>
|
||||||
|
<TextBlock Grid.Column="1"
|
||||||
|
Classes="subtask-title"
|
||||||
|
Text="{Binding Title}"
|
||||||
|
FontSize="13"
|
||||||
|
Foreground="{DynamicResource TextDimBrush}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
TextWrapping="Wrap"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</ScrollViewer>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- ── Main body: agent strip (auto) · terminal (flex) · notes (auto/capped) · agent overrides (auto) ── -->
|
||||||
<Grid RowDefinitions="Auto,*,Auto,Auto">
|
<Grid RowDefinitions="Auto,*,Auto,Auto">
|
||||||
|
|
||||||
<!-- Agent strip -->
|
<!-- Agent strip -->
|
||||||
@@ -97,59 +147,22 @@
|
|||||||
<!-- Session terminal — fills remaining vertical space -->
|
<!-- Session terminal — fills remaining vertical space -->
|
||||||
<islands:SessionTerminalView Grid.Row="1" MinHeight="220" Margin="0,0,0,0"/>
|
<islands:SessionTerminalView Grid.Row="1" MinHeight="220" Margin="0,0,0,0"/>
|
||||||
|
|
||||||
<!-- Steps + Notes in a capped scroller so they never squeeze the terminal -->
|
<!-- Notes in a capped scroller so it never squeezes the terminal -->
|
||||||
<ScrollViewer Grid.Row="2" MaxHeight="240"
|
<ScrollViewer Grid.Row="2" MaxHeight="180"
|
||||||
VerticalScrollBarVisibility="Auto">
|
VerticalScrollBarVisibility="Auto">
|
||||||
<StackPanel Spacing="0">
|
<StackPanel Margin="18,12,18,12">
|
||||||
|
<TextBlock Classes="section-label" Text="NOTES" Margin="0,0,0,6"/>
|
||||||
<!-- Subtasks section -->
|
<TextBox Text="{Binding Notes, Mode=TwoWay}"
|
||||||
<StackPanel Margin="18,12,18,0"
|
AcceptsReturn="True"
|
||||||
IsVisible="{Binding Subtasks.Count}">
|
TextWrapping="Wrap"
|
||||||
<TextBlock Classes="section-label" Text="STEPS"
|
MinHeight="80"
|
||||||
Margin="0,0,0,6"/>
|
Padding="12"
|
||||||
<ItemsControl ItemsSource="{Binding Subtasks}">
|
PlaceholderText="Notes..."
|
||||||
<ItemsControl.ItemTemplate>
|
Background="{DynamicResource Surface2Brush}"
|
||||||
<DataTemplate DataType="vm:SubtaskRowViewModel">
|
BorderBrush="{DynamicResource LineBrush}"
|
||||||
<Border Classes="subtask-row"
|
BorderThickness="1"
|
||||||
Classes.done="{Binding Done}">
|
CornerRadius="8"
|
||||||
<Grid ColumnDefinitions="Auto,*">
|
LostFocus="NotesLostFocus"/>
|
||||||
<Ellipse Grid.Column="0"
|
|
||||||
Classes="task-check"
|
|
||||||
Classes.done="{Binding Done}"
|
|
||||||
Width="16" Height="16"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Cursor="Hand"
|
|
||||||
Margin="0,0,8,0"/>
|
|
||||||
<TextBlock Grid.Column="1"
|
|
||||||
Classes="subtask-title"
|
|
||||||
Text="{Binding Title}"
|
|
||||||
FontSize="13"
|
|
||||||
Foreground="{DynamicResource TextDimBrush}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
TextWrapping="Wrap"/>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- Notes section -->
|
|
||||||
<StackPanel Margin="18,12,18,12">
|
|
||||||
<TextBlock Classes="section-label" Text="NOTES" Margin="0,0,0,6"/>
|
|
||||||
<TextBox Text="{Binding Notes, Mode=TwoWay}"
|
|
||||||
AcceptsReturn="True"
|
|
||||||
TextWrapping="Wrap"
|
|
||||||
MinHeight="80"
|
|
||||||
Padding="12"
|
|
||||||
PlaceholderText="Notes..."
|
|
||||||
Background="{DynamicResource Surface2Brush}"
|
|
||||||
BorderBrush="{DynamicResource LineBrush}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="8"
|
|
||||||
LostFocus="NotesLostFocus"/>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user