feat(ui): add repo import button to Lists island
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase
|
|||||||
public Func<SettingsModalViewModel, Task>? ShowSettingsModal { get; set; }
|
public Func<SettingsModalViewModel, Task>? ShowSettingsModal { get; set; }
|
||||||
public Func<ListSettingsModalViewModel, System.Threading.Tasks.Task>? ShowListSettingsModal { get; set; }
|
public Func<ListSettingsModalViewModel, System.Threading.Tasks.Task>? ShowListSettingsModal { get; set; }
|
||||||
public Func<WorktreesOverviewModalViewModel, Task>? ShowWorktreesOverviewModal { get; set; }
|
public Func<WorktreesOverviewModalViewModel, Task>? ShowWorktreesOverviewModal { get; set; }
|
||||||
|
public Func<RepoImportModalViewModel, System.Threading.Tasks.Task>? ShowRepoImportModal { get; set; }
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
private async Task OpenSettings()
|
private async Task OpenSettings()
|
||||||
@@ -50,6 +51,16 @@ public sealed partial class ListsIslandViewModel : ViewModelBase
|
|||||||
await RefreshRowAsync(row.Id);
|
await RefreshRowAsync(row.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
private async System.Threading.Tasks.Task OpenRepoImportAsync()
|
||||||
|
{
|
||||||
|
if (ShowRepoImportModal is null || _services is null) return;
|
||||||
|
var vm = _services.GetRequiredService<RepoImportModalViewModel>();
|
||||||
|
await vm.LoadAsync();
|
||||||
|
await ShowRepoImportModal(vm);
|
||||||
|
await LoadAsync();
|
||||||
|
}
|
||||||
|
|
||||||
private bool _worktreesOverviewOpen;
|
private bool _worktreesOverviewOpen;
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
|
|||||||
@@ -168,19 +168,28 @@
|
|||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
|
||||||
<!-- + New list button -->
|
<!-- New list + import row -->
|
||||||
<Button Classes="new-list-btn" Margin="0,4,0,0"
|
<Grid ColumnDefinitions="*,Auto" Margin="0,4,0,0">
|
||||||
Command="{Binding CreateListCommand}">
|
<Button Grid.Column="0" Classes="new-list-btn"
|
||||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
Command="{Binding CreateListCommand}">
|
||||||
<PathIcon Data="{StaticResource Icon.Plus}"
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
Width="13" Height="13"
|
<PathIcon Data="{StaticResource Icon.Plus}"
|
||||||
Foreground="{DynamicResource TextMuteBrush}"
|
Width="13" Height="13"
|
||||||
VerticalAlignment="Center"/>
|
Foreground="{DynamicResource TextMuteBrush}"
|
||||||
<TextBlock Text="New list" FontSize="12"
|
VerticalAlignment="Center"/>
|
||||||
Foreground="{DynamicResource TextMuteBrush}"
|
<TextBlock Text="New list" FontSize="12"
|
||||||
VerticalAlignment="Center"/>
|
Foreground="{DynamicResource TextMuteBrush}"
|
||||||
</StackPanel>
|
VerticalAlignment="Center"/>
|
||||||
</Button>
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button Grid.Column="1" Classes="icon-btn" Margin="6,0,0,0"
|
||||||
|
Command="{Binding OpenRepoImportCommand}"
|
||||||
|
ToolTip.Tip="Add repos as lists">
|
||||||
|
<PathIcon Data="{StaticResource Icon.Folder}"
|
||||||
|
Width="14" Height="14"
|
||||||
|
Foreground="{DynamicResource TextMuteBrush}"/>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ public partial class ListsIslandView : UserControl
|
|||||||
if (top is null) window.Show();
|
if (top is null) window.Show();
|
||||||
else await window.ShowDialog(top);
|
else await window.ShowDialog(top);
|
||||||
};
|
};
|
||||||
|
vm.ShowRepoImportModal = async modal =>
|
||||||
|
{
|
||||||
|
var window = new RepoImportModalView { DataContext = modal };
|
||||||
|
modal.CloseAction = () => window.Close();
|
||||||
|
var top = TopLevel.GetTopLevel(this) as Window;
|
||||||
|
if (top is null) window.Show();
|
||||||
|
else await window.ShowDialog(top);
|
||||||
|
};
|
||||||
vm.ShowWorktreesOverviewModal = async modal =>
|
vm.ShowWorktreesOverviewModal = async modal =>
|
||||||
{
|
{
|
||||||
var top = TopLevel.GetTopLevel(this) as Window;
|
var top = TopLevel.GetTopLevel(this) as Window;
|
||||||
|
|||||||
Reference in New Issue
Block a user