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,25 +88,27 @@
</Grid>
</Border>
<!-- ── Main body: agent strip (auto) · terminal (flex) · steps+notes (auto/capped) · agent overrides (auto) ── -->
<Grid RowDefinitions="Auto,*,Auto,Auto">
<!-- Agent strip -->
<islands:AgentStripView Grid.Row="0"/>
<!-- 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"
VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="0">
<!-- Subtasks section -->
<StackPanel Margin="18,12,18,0"
<!-- ── 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}">
<TextBlock Classes="section-label" Text="STEPS"
Margin="0,0,0,6"/>
<ItemsControl ItemsSource="{Binding Subtasks}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:SubtaskRowViewModel">
@@ -132,9 +134,22 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</StackPanel>
</Border>
<!-- Notes section -->
<!-- ── Main body: agent strip (auto) · terminal (flex) · notes (auto/capped) · agent overrides (auto) ── -->
<Grid RowDefinitions="Auto,*,Auto,Auto">
<!-- Agent strip -->
<islands:AgentStripView Grid.Row="0"/>
<!-- Session terminal — fills remaining vertical space -->
<islands:SessionTerminalView Grid.Row="1" MinHeight="220" Margin="0,0,0,0"/>
<!-- Notes in a capped scroller so it never squeezes the terminal -->
<ScrollViewer Grid.Row="2" MaxHeight="180"
VerticalScrollBarVisibility="Auto">
<StackPanel Margin="18,12,18,12">
<TextBlock Classes="section-label" Text="NOTES" Margin="0,0,0,6"/>
<TextBox Text="{Binding Notes, Mode=TwoWay}"
@@ -149,8 +164,6 @@
CornerRadius="8"
LostFocus="NotesLostFocus"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
<!-- Agent settings overrides — own row so expanding shrinks the terminal (down to its MinHeight) instead of scrolling inside the capped section -->