From 7e3ae704fe80d8426e5e025755cdc9b3dca61889 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Tue, 19 May 2026 11:50:36 +0200 Subject: [PATCH] fix(ui): default-expand diff tree; reliable row-click toggle Co-Authored-By: Claude Sonnet 4.6 --- src/ClaudeDo.Ui/ViewModels/Modals/WorktreeModalViewModel.cs | 1 + src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml | 5 +++++ src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml.cs | 5 ++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ClaudeDo.Ui/ViewModels/Modals/WorktreeModalViewModel.cs b/src/ClaudeDo.Ui/ViewModels/Modals/WorktreeModalViewModel.cs index 26661c5..3d880ad 100644 --- a/src/ClaudeDo.Ui/ViewModels/Modals/WorktreeModalViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/Modals/WorktreeModalViewModel.cs @@ -20,6 +20,7 @@ public sealed partial class WorktreeNodeViewModel : ViewModelBase public bool IsDirectory { get; init; } public string RelativePath { get; init; } = ""; public ObservableCollection Children { get; } = new(); + [ObservableProperty] private bool _isExpanded = true; } public sealed partial class WorktreeModalViewModel : ViewModelBase diff --git a/src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml b/src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml index c380a8d..d43d6cd 100644 --- a/src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml +++ b/src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml @@ -56,6 +56,11 @@ SelectedItem="{Binding SelectedNode, Mode=TwoWay}" Background="Transparent" Margin="8,0,4,8"> + + + diff --git a/src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml.cs b/src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml.cs index 37895ed..36f1f63 100644 --- a/src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml.cs +++ b/src/ClaudeDo.Ui/Views/Modals/WorktreeModalView.axaml.cs @@ -62,9 +62,8 @@ public partial class WorktreeModalView : Window if (sender is not Control c) return; if (c.DataContext is not WorktreeNodeViewModel node) return; if (!node.IsDirectory) return; - var tvi = c.FindAncestorOfType(); - if (tvi is null) return; - tvi.IsExpanded = !tvi.IsExpanded; + node.IsExpanded = !node.IsExpanded; + e.Handled = true; } private void OnTitleBarPressed(object? sender, PointerPressedEventArgs e)