feat(ui): always-visible Steps section at top of DetailsIsland with add-step input

This commit is contained in:
Mika Kuns
2026-04-22 15:08:07 +02:00
parent 839f862b7d
commit b0b15e474e
2 changed files with 92 additions and 53 deletions

View File

@@ -110,6 +110,8 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
public ObservableCollection<LogLineViewModel> Log { get; } = new();
public ObservableCollection<SubtaskRowViewModel> Subtasks { get; } = new();
[ObservableProperty] private string _newSubtaskTitle = "";
// Claude CLI stream-json parser + buffer for partial text deltas
private readonly StreamLineFormatter _formatter = new();
private readonly StringBuilder _claudeBuf = new();
@@ -487,6 +489,30 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
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]
private async System.Threading.Tasks.Task SaveNotesAsync()
{

View File

@@ -88,7 +88,57 @@
</Grid>
</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">
<!-- Agent strip -->
@@ -97,59 +147,22 @@
<!-- Session terminal — fills remaining vertical space -->
<islands:SessionTerminalView Grid.Row="1" MinHeight="220" Margin="0,0,0,0"/>
<!-- Steps + Notes in a capped scroller so they never squeeze the terminal -->
<ScrollViewer Grid.Row="2" MaxHeight="240"
<!-- Notes in a capped scroller so it never squeezes the terminal -->
<ScrollViewer Grid.Row="2" MaxHeight="180"
VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="0">
<!-- Subtasks section -->
<StackPanel Margin="18,12,18,0"
IsVisible="{Binding Subtasks.Count}">
<TextBlock Classes="section-label" Text="STEPS"
Margin="0,0,0,6"/>
<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>
</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 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>
</ScrollViewer>