chore(ui): clear build warnings
- Guard Windows-only ServiceController/registry calls behind SupportedOSPlatform and OperatingSystem.IsWindows() (CA1416) - Initialize test-only ctor fields with null! (CS8618) - Migrate obsolete Avalonia APIs: Watermark -> PlaceholderText, SystemDecorations -> WindowDecorations Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,8 @@ public sealed class InstallerLocator
|
|||||||
private const string UninstallerSubdir = "uninstaller";
|
private const string UninstallerSubdir = "uninstaller";
|
||||||
|
|
||||||
public string? Find()
|
public string? Find()
|
||||||
=> FindByWalkingUp(AppContext.BaseDirectory) ?? FindByRegistry();
|
=> FindByWalkingUp(AppContext.BaseDirectory)
|
||||||
|
?? (OperatingSystem.IsWindows() ? FindByRegistry() : null);
|
||||||
|
|
||||||
public string? FindByWalkingUp(string startDir)
|
public string? FindByWalkingUp(string startDir)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
|||||||
|
|
||||||
public bool IsOffline => Worker?.IsConnected != true && Worker?.IsReconnecting != true;
|
public bool IsOffline => Worker?.IsConnected != true && Worker?.IsReconnecting != true;
|
||||||
|
|
||||||
private readonly UpdateCheckService _updateCheck;
|
private readonly UpdateCheckService _updateCheck = null!;
|
||||||
private readonly InstallerLocator _installerLocator;
|
private readonly InstallerLocator _installerLocator = null!;
|
||||||
private readonly IDbContextFactory<ClaudeDoDbContext>? _dbFactory;
|
private readonly IDbContextFactory<ClaudeDoDbContext>? _dbFactory;
|
||||||
private readonly Func<WorktreesOverviewModalViewModel> _worktreesOverviewVmFactory = () => null!;
|
private readonly Func<WorktreesOverviewModalViewModel> _worktreesOverviewVmFactory = () => null!;
|
||||||
private readonly Func<MergeModalViewModel> _mergeVmFactory = () => null!;
|
private readonly Func<MergeModalViewModel> _mergeVmFactory = () => null!;
|
||||||
@@ -297,17 +297,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
|||||||
RestartWorkerStatus = "Restarting worker…";
|
RestartWorkerStatus = "Restarting worker…";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await Task.Run(() =>
|
await Task.Run(RestartWorkerService);
|
||||||
{
|
|
||||||
using var sc = new System.ServiceProcess.ServiceController("ClaudeDoWorker");
|
|
||||||
if (sc.Status != System.ServiceProcess.ServiceControllerStatus.Stopped)
|
|
||||||
{
|
|
||||||
sc.Stop();
|
|
||||||
sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(20));
|
|
||||||
}
|
|
||||||
sc.Start();
|
|
||||||
sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Running, TimeSpan.FromSeconds(20));
|
|
||||||
});
|
|
||||||
await FlashRestartStatusAsync("Worker restarted.");
|
await FlashRestartStatusAsync("Worker restarted.");
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException)
|
catch (InvalidOperationException)
|
||||||
@@ -321,6 +311,19 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||||
|
private static void RestartWorkerService()
|
||||||
|
{
|
||||||
|
using var sc = new System.ServiceProcess.ServiceController("ClaudeDoWorker");
|
||||||
|
if (sc.Status != System.ServiceProcess.ServiceControllerStatus.Stopped)
|
||||||
|
{
|
||||||
|
sc.Stop();
|
||||||
|
sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(20));
|
||||||
|
}
|
||||||
|
sc.Start();
|
||||||
|
sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Running, TimeSpan.FromSeconds(20));
|
||||||
|
}
|
||||||
|
|
||||||
private async Task FlashRestartStatusAsync(string text)
|
private async Task FlashRestartStatusAsync(string text)
|
||||||
{
|
{
|
||||||
RestartWorkerStatus = text;
|
RestartWorkerStatus = text;
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
Foreground="{DynamicResource TextDimBrush}"
|
Foreground="{DynamicResource TextDimBrush}"
|
||||||
Margin="0,0,8,0"/>
|
Margin="0,0,8,0"/>
|
||||||
<TextBox Grid.Column="1" x:Name="TimeInput"
|
<TextBox Grid.Column="1" x:Name="TimeInput"
|
||||||
Watermark="HH:mm" MaxLength="5"
|
PlaceholderText="HH:mm" MaxLength="5"
|
||||||
Text="{Binding #Root.TimeText, Mode=TwoWay}"/>
|
Text="{Binding #Root.TimeText, Mode=TwoWay}"/>
|
||||||
<Button Grid.Column="2" Content="Done"
|
<Button Grid.Column="2" Content="Done"
|
||||||
Click="OnDoneClick"
|
Click="OnDoneClick"
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||||
</Border>
|
</Border>
|
||||||
<TextBox Grid.Column="1" x:Name="AddTaskBox" Classes="add-task-input"
|
<TextBox Grid.Column="1" x:Name="AddTaskBox" Classes="add-task-input"
|
||||||
Watermark="Add a task…"
|
PlaceholderText="Add a task…"
|
||||||
Text="{Binding NewTaskTitle, Mode=TwoWay}"
|
Text="{Binding NewTaskTitle, Mode=TwoWay}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="12,0,0,0">
|
Margin="12,0,0,0">
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
Background="{DynamicResource VoidBrush}"
|
Background="{DynamicResource VoidBrush}"
|
||||||
Icon="avares://ClaudeDo.Ui/Assets/ClaudeTask.ico"
|
Icon="avares://ClaudeDo.Ui/Assets/ClaudeTask.ico"
|
||||||
CanResize="True"
|
CanResize="True"
|
||||||
SystemDecorations="BorderOnly"
|
WindowDecorations="BorderOnly"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
ExtendClientAreaTitleBarHeightHint="-1">
|
ExtendClientAreaTitleBarHeightHint="-1">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
x:DataType="vm:DiffModalViewModel"
|
x:DataType="vm:DiffModalViewModel"
|
||||||
Title="Diff"
|
Title="Diff"
|
||||||
Width="1200" Height="800"
|
Width="1200" Height="800"
|
||||||
SystemDecorations="None"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{StaticResource SurfaceBrush}">
|
Background="{StaticResource SurfaceBrush}">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
Width="520" Height="720"
|
Width="520" Height="720"
|
||||||
CanResize="True"
|
CanResize="True"
|
||||||
MinWidth="460" MinHeight="520"
|
MinWidth="460" MinHeight="520"
|
||||||
SystemDecorations="None"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{DynamicResource SurfaceBrush}">
|
Background="{DynamicResource SurfaceBrush}">
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<StackPanel Spacing="4">
|
<StackPanel Spacing="4">
|
||||||
<TextBlock Classes="field-label" Text="Working directory"/>
|
<TextBlock Classes="field-label" Text="Working directory"/>
|
||||||
<Grid ColumnDefinitions="*,Auto">
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
<TextBox Grid.Column="0" Text="{Binding WorkingDir}" Watermark="(none)" />
|
<TextBox Grid.Column="0" Text="{Binding WorkingDir}" PlaceholderText="(none)" />
|
||||||
<Button Grid.Column="1" Content="Browse..." Margin="8,0,0,0" Click="BrowseClicked" />
|
<Button Grid.Column="1" Content="Browse..." Margin="8,0,0,0" Click="BrowseClicked" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
Title="Merge worktree"
|
Title="Merge worktree"
|
||||||
Width="560" Height="460"
|
Width="560" Height="460"
|
||||||
CanResize="False"
|
CanResize="False"
|
||||||
SystemDecorations="None"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{DynamicResource SurfaceBrush}">
|
Background="{DynamicResource SurfaceBrush}">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
x:DataType="vm:SettingsModalViewModel"
|
x:DataType="vm:SettingsModalViewModel"
|
||||||
Title="Settings"
|
Title="Settings"
|
||||||
Width="580" Height="760"
|
Width="580" Height="760"
|
||||||
SystemDecorations="None"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{DynamicResource SurfaceBrush}">
|
Background="{DynamicResource SurfaceBrush}">
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<StackPanel Spacing="4">
|
<StackPanel Spacing="4">
|
||||||
<TextBlock Classes="field-label" Text="Default instructions"/>
|
<TextBlock Classes="field-label" Text="Default instructions"/>
|
||||||
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Height="110"
|
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Height="110"
|
||||||
Watermark="Baseline instructions applied to every task"
|
PlaceholderText="Baseline instructions applied to every task"
|
||||||
Text="{Binding General.DefaultClaudeInstructions, Mode=TwoWay}"/>
|
Text="{Binding General.DefaultClaudeInstructions, Mode=TwoWay}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Grid ColumnDefinitions="*,12,*,12,*">
|
<Grid ColumnDefinitions="*,12,*,12,*">
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
<StackPanel Grid.Column="2" Spacing="4">
|
<StackPanel Grid.Column="2" Spacing="4">
|
||||||
<TextBlock Classes="field-label" Text="Central worktree root"/>
|
<TextBlock Classes="field-label" Text="Central worktree root"/>
|
||||||
<TextBox Text="{Binding Worktrees.CentralWorktreeRoot, Mode=TwoWay}"
|
<TextBox Text="{Binding Worktrees.CentralWorktreeRoot, Mode=TwoWay}"
|
||||||
Watermark="e.g. C:\worktrees"/>
|
PlaceholderText="e.g. C:\worktrees"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
Title="Unfinished planning session"
|
Title="Unfinished planning session"
|
||||||
Width="440" Height="200"
|
Width="440" Height="200"
|
||||||
CanResize="False"
|
CanResize="False"
|
||||||
SystemDecorations="None"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{DynamicResource SurfaceBrush}">
|
Background="{DynamicResource SurfaceBrush}">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
Width="1100" Height="720"
|
Width="1100" Height="720"
|
||||||
MinWidth="640" MinHeight="400"
|
MinWidth="640" MinHeight="400"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
SystemDecorations="BorderOnly"
|
WindowDecorations="BorderOnly"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
ExtendClientAreaTitleBarHeightHint="-1"
|
ExtendClientAreaTitleBarHeightHint="-1"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
CanResize="True"
|
CanResize="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{DynamicResource SurfaceBrush}"
|
Background="{DynamicResource SurfaceBrush}"
|
||||||
SystemDecorations="BorderOnly"
|
WindowDecorations="BorderOnly"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
ExtendClientAreaTitleBarHeightHint="-1">
|
ExtendClientAreaTitleBarHeightHint="-1">
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
x:Class="ClaudeDo.Ui.Views.Planning.ConflictResolutionView"
|
x:Class="ClaudeDo.Ui.Views.Planning.ConflictResolutionView"
|
||||||
Title="Merge conflict"
|
Title="Merge conflict"
|
||||||
Width="560" SizeToContent="Height"
|
Width="560" SizeToContent="Height"
|
||||||
SystemDecorations="None"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{StaticResource SurfaceBrush}">
|
Background="{StaticResource SurfaceBrush}">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
x:DataType="vm:PlanningDiffViewModel"
|
x:DataType="vm:PlanningDiffViewModel"
|
||||||
Title="Planning — Combined diff"
|
Title="Planning — Combined diff"
|
||||||
Width="1100" Height="700"
|
Width="1100" Height="700"
|
||||||
SystemDecorations="None"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{StaticResource SurfaceBrush}">
|
Background="{StaticResource SurfaceBrush}">
|
||||||
|
|||||||
Reference in New Issue
Block a user