From 666e46c4ca193a52c315dbe65c2ff2e6cdf6ed94 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 25 Aug 2026 03:07:23 +0200 Subject: [PATCH] Publish Gjallar aggregate for GUI lowerers --- src/Gjallar/Program.cs | 40 ++++++++++++++++++++++++++++++++++++--- src/Gjallar/VerseState.cs | 6 +++--- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/Gjallar/Program.cs b/src/Gjallar/Program.cs index d53ccb6..e44b466 100644 --- a/src/Gjallar/Program.cs +++ b/src/Gjallar/Program.cs @@ -817,6 +817,8 @@ internal sealed class GjallarRenderer : IDisposable updatedAt = ResolveFrameUpdatedAt(frame), layout = new { + visible = true, + weight = 1.0, density = "dense", viewportMode = "nested-scroll", }, @@ -847,6 +849,11 @@ internal sealed class GjallarRenderer : IDisposable title = "Gjallar", summary = $"{aggregateFrames.Length} provider surfaces", marqueeText = catalog.MarqueeText ?? "", + layout = new + { + mode = "weighted-bisect", + gap = 8, + }, }, children, }, @@ -869,6 +876,8 @@ internal sealed class GjallarRenderer : IDisposable Array.Empty(), new Dictionary(StringComparer.Ordinal) { + ["visible"] = "true", + ["weight"] = "1", ["density"] = "dense", ["viewportMode"] = "nested-scroll", })).ToArray(); @@ -881,7 +890,14 @@ internal sealed class GjallarRenderer : IDisposable ["summary"] = $"{aggregateFrames.Length} provider surfaces", ["marqueeText"] = catalog.MarqueeText ?? "", }, - componentChildren); + componentChildren, + Array.Empty(), + Array.Empty(), + new Dictionary(StringComparer.Ordinal) + { + ["mode"] = "weighted-bisect", + ["gap"] = "8", + }); var surface = new EveSurfaceDocument( "surface-state", EveSurfaceDocument.SchemaId, @@ -3048,16 +3064,24 @@ internal static class GjallarOdinProviderPublisher }, }; transport.SendSchema(CultNetSchemaMessageSerialization.Serialize(message)); + var surfaceState = new GjallarSurfaceStateRecord + { + ProviderId = surface.ProviderId, + Title = surface.Title, + Version = surface.Version, + UpdatedAt = surface.UpdatedAtUtc, + Surface = surface.Surface, + }; var surfaceMessage = new CultNetDocumentPutRawMessage { MessageId = $"gjallar-surface:{surface.ProviderId}:{surface.Version}", Document = new CultNetRawDocumentRecord { - SchemaId = EveSurfaceDocument.SchemaId, + SchemaId = "gamecult.eve.surface_state.v1", RecordKey = surface.ProviderId, StoredAt = surface.UpdatedAtUtc, PayloadEncoding = "messagepack", - Payload = MessagePackSerializer.Serialize(surface, CultNetSchemaMessageSerialization.Options), + Payload = MessagePackSerializer.Serialize(surfaceState, CultNetSchemaMessageSerialization.Options), SourceRuntimeId = sourceRuntimeId, SourceRole = "gjallar.compositor", Tags = ["aggregate-surface", "odin-visible-providers"], @@ -3095,6 +3119,16 @@ internal static class GjallarOdinProviderPublisher } } +[MessagePackObject(AllowPrivate = true)] +internal sealed class GjallarSurfaceStateRecord +{ + [Key(0)] public string ProviderId { get; set; } = ""; + [Key(1)] public string Title { get; set; } = ""; + [Key(2)] public long Version { get; set; } + [Key(3)] public string UpdatedAt { get; set; } = ""; + [Key(4)] public EveSurfaceTree Surface { get; set; } = new("", new EveSurfaceComponent("", "surface", new Dictionary(), []), []); +} + internal readonly record struct ColorBgra(byte R, byte G, byte B) { public static readonly ColorBgra Black = new(0, 0, 0); diff --git a/src/Gjallar/VerseState.cs b/src/Gjallar/VerseState.cs index 3e38044..4169823 100644 --- a/src/Gjallar/VerseState.cs +++ b/src/Gjallar/VerseState.cs @@ -105,9 +105,9 @@ internal sealed class GjallarVerseRuntime : IDisposable }, new GjallarAdvertisedSchema { - SchemaId = "gamecult.eve.surface.v1", + SchemaId = "gamecult.eve.surface_state.v1", Owner = "gjallar.runtime", - Description = "Gjallar-owned aggregate containing every currently visible provider surface accepted by Odin.", + Description = "Gjallar-owned aggregate surface state containing every currently visible provider surface accepted by Odin.", }, new GjallarAdvertisedSchema { @@ -151,7 +151,7 @@ internal sealed class GjallarVerseRuntime : IDisposable Schemas = [ "gamecult.eve.provider_advertisement.v1", - "gamecult.eve.surface.v1", + "gamecult.eve.surface_state.v1", "gjallar.runtime_config.v0", "gjallar.frame_status.v0", "gjallar.command_boundary.v0",