feat(ui): diff modal with file sidebar and tinted hunks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-04-20 10:30:03 +02:00
parent f94bb35db7
commit 4d68543cf2
8 changed files with 455 additions and 5 deletions

View File

@@ -29,8 +29,8 @@
IsVisible="{Binding BranchLine, Converter={x:Static ObjectConverters.IsNotNull}}"/>
<!-- Button row -->
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,6,0,0">
<Button Classes="icon-btn" Content="Open diff"/>
<Button Classes="icon-btn" Content="Worktree"/>
<Button Classes="icon-btn" Content="Open diff" Command="{Binding OpenDiffCommand}"/>
<Button Classes="icon-btn" Content="Worktree" Command="{Binding OpenWorktreeCommand}"/>
<Button Classes="icon-btn" Content="Stop" Command="{Binding StopCommand}"/>
<Button Classes="icon-btn" Content="Approve &amp; merge" Command="{Binding ApproveMergeCommand}"/>
</StackPanel>

View File

@@ -1,8 +1,38 @@
using Avalonia.Controls;
using ClaudeDo.Ui.ViewModels.Islands;
using ClaudeDo.Ui.ViewModels.Modals;
using ClaudeDo.Ui.Views.Modals;
namespace ClaudeDo.Ui.Views.Islands;
public partial class AgentStripView : UserControl
{
public AgentStripView() { InitializeComponent(); }
public AgentStripView()
{
InitializeComponent();
DataContextChanged += OnDataContextChanged;
}
private void OnDataContextChanged(object? sender, EventArgs e)
{
if (DataContext is DetailsIslandViewModel vm)
{
vm.ShowDiffModal = async (diffVm) =>
{
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner == null) return;
var modal = new DiffModalView { DataContext = diffVm };
await modal.ShowDialog(owner);
};
vm.ShowWorktreeModal = async (worktreeVm) =>
{
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner == null) return;
var modal = new WorktreeModalView { DataContext = worktreeVm };
worktreeVm.CloseCommand.Subscribe(_ => modal.Close());
await modal.ShowDialog(owner);
};
}
}
}