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";
|
||||
|
||||
public string? Find()
|
||||
=> FindByWalkingUp(AppContext.BaseDirectory) ?? FindByRegistry();
|
||||
=> FindByWalkingUp(AppContext.BaseDirectory)
|
||||
?? (OperatingSystem.IsWindows() ? FindByRegistry() : null);
|
||||
|
||||
public string? FindByWalkingUp(string startDir)
|
||||
{
|
||||
|
||||
@@ -29,8 +29,8 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
|
||||
public bool IsOffline => Worker?.IsConnected != true && Worker?.IsReconnecting != true;
|
||||
|
||||
private readonly UpdateCheckService _updateCheck;
|
||||
private readonly InstallerLocator _installerLocator;
|
||||
private readonly UpdateCheckService _updateCheck = null!;
|
||||
private readonly InstallerLocator _installerLocator = null!;
|
||||
private readonly IDbContextFactory<ClaudeDoDbContext>? _dbFactory;
|
||||
private readonly Func<WorktreesOverviewModalViewModel> _worktreesOverviewVmFactory = () => null!;
|
||||
private readonly Func<MergeModalViewModel> _mergeVmFactory = () => null!;
|
||||
@@ -297,17 +297,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
RestartWorkerStatus = "Restarting worker…";
|
||||
try
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
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 Task.Run(RestartWorkerService);
|
||||
await FlashRestartStatusAsync("Worker restarted.");
|
||||
}
|
||||
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)
|
||||
{
|
||||
RestartWorkerStatus = text;
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
Foreground="{DynamicResource TextDimBrush}"
|
||||
Margin="0,0,8,0"/>
|
||||
<TextBox Grid.Column="1" x:Name="TimeInput"
|
||||
Watermark="HH:mm" MaxLength="5"
|
||||
PlaceholderText="HH:mm" MaxLength="5"
|
||||
Text="{Binding #Root.TimeText, Mode=TwoWay}"/>
|
||||
<Button Grid.Column="2" Content="Done"
|
||||
Click="OnDoneClick"
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||
</Border>
|
||||
<TextBox Grid.Column="1" x:Name="AddTaskBox" Classes="add-task-input"
|
||||
Watermark="Add a task…"
|
||||
PlaceholderText="Add a task…"
|
||||
Text="{Binding NewTaskTitle, Mode=TwoWay}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12,0,0,0">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
Background="{DynamicResource VoidBrush}"
|
||||
Icon="avares://ClaudeDo.Ui/Assets/ClaudeTask.ico"
|
||||
CanResize="True"
|
||||
SystemDecorations="BorderOnly"
|
||||
WindowDecorations="BorderOnly"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
ExtendClientAreaTitleBarHeightHint="-1">
|
||||
<Window.Resources>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
x:DataType="vm:DiffModalViewModel"
|
||||
Title="Diff"
|
||||
Width="1200" Height="800"
|
||||
SystemDecorations="None"
|
||||
WindowDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{StaticResource SurfaceBrush}">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Width="520" Height="720"
|
||||
CanResize="True"
|
||||
MinWidth="460" MinHeight="520"
|
||||
SystemDecorations="None"
|
||||
WindowDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource SurfaceBrush}">
|
||||
@@ -89,7 +89,7 @@
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="Working directory"/>
|
||||
<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" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Title="Merge worktree"
|
||||
Width="560" Height="460"
|
||||
CanResize="False"
|
||||
SystemDecorations="None"
|
||||
WindowDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource SurfaceBrush}">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
x:DataType="vm:SettingsModalViewModel"
|
||||
Title="Settings"
|
||||
Width="580" Height="760"
|
||||
SystemDecorations="None"
|
||||
WindowDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource SurfaceBrush}">
|
||||
@@ -94,7 +94,7 @@
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="Default instructions"/>
|
||||
<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}"/>
|
||||
</StackPanel>
|
||||
<Grid ColumnDefinitions="*,12,*,12,*">
|
||||
@@ -133,7 +133,7 @@
|
||||
<StackPanel Grid.Column="2" Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="Central worktree root"/>
|
||||
<TextBox Text="{Binding Worktrees.CentralWorktreeRoot, Mode=TwoWay}"
|
||||
Watermark="e.g. C:\worktrees"/>
|
||||
PlaceholderText="e.g. C:\worktrees"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Title="Unfinished planning session"
|
||||
Width="440" Height="200"
|
||||
CanResize="False"
|
||||
SystemDecorations="None"
|
||||
WindowDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource SurfaceBrush}">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
Width="1100" Height="720"
|
||||
MinWidth="640" MinHeight="400"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
SystemDecorations="BorderOnly"
|
||||
WindowDecorations="BorderOnly"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
ExtendClientAreaTitleBarHeightHint="-1"
|
||||
Background="Transparent"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
CanResize="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource SurfaceBrush}"
|
||||
SystemDecorations="BorderOnly"
|
||||
WindowDecorations="BorderOnly"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
ExtendClientAreaTitleBarHeightHint="-1">
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
x:Class="ClaudeDo.Ui.Views.Planning.ConflictResolutionView"
|
||||
Title="Merge conflict"
|
||||
Width="560" SizeToContent="Height"
|
||||
SystemDecorations="None"
|
||||
WindowDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{StaticResource SurfaceBrush}">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
x:DataType="vm:PlanningDiffViewModel"
|
||||
Title="Planning — Combined diff"
|
||||
Width="1100" Height="700"
|
||||
SystemDecorations="None"
|
||||
WindowDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{StaticResource SurfaceBrush}">
|
||||
|
||||
Reference in New Issue
Block a user