feat: complete legacy parity and modernize operator UI

This commit is contained in:
2026-07-22 12:34:46 +09:00
parent fc4007d676
commit 939c252d23
149 changed files with 26515 additions and 1736 deletions

View File

@@ -11,7 +11,7 @@ public sealed class LegacyInteractionMetricsBridgeTests
{
var json = LegacyBridgeProtocol.SerializeState(
CreateSnapshot(),
interactionMetrics: new LegacyInteractionMetrics(7, 9, 96, 1.5));
interactionMetrics: new LegacyInteractionMetrics(7, 9, 96, 1.5, 725));
using var document = JsonDocument.Parse(json);
var payload = document.RootElement.GetProperty("payload");
@@ -22,6 +22,7 @@ public sealed class LegacyInteractionMetricsBridgeTests
Assert.Equal("host-dip", metrics.GetProperty("coordinateSpace").GetString());
Assert.Equal(96u, metrics.GetProperty("sourceDpi").GetUInt32());
Assert.Equal(1.5d, metrics.GetProperty("hostRasterizationScale").GetDouble());
Assert.Equal(725, metrics.GetProperty("doubleClickTimeMilliseconds").GetInt32());
Assert.False(metrics.TryGetProperty("CutDragWidthDips", out _));
Assert.False(metrics.TryGetProperty("CutDragHeightDips", out _));
}
@@ -54,11 +55,13 @@ public sealed class LegacyInteractionMetricsBridgeTests
Assert.Equal(4, unknownDpi.CutDragWidthDips);
Assert.Equal(4, unknownDpi.CutDragHeightDips);
Assert.Equal(1.5d, unknownDpi.HostRasterizationScale);
Assert.Equal(500, unknownDpi.DoubleClickTimeMilliseconds);
var metrics = LegacyInteractionMetrics.FromPixelsAtDpi(0, -1, 192);
Assert.Equal(4, metrics.CutDragWidthDips);
Assert.Equal(4, metrics.CutDragHeightDips);
Assert.Equal(192u, metrics.SourceDpi);
Assert.Equal(500, metrics.DoubleClickTimeMilliseconds);
}
[Fact]
@@ -66,7 +69,7 @@ public sealed class LegacyInteractionMetricsBridgeTests
{
var json = LegacyBridgeProtocol.SerializeState(
CreateSnapshot(),
interactionMetrics: new LegacyInteractionMetrics(0, -1, 0, double.NaN));
interactionMetrics: new LegacyInteractionMetrics(0, -1, 0, double.NaN, 5_001));
using var document = JsonDocument.Parse(json);
var metrics = document.RootElement
@@ -78,6 +81,7 @@ public sealed class LegacyInteractionMetricsBridgeTests
Assert.Equal("host-dip", metrics.GetProperty("coordinateSpace").GetString());
Assert.Equal(96u, metrics.GetProperty("sourceDpi").GetUInt32());
Assert.Equal(1d, metrics.GetProperty("hostRasterizationScale").GetDouble());
Assert.Equal(500, metrics.GetProperty("doubleClickTimeMilliseconds").GetInt32());
}
[Fact]
@@ -95,6 +99,22 @@ public sealed class LegacyInteractionMetricsBridgeTests
Assert.Equal("host-dip", metrics.GetProperty("coordinateSpace").GetString());
Assert.Equal(96u, metrics.GetProperty("sourceDpi").GetUInt32());
Assert.Equal(1d, metrics.GetProperty("hostRasterizationScale").GetDouble());
Assert.Equal(500, metrics.GetProperty("doubleClickTimeMilliseconds").GetInt32());
}
[Theory]
[InlineData(1)]
[InlineData(350)]
[InlineData(5_000)]
public void FromPixelsAtDpi_PreservesValidWindowsDoubleClickTime(int milliseconds)
{
var metrics = LegacyInteractionMetrics.FromPixelsAtDpi(
4,
4,
96,
doubleClickTimeMilliseconds: milliseconds);
Assert.Equal(milliseconds, metrics.DoubleClickTimeMilliseconds);
}
private static LegacyOperatorSnapshot CreateSnapshot() => new(