refactor(ui): single scrollable DetailsIsland body with agent-settings gear flyout, remove Notes

This commit is contained in:
Mika Kuns
2026-04-22 15:16:40 +02:00
parent b0b15e474e
commit c599fdcb8c

View File

@@ -12,7 +12,6 @@
BorderThickness="0,1,0,0"
Padding="14,8">
<Grid ColumnDefinitions="Auto,*,Auto">
<!-- Delete button -->
<Button Grid.Column="0" Classes="icon-btn"
Command="{Binding DeleteTaskCommand}"
ToolTip.Tip="Delete task"
@@ -20,14 +19,12 @@
<PathIcon Data="{StaticResource Icon.Trash}" Width="14" Height="14"
Foreground="{DynamicResource BloodBrush}"/>
</Button>
<!-- Created date -->
<TextBlock Grid.Column="1"
Text="{Binding Task.CreatedAtFormatted}"
FontFamily="{DynamicResource MonoFont}" FontSize="10"
Foreground="{DynamicResource TextFaintBrush}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<!-- Close button -->
<Button Grid.Column="2" Classes="icon-btn"
Command="{Binding CloseDetailsCommand}"
ToolTip.Tip="Close"
@@ -37,30 +34,76 @@
</Grid>
</Border>
<!-- ── Header ── -->
<!-- ── Header (sticky top): eyebrow · title · gear (agent-settings flyout) ── -->
<Border DockPanel.Dock="Top" Classes="island-header">
<!-- Eyebrow row -->
<StackPanel Spacing="0">
<StackPanel Orientation="Horizontal" Spacing="6" Margin="0,0,0,4">
<Ellipse Width="5" Height="5" Fill="{DynamicResource AccentBrush}"
VerticalAlignment="Center"/>
<TextBlock Classes="eyebrow" Text="LOGBOOK" VerticalAlignment="Center"/>
<TextBlock Text="{Binding TaskIdBadge}"
FontFamily="{DynamicResource MonoFont}" FontSize="10"
Foreground="{DynamicResource TextFaintBrush}"
VerticalAlignment="Center"
Margin="8,0,0,0"/>
<Grid ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0" Spacing="0">
<StackPanel Orientation="Horizontal" Spacing="6" Margin="0,0,0,4">
<Ellipse Width="5" Height="5" Fill="{DynamicResource AccentBrush}"
VerticalAlignment="Center"/>
<TextBlock Classes="eyebrow" Text="LOGBOOK" VerticalAlignment="Center"/>
<TextBlock Text="{Binding TaskIdBadge}"
FontFamily="{DynamicResource MonoFont}" FontSize="10"
Foreground="{DynamicResource TextFaintBrush}"
VerticalAlignment="Center"
Margin="8,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding EditableTitle, Mode=TwoWay}"
FontSize="14" FontWeight="Medium"
BorderThickness="0" Background="Transparent"
Foreground="{DynamicResource TextBrush}"
Padding="0"/>
</StackPanel>
<!-- Editable title (reduced size) -->
<TextBox Text="{Binding EditableTitle, Mode=TwoWay}"
FontSize="14" FontWeight="Medium"
BorderThickness="0" Background="Transparent"
Foreground="{DynamicResource TextBrush}"
Padding="0"/>
</StackPanel>
<Button Grid.Column="1" Classes="icon-btn"
ToolTip.Tip="Agent settings"
IsEnabled="{Binding IsAgentSectionEnabled}"
VerticalAlignment="Top"
Margin="6,0,0,0">
<TextBlock Text="⚙" FontSize="14"/>
<Button.Flyout>
<Flyout Placement="BottomEdgeAlignedRight" ShowMode="Standard">
<StackPanel Width="340" Spacing="10" Margin="4">
<TextBlock Text="Agent settings (overrides)" FontWeight="SemiBold"/>
<StackPanel Spacing="2">
<TextBlock Text="Model"/>
<ComboBox ItemsSource="{Binding TaskModelOptions}"
SelectedItem="{Binding TaskModelSelection, Mode=TwoWay}"
HorizontalAlignment="Stretch"/>
<TextBlock Text="{Binding EffectiveModelHint, StringFormat='Effective if inherited: {0}'}"
Opacity="0.6" FontSize="11"/>
</StackPanel>
<StackPanel Spacing="2">
<TextBlock Text="System prompt (appended)"/>
<TextBox Text="{Binding TaskSystemPrompt, Mode=TwoWay}"
AcceptsReturn="True" TextWrapping="Wrap" MinHeight="70"
PlaceholderText="{Binding EffectiveSystemPromptHint}"/>
</StackPanel>
<StackPanel Spacing="2">
<TextBlock Text="Agent file"/>
<ComboBox ItemsSource="{Binding TaskAgentOptions}"
SelectedItem="{Binding TaskSelectedAgent, Mode=TwoWay}"
HorizontalAlignment="Stretch">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding EffectiveAgentHint, StringFormat='Effective if inherited: {0}'}"
Opacity="0.6" FontSize="11"/>
</StackPanel>
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</Grid>
</Border>
<!-- ── Task strip row: check + title display + star ── -->
<!-- ── Task strip row (sticky top): check + title + star ── -->
<Border DockPanel.Dock="Top"
Padding="18,10,18,10"
BorderBrush="{DynamicResource LineBrush}"
@@ -88,125 +131,64 @@
</Grid>
</Border>
<!-- ── 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}"
<!-- ── Scrollable body: steps, agent strip, terminal ── -->
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="0">
<!-- Steps section -->
<Border Padding="18,12,18,12"
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>
<ItemsControl ItemsSource="{Binding Subtasks}"
IsVisible="{Binding Subtasks.Count}">
<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"
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 -->
<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}"
AcceptsReturn="True"
TextWrapping="Wrap"
MinHeight="80"
Padding="12"
PlaceholderText="Notes..."
Background="{DynamicResource Surface2Brush}"
BorderBrush="{DynamicResource LineBrush}"
BorderThickness="1"
CornerRadius="8"
LostFocus="NotesLostFocus"/>
</StackPanel>
</ScrollViewer>
<!-- Agent settings overrides — own row so expanding shrinks the terminal (down to its MinHeight) instead of scrolling inside the capped section -->
<Expander Grid.Row="3"
Header="Agent settings (overrides)"
IsExpanded="False"
IsEnabled="{Binding IsAgentSectionEnabled}"
Margin="18,0,18,12">
<StackPanel Spacing="8" Margin="0,8,0,0">
<StackPanel Spacing="2">
<TextBlock Text="Model" />
<ComboBox ItemsSource="{Binding TaskModelOptions}"
SelectedItem="{Binding TaskModelSelection, Mode=TwoWay}"
MinWidth="160" HorizontalAlignment="Left" />
<TextBlock Text="{Binding EffectiveModelHint, StringFormat='Effective if inherited: {0}'}"
Opacity="0.6" FontSize="11" />
</StackPanel>
<StackPanel Spacing="2">
<TextBlock Text="System prompt (appended)" />
<TextBox Text="{Binding TaskSystemPrompt, Mode=TwoWay}"
AcceptsReturn="True" TextWrapping="Wrap" MinHeight="60"
PlaceholderText="{Binding EffectiveSystemPromptHint}" />
</StackPanel>
<StackPanel Spacing="2">
<TextBlock Text="Agent file" />
<ComboBox ItemsSource="{Binding TaskAgentOptions}"
SelectedItem="{Binding TaskSelectedAgent, Mode=TwoWay}"
MinWidth="240" HorizontalAlignment="Left">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
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>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding EffectiveAgentHint, StringFormat='Effective if inherited: {0}'}"
Opacity="0.6" FontSize="11" />
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Border>
<!-- Agent status strip -->
<islands:AgentStripView/>
<!-- Session terminal -->
<islands:SessionTerminalView MinHeight="360"/>
</StackPanel>
</ScrollViewer>
</StackPanel>
</Expander>
</Grid>
</DockPanel>
</UserControl>