164 lines
9.9 KiB
XML
164 lines
9.9 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:ClaudeDo.Ui.ViewModels"
|
|
xmlns:conv="using:ClaudeDo.Ui.Converters"
|
|
xmlns:m="using:ClaudeDo.Data.Models"
|
|
x:Class="ClaudeDo.Ui.Views.TaskDetailView"
|
|
x:DataType="vm:TaskDetailViewModel">
|
|
<ScrollViewer>
|
|
<StackPanel Margin="12" Spacing="8"
|
|
IsVisible="{Binding Title, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
|
|
|
|
<!-- Title (large, editable) -->
|
|
<TextBox x:Name="TitleBox"
|
|
Text="{Binding Title}"
|
|
FontWeight="Bold" FontSize="16"
|
|
Foreground="{StaticResource TextPrimaryBrush}"
|
|
BorderThickness="0" Background="Transparent"
|
|
Padding="0,4"
|
|
LostFocus="OnFieldLostFocus"/>
|
|
|
|
<!-- Status + Commit Type row -->
|
|
<Grid ColumnDefinitions="*,16,*" Margin="0,4,0,0">
|
|
<StackPanel Grid.Column="0" Spacing="4">
|
|
<TextBlock Text="Status" FontSize="12" FontWeight="SemiBold"
|
|
Foreground="{StaticResource TextSecondaryBrush}"/>
|
|
<ComboBox ItemsSource="{Binding StatusChoices}"
|
|
SelectedItem="{Binding StatusChoice}"
|
|
MinWidth="100"
|
|
LostFocus="OnFieldLostFocus"/>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="2" Spacing="4">
|
|
<TextBlock Text="Commit Type" FontSize="12" FontWeight="SemiBold"
|
|
Foreground="{StaticResource TextSecondaryBrush}"/>
|
|
<ComboBox ItemsSource="{Binding CommitTypes}"
|
|
SelectedItem="{Binding CommitType}"
|
|
MinWidth="100"
|
|
LostFocus="OnFieldLostFocus"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<!-- Tags -->
|
|
<StackPanel Spacing="4" Margin="0,8,0,0">
|
|
<TextBlock Text="Tags" FontSize="12" FontWeight="SemiBold"
|
|
Foreground="{StaticResource TextSecondaryBrush}"/>
|
|
<WrapPanel Orientation="Horizontal">
|
|
<ItemsControl ItemsSource="{Binding Tags}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal"/>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="m:TagEntity">
|
|
<Border CornerRadius="10" Padding="8,3" Margin="0,0,4,4"
|
|
Background="{StaticResource AccentSubtleBrush}">
|
|
<StackPanel Orientation="Horizontal" Spacing="4">
|
|
<TextBlock Text="{Binding Name}" FontSize="12"
|
|
Foreground="{StaticResource AccentLightBrush}"
|
|
VerticalAlignment="Center"/>
|
|
<Button Content="x" FontSize="10" Padding="2,0"
|
|
Background="Transparent" BorderThickness="0"
|
|
Foreground="{StaticResource TextMutedBrush}"
|
|
Cursor="Hand"
|
|
Command="{Binding $parent[UserControl].((vm:TaskDetailViewModel)DataContext).RemoveTagCommand}"
|
|
CommandParameter="{Binding}"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
<TextBox Text="{Binding NewTagInput}"
|
|
PlaceholderText="Add tag..."
|
|
Width="100" FontSize="12"
|
|
BorderThickness="0" Background="Transparent"
|
|
Padding="4,3"
|
|
KeyDown="OnTagInputKeyDown"/>
|
|
</WrapPanel>
|
|
</StackPanel>
|
|
|
|
<!-- Description (editable) -->
|
|
<TextBlock Text="Description" FontSize="12" FontWeight="SemiBold"
|
|
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,8,0,2"/>
|
|
<TextBox Text="{Binding Description}"
|
|
AcceptsReturn="True" TextWrapping="Wrap" MinHeight="60"
|
|
Foreground="{StaticResource TextPrimaryBrush}"
|
|
PlaceholderText="Add a description..."
|
|
LostFocus="OnFieldLostFocus"/>
|
|
|
|
<!-- === READ-ONLY ZONE === -->
|
|
|
|
<TextBlock Text="Result" FontWeight="SemiBold" FontSize="12"
|
|
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,12,0,2"/>
|
|
<TextBox Text="{Binding Result, Mode=OneWay}" IsReadOnly="True"
|
|
AcceptsReturn="True" TextWrapping="Wrap" MinHeight="60"
|
|
IsVisible="{Binding Result, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
|
<TextBlock Text="(no result yet)" Foreground="{StaticResource TextMutedBrush}" FontStyle="Italic"
|
|
IsVisible="{Binding Result, Converter={x:Static StringConverters.IsNullOrEmpty}}"/>
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="4"
|
|
IsVisible="{Binding LogPath, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
|
|
<TextBlock Text="Log:" FontWeight="SemiBold" FontSize="12"
|
|
Foreground="{StaticResource TextSecondaryBrush}" VerticalAlignment="Center"/>
|
|
<TextBlock Text="{Binding LogPath}" FontSize="11"
|
|
Foreground="{StaticResource TextDimBrush}" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
<TextBlock Text="Live Output" FontWeight="SemiBold" FontSize="12"
|
|
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,8,0,2"/>
|
|
<Border BorderBrush="{StaticResource BorderSubtleBrush}" BorderThickness="1"
|
|
CornerRadius="6" Padding="6" MaxHeight="300">
|
|
<ScrollViewer x:Name="LiveOutputScroll">
|
|
<TextBox x:Name="LiveOutputBox"
|
|
Text="{Binding LiveText, Mode=OneWay}"
|
|
IsReadOnly="True"
|
|
AcceptsReturn="True"
|
|
TextWrapping="NoWrap"
|
|
FontFamily="Consolas,Courier New,monospace"
|
|
FontSize="11"
|
|
Foreground="{StaticResource TextPrimaryBrush}"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
Padding="0"/>
|
|
</ScrollViewer>
|
|
</Border>
|
|
|
|
<Border IsVisible="{Binding HasWorktree}" BorderBrush="{StaticResource AccentBrush}"
|
|
BorderThickness="1" CornerRadius="8" Padding="10" Margin="0,8,0,0">
|
|
<StackPanel Spacing="6">
|
|
<TextBlock Text="Worktree" FontWeight="Bold" FontSize="14"
|
|
Foreground="{StaticResource TextPrimaryBrush}"/>
|
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
<TextBlock Text="Branch:" FontWeight="SemiBold"
|
|
Foreground="{StaticResource TextSecondaryBrush}"/>
|
|
<TextBlock Text="{Binding BranchName}" FontFamily="Consolas,Courier New,monospace"
|
|
Foreground="{StaticResource TextPrimaryBrush}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
<TextBlock Text="State:" FontWeight="SemiBold"
|
|
Foreground="{StaticResource TextSecondaryBrush}"/>
|
|
<TextBlock Text="{Binding WorktreeState}"
|
|
Foreground="{StaticResource TextPrimaryBrush}"/>
|
|
</StackPanel>
|
|
<TextBlock Text="Diff Stat:" FontWeight="SemiBold"
|
|
Foreground="{StaticResource TextSecondaryBrush}"
|
|
IsVisible="{Binding DiffStat, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
|
<TextBox Text="{Binding DiffStat, Mode=OneWay}" IsReadOnly="True"
|
|
AcceptsReturn="True" FontFamily="Consolas,Courier New,monospace" FontSize="11"
|
|
IsVisible="{Binding DiffStat, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
|
<WrapPanel Orientation="Horizontal" Margin="0,4,0,0">
|
|
<Button Content="Open Worktree" Command="{Binding OpenWorktreeCommand}" Margin="0,0,4,4"/>
|
|
<Button Content="Show Diff" Command="{Binding ShowDiffCommand}" Margin="0,0,4,4"/>
|
|
<Button Content="Merge into main" Command="{Binding MergeIntoMainCommand}"
|
|
IsEnabled="{Binding CanWorktreeAction}" Margin="0,0,4,4"/>
|
|
<Button Content="Keep as branch" Command="{Binding KeepAsBranchCommand}"
|
|
IsEnabled="{Binding CanWorktreeAction}" Margin="0,0,4,4"/>
|
|
<Button Content="Discard" Command="{Binding DiscardCommand}"
|
|
IsEnabled="{Binding CanWorktreeAction}" Margin="0,0,4,4"/>
|
|
</WrapPanel>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</UserControl>
|