diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index db877b5c0..5bcdfc4ff 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -6627,7 +6627,6 @@ static void RequireInventoryDropdownUseEveSurface(string root) "public readonly struct AetheriaRuntimeInventoryDropdownCommand", "public static class AetheriaRuntimeInventoryDropdownSurfaceCommands", "public static bool TryRead(", - "AetheriaRuntimeInventoryDropdownSurfaceState", "AetheriaRuntimeInventoryDropdownGroup", "AetheriaRuntimeInventoryDropdownOption", "AetheriaRuntimeInventoryDropdownEntityOption", @@ -6644,7 +6643,7 @@ static void RequireInventoryDropdownUseEveSurface(string root) "public static string EntityBayCommand(", "public static string EntityCommand(", "public static string LoadoutCommand(", - "public static AetheriaRuntimeSurfaceDocument Build(", + "private static AetheriaRuntimeSurfaceDocument Build(", "providerKind: \"inventory.panel\"", "The observing client lists available inventory navigation; the shared runtime surface owns the dropdown contract." }; @@ -6658,11 +6657,13 @@ static void RequireInventoryDropdownUseEveSurface(string root) string.Join(", ", missingBuilderSymbols)); } - if (inventoryDropdownSurfaceBuilder.Contains("public AetheriaRuntimeInventoryDropdownSurfaceState State { get; }", StringComparison.Ordinal) || + if (inventoryDropdownSurfaceBuilder.Contains("AetheriaRuntimeInventoryDropdownSurfaceState", StringComparison.Ordinal) || + inventoryDropdownSurfaceBuilder.Contains("public AetheriaRuntimeInventoryDropdownSurfaceState State { get; }", StringComparison.Ordinal) || + inventoryDropdownSurfaceBuilder.Contains("public static AetheriaRuntimeSurfaceDocument Build(", StringComparison.Ordinal) || inventoryDropdownSurfaceBuilder.Contains("public static AetheriaRuntimeInventoryDropdownSurfaceModel Compose(", StringComparison.Ordinal)) { throw new InvalidOperationException( - "Shared runtime inventory dropdown builder must return a model with a finished surface document; do not re-expose Compose or a public State handoff."); + "Shared runtime inventory dropdown builder must return a model with a finished surface document; do not rebuild a shadow SurfaceState projection layer."); } } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeInventoryDropdownSurfaceBuilder.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeInventoryDropdownSurfaceBuilder.cs index e7967dfb1..18ac9bc7b 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeInventoryDropdownSurfaceBuilder.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeInventoryDropdownSurfaceBuilder.cs @@ -37,23 +37,6 @@ namespace GameCult.Aetheria.State.Verse public IReadOnlyList Options { get; } } - public sealed class AetheriaRuntimeInventoryDropdownSurfaceState - { - public AetheriaRuntimeInventoryDropdownSurfaceState( - string currentView, - IReadOnlyList groups, - string updatedAtUtc) - { - CurrentView = currentView ?? ""; - Groups = groups ?? Array.Empty(); - UpdatedAtUtc = updatedAtUtc ?? ""; - } - - public string CurrentView { get; } - public IReadOnlyList Groups { get; } - public string UpdatedAtUtc { get; } - } - public sealed class AetheriaRuntimeInventoryDropdownEntityOption { public AetheriaRuntimeInventoryDropdownEntityOption( @@ -154,11 +137,7 @@ namespace GameCult.Aetheria.State.Verse AetheriaRuntimeSurfaceDocument document, IReadOnlyDictionary selections) { - Document = document ?? AetheriaRuntimeInventoryDropdownSurfaceBuilder.Build( - new AetheriaRuntimeInventoryDropdownSurfaceState( - "", - Array.Empty(), - "")); + Document = document ?? throw new ArgumentNullException(nameof(document)); Selections = selections ?? new Dictionary(StringComparer.Ordinal); } @@ -335,22 +314,18 @@ namespace GameCult.Aetheria.State.Verse loadoutOptions)); } - var state = new AetheriaRuntimeInventoryDropdownSurfaceState( - currentView, - groups, - updatedAtUtc); - - return new AetheriaRuntimeInventoryDropdownSurfaceModel(Build(state), selections); + return new AetheriaRuntimeInventoryDropdownSurfaceModel( + Build(currentView, groups, updatedAtUtc), + selections); } - public static AetheriaRuntimeSurfaceDocument Build( - AetheriaRuntimeInventoryDropdownSurfaceState state, + private static AetheriaRuntimeSurfaceDocument Build( + string currentView, + IReadOnlyList groups, + string updatedAtUtc, long version = 1) { - state ??= new AetheriaRuntimeInventoryDropdownSurfaceState( - "", - Array.Empty(), - ""); + groups ??= Array.Empty(); var children = new List { @@ -360,13 +335,13 @@ namespace GameCult.Aetheria.State.Verse Metric( $"{SurfaceId}.current", "Current View", - string.IsNullOrWhiteSpace(state.CurrentView) ? "None" : state.CurrentView), + string.IsNullOrWhiteSpace(currentView) ? "None" : currentView), Text( $"{SurfaceId}.note", "The observing client lists available inventory navigation; the shared runtime surface owns the dropdown contract.")) }; - foreach (var group in state.Groups) + foreach (var group in groups) { if (group?.Options == null || group.Options.Count == 0) continue; @@ -383,7 +358,7 @@ namespace GameCult.Aetheria.State.Verse $"{SurfaceId}.actions", Button($"{SurfaceId}.close", "Close", Close))); - var commands = state.Groups + var commands = groups .Where(group => group?.Options != null) .SelectMany(group => group.Options) .Where(option => option?.IsCommand == true) @@ -396,7 +371,7 @@ namespace GameCult.Aetheria.State.Verse providerKind: "inventory.panel", title: "Inventory Dropdown", version: version, - updatedAtUtc: state.UpdatedAtUtc, + updatedAtUtc: updatedAtUtc ?? "", surface: new AetheriaRuntimeSurfaceTree( SurfaceId, Node(