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,25 +88,27 @@
|
|||||||
</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) ── -->
|
||||||
<Grid RowDefinitions="Auto,*,Auto,Auto">
|
<Border DockPanel.Dock="Top"
|
||||||
|
Padding="18,10,18,10"
|
||||||
<!-- Agent strip -->
|
BorderBrush="{DynamicResource LineBrush}"
|
||||||
<islands:AgentStripView Grid.Row="0"/>
|
BorderThickness="0,0,0,1">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
<!-- Session terminal — fills remaining vertical space -->
|
<TextBlock Classes="section-label" Text="STEPS" Margin="0,0,0,2"/>
|
||||||
<islands:SessionTerminalView Grid.Row="1" MinHeight="220" Margin="0,0,0,0"/>
|
<TextBox Text="{Binding NewSubtaskTitle, Mode=TwoWay}"
|
||||||
|
PlaceholderText="Add a step..."
|
||||||
<!-- Steps + Notes in a capped scroller so they never squeeze the terminal -->
|
Padding="8"
|
||||||
<ScrollViewer Grid.Row="2" MaxHeight="240"
|
Background="{DynamicResource Surface2Brush}"
|
||||||
VerticalScrollBarVisibility="Auto">
|
BorderBrush="{DynamicResource LineBrush}"
|
||||||
<StackPanel Spacing="0">
|
BorderThickness="1"
|
||||||
|
CornerRadius="6">
|
||||||
<!-- Subtasks section -->
|
<TextBox.KeyBindings>
|
||||||
<StackPanel Margin="18,12,18,0"
|
<KeyBinding Gesture="Enter" Command="{Binding AddSubtaskCommand}"/>
|
||||||
|
</TextBox.KeyBindings>
|
||||||
|
</TextBox>
|
||||||
|
<ScrollViewer MaxHeight="180"
|
||||||
|
VerticalScrollBarVisibility="Auto"
|
||||||
IsVisible="{Binding Subtasks.Count}">
|
IsVisible="{Binding Subtasks.Count}">
|
||||||
<TextBlock Classes="section-label" Text="STEPS"
|
|
||||||
Margin="0,0,0,6"/>
|
|
||||||
<ItemsControl ItemsSource="{Binding Subtasks}">
|
<ItemsControl ItemsSource="{Binding Subtasks}">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate DataType="vm:SubtaskRowViewModel">
|
<DataTemplate DataType="vm:SubtaskRowViewModel">
|
||||||
@@ -132,9 +134,22 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
</ScrollViewer>
|
||||||
</StackPanel>
|
</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">
|
<StackPanel Margin="18,12,18,12">
|
||||||
<TextBlock Classes="section-label" Text="NOTES" Margin="0,0,0,6"/>
|
<TextBlock Classes="section-label" Text="NOTES" Margin="0,0,0,6"/>
|
||||||
<TextBox Text="{Binding Notes, Mode=TwoWay}"
|
<TextBox Text="{Binding Notes, Mode=TwoWay}"
|
||||||
@@ -149,8 +164,6 @@
|
|||||||
CornerRadius="8"
|
CornerRadius="8"
|
||||||
LostFocus="NotesLostFocus"/>
|
LostFocus="NotesLostFocus"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
<!-- Agent settings overrides — own row so expanding shrinks the terminal (down to its MinHeight) instead of scrolling inside the capped section -->
|
<!-- Agent settings overrides — own row so expanding shrinks the terminal (down to its MinHeight) instead of scrolling inside the capped section -->
|
||||||
|
|||||||
Reference in New Issue
Block a user