fix(ui): make overview modal resizable; add diff content pane
Drop outer Border wrapper in WorktreesOverviewModalView so Avalonia edge resize handles reach the window frame. Add split pane to WorktreeModalView with file tree on left and per-file unified diff on right; wire SelectedNode via SelectedItem TwoWay binding + SelectionChanged fallback; add GetFileDiffAsync to GitService. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
x:Class="ClaudeDo.Ui.Views.Modals.WorktreeModalView"
|
||||
x:DataType="vm:WorktreeModalViewModel"
|
||||
Title="Worktree"
|
||||
Width="640" Height="720"
|
||||
Width="1100" Height="720"
|
||||
MinWidth="640" MinHeight="400"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
SystemDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
Background="Transparent"
|
||||
CanResize="False"
|
||||
CanResize="True"
|
||||
TransparencyLevelHint="AcrylicBlur">
|
||||
|
||||
<Window.KeyBindings>
|
||||
@@ -39,27 +40,51 @@
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</Border>
|
||||
|
||||
<!-- File tree -->
|
||||
<TreeView DockPanel.Dock="Top" ItemsSource="{Binding Root}"
|
||||
Background="Transparent" Margin="8,0,8,8">
|
||||
<TreeView.ItemTemplate>
|
||||
<TreeDataTemplate DataType="vm:WorktreeNodeViewModel"
|
||||
ItemsSource="{Binding Children}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock Text="{Binding Name}"
|
||||
FontFamily="{DynamicResource MonoFont}" FontSize="12"
|
||||
Foreground="{DynamicResource TextBrush}"/>
|
||||
<Border Tag="{Binding Status}" CornerRadius="3" Padding="4,0"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding Status, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<TextBlock Text="{Binding Status}"
|
||||
FontFamily="{DynamicResource MonoFont}" FontSize="10"
|
||||
<!-- Split: file tree | splitter | diff pane -->
|
||||
<Grid ColumnDefinitions="260,4,*">
|
||||
|
||||
<!-- Left: file tree -->
|
||||
<TreeView x:Name="FileTree"
|
||||
Grid.Column="0"
|
||||
ItemsSource="{Binding Root}"
|
||||
SelectedItem="{Binding SelectedNode, Mode=TwoWay}"
|
||||
Background="Transparent"
|
||||
Margin="8,0,4,8">
|
||||
<TreeView.ItemTemplate>
|
||||
<TreeDataTemplate DataType="vm:WorktreeNodeViewModel"
|
||||
ItemsSource="{Binding Children}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock Text="{Binding Name}"
|
||||
FontFamily="{DynamicResource MonoFont}" FontSize="12"
|
||||
Foreground="{DynamicResource TextBrush}"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TreeDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
<Border Tag="{Binding Status}" CornerRadius="3" Padding="4,0"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding Status, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<TextBlock Text="{Binding Status}"
|
||||
FontFamily="{DynamicResource MonoFont}" FontSize="10"
|
||||
Foreground="{DynamicResource TextBrush}"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TreeDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
|
||||
<!-- Splitter -->
|
||||
<GridSplitter Grid.Column="1" ResizeDirection="Columns" Background="{DynamicResource LineBrush}"/>
|
||||
|
||||
<!-- Right: diff content -->
|
||||
<ScrollViewer Grid.Column="2" Padding="8"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Margin="4,0,8,8">
|
||||
<SelectableTextBlock Text="{Binding SelectedFileDiff}"
|
||||
FontFamily="{DynamicResource MonoFont}"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextBrush}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</ScrollViewer>
|
||||
|
||||
</Grid>
|
||||
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
Reference in New Issue
Block a user