feat: add p-rec-annot line-number apply preflight

This commit is contained in:
codex
2026-08-07 08:28:47 +03:00
parent 10af8c8f12
commit ed7218983b
3 changed files with 7 additions and 0 deletions
@@ -59,6 +59,7 @@ public sealed record LineNumberCandidate(string StableId, long RowId, Annotation
public sealed record ExistingLineNumberAnnotation(string StableId, string SourceStableId, string Text);
public sealed record LineNumberCommandOperation(string StableId, AnnotationOperationKind Kind, string? Text, AnnotationPoint Position, double Rotation, string Layer, string TextStyle, IReadOnlyList<string> Reasons);
public sealed record LineNumberCommandPlan(IReadOnlyList<LineNumberCommandOperation> Operations);
public sealed record LineNumberApplyPreflight(string StableId, string Text, AnnotationPoint Position, double Rotation, string Layer, string TextStyle);
public sealed record GeometrySnapshot
{
@@ -17,4 +17,9 @@ public sealed class LineNumberCommandPlanner(ILineNumberAnnotationFormatter form
}
return new(result);
}
public static IReadOnlyList<LineNumberApplyPreflight> PrepareApply(LineNumberCommandPlan plan) => plan.Operations
.Where(x => x.Kind is AnnotationOperationKind.Create or AnnotationOperationKind.Update)
.OrderBy(x => x.StableId, StringComparer.Ordinal)
.Select(x => new LineNumberApplyPreflight(x.StableId, x.Text!, x.Position, x.Rotation, x.Layer, x.TextStyle)).ToArray();
}