Icon.GitBranch ist Line-Art und wurde per PathIcon gefuellt (nur Knoten sichtbar).
Zusaetzlich brach {Binding Task.HasBranch} bei leerer Auswahl (Task=null) und
IsVisible fiel auf den Default true zurueck — FallbackValue=False blendet die
Zeile jetzt aus, solange kein Task gebunden ist.
86 lines
3.7 KiB
XML
86 lines
3.7 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Islands"
|
|
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
|
|
xmlns:loc="using:ClaudeDo.Ui.Localization"
|
|
x:Class="ClaudeDo.Ui.Views.Islands.Detail.TaskHeaderBar"
|
|
x:DataType="vm:DetailsIslandViewModel">
|
|
|
|
<Grid ColumnDefinitions="*,Auto,Auto">
|
|
|
|
<!-- Column 0: id badge + editable title -->
|
|
<StackPanel Grid.Column="0" Spacing="0">
|
|
<TextBlock Classes="meta"
|
|
Text="{Binding TaskIdBadge}"
|
|
Margin="0,0,0,4"
|
|
Cursor="Hand"
|
|
ToolTip.Tip="{loc:Tr details.copyTaskIdTip}"
|
|
Tapped="OnTaskIdTapped"/>
|
|
<TextBox Text="{Binding EditableTitle, Mode=TwoWay}"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
FontSize="{StaticResource FontSizeTaskTitle}"
|
|
FontWeight="Medium"
|
|
Foreground="{DynamicResource TextBrush}"
|
|
TextWrapping="Wrap"
|
|
AcceptsReturn="False"
|
|
Padding="0"/>
|
|
|
|
<!-- Branch meta line: moved here from the task row's chip (A5) — the row no longer
|
|
shows the branch anywhere else. FallbackValue: with no task bound the path can't
|
|
resolve and IsVisible would fall back to its default (true). -->
|
|
<StackPanel Orientation="Horizontal" Spacing="4" Margin="0,4,0,0"
|
|
IsVisible="{Binding Task.HasBranch, FallbackValue=False}">
|
|
<!-- Icon.GitBranch is line-art: stroke-rendered, PathIcon would fill the lines away -->
|
|
<Viewbox Width="10" Height="10">
|
|
<Path Data="{StaticResource Icon.GitBranch}"
|
|
Stroke="{DynamicResource TextDimBrush}"
|
|
StrokeThickness="2.4"
|
|
StrokeLineCap="Round" StrokeJoin="Round"/>
|
|
</Viewbox>
|
|
<TextBlock Classes="meta" Text="{Binding Task.Branch}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
<!-- Column 1: trash button (not running) -->
|
|
<Button Grid.Column="1" Classes="icon-btn"
|
|
Command="{Binding DeleteTaskCommand}"
|
|
ToolTip.Tip="{loc:Tr details.deleteTaskTip}"
|
|
IsVisible="{Binding !IsRunning}"
|
|
VerticalAlignment="Top"
|
|
Margin="6,0,0,0">
|
|
<PathIcon Data="{StaticResource Icon.Trash}" Width="14" Height="14"
|
|
Foreground="{DynamicResource BloodBrush}"/>
|
|
</Button>
|
|
|
|
<!-- Column 1: skull button (running) -->
|
|
<Button Grid.Column="1" Classes="icon-btn"
|
|
Command="{Binding StopCommand}"
|
|
ToolTip.Tip="{loc:Tr details.killSessionTip}"
|
|
IsVisible="{Binding IsRunning}"
|
|
VerticalAlignment="Top"
|
|
Margin="6,0,0,0">
|
|
<PathIcon Data="{StaticResource Icon.Skull}" Width="14" Height="14"
|
|
Foreground="{DynamicResource BloodBrush}"/>
|
|
</Button>
|
|
|
|
<!-- Column 2: gear button with agent settings flyout -->
|
|
<Button Grid.Column="2" Classes="icon-btn"
|
|
ToolTip.Tip="{loc:Tr details.agentSettingsTip}"
|
|
IsEnabled="{Binding AgentSettings.IsEnabled}"
|
|
VerticalAlignment="Top"
|
|
Margin="6,0,0,0">
|
|
<PathIcon Data="{StaticResource Icon.Settings}" Width="15" Height="15"/>
|
|
<Button.Flyout>
|
|
<Flyout Placement="BottomEdgeAlignedRight" ShowMode="Standard">
|
|
<StackPanel Width="340" Spacing="10" Margin="4">
|
|
<TextBlock Text="{loc:Tr details.agentSettingsHeading}" FontWeight="SemiBold"/>
|
|
<ctl:AgentConfigEditor DataContext="{Binding AgentSettings}"/>
|
|
</StackPanel>
|
|
</Flyout>
|
|
</Button.Flyout>
|
|
</Button>
|
|
|
|
</Grid>
|
|
</UserControl>
|