From ffb53fe45616875e1f942611677e84e4ef048fdf Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 31 May 2026 01:23:15 +0100 Subject: [PATCH] Use Eve dashboard broker --- README.md | 14 +++++++++----- Sources/EVEDashboardClient.m | 1 - Sources/EVEViewController.mm | 23 +++++++++++++++++++---- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6c8cbec..2a3d498 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,11 @@ Start the dashboard authority on Starfire: dotnet run --project E:\Projects\Mimir\src\Mimir.EveDashboard\Mimir.EveDashboard.csproj -- --port 8795 ``` -EveCanvas connects to `ws://192.168.1.66:8795/eve/dashboard`. Mimir sends -`dashboard-state` snapshots containing scene nodes, selection, visibility, -transform, size, and health. EveCanvas sends compact commands back: +EveCanvas connects first to `ws://192.168.1.66:8795/eve/deck`, with +`/eve/dashboard` kept as a compatibility fallback. The Starfire broker sends +native retained `dashboard-state` snapshots containing provider id, title, +scene nodes, selection, visibility, transform, size, and health. EveCanvas sends +compact commands back: - `select` - `move` @@ -91,9 +93,11 @@ transform, size, and health. EveCanvas sends compact commands back: - `rotate` - `toggle-visibility` - `reset-transform` +- `open-provider` -Eve renders and edits the dashboard; Mimir owns the accepted state. Eve is the -operator's hand on the scene graph, not a second compositor. +Eve renders and edits dashboard trees natively; each provider owns accepted +state and command handling. Eve is the operator's hand on the scene graph, not a +second compositor and not a remote WebKit runtime. ## Build Shape diff --git a/Sources/EVEDashboardClient.m b/Sources/EVEDashboardClient.m index 752c932..078e882 100644 --- a/Sources/EVEDashboardClient.m +++ b/Sources/EVEDashboardClient.m @@ -87,7 +87,6 @@ if ([state isKindOfClass:NSDictionary.class]) { dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate dashboardClient:self didReceiveState:state]; - [self.delegate dashboardClient:self didChangeStatus:@"dashboard live"]; }); } } diff --git a/Sources/EVEViewController.mm b/Sources/EVEViewController.mm index 989b80c..0a8a09a 100644 --- a/Sources/EVEViewController.mm +++ b/Sources/EVEViewController.mm @@ -129,6 +129,8 @@ static int64_t EVEHostTimeNowNs(void) { [self.streamClient connect]; NSArray *dashboardURLs = @[ + [NSURL URLWithString:@"ws://127.0.0.1:8795/eve/deck"], + [NSURL URLWithString:@"ws://192.168.1.66:8795/eve/deck"], [NSURL URLWithString:@"ws://127.0.0.1:8795/eve/dashboard"], [NSURL URLWithString:@"ws://192.168.1.66:8795/eve/dashboard"], ]; @@ -515,7 +517,9 @@ static int64_t EVEHostTimeNowNs(void) { - (void)dashboardClient:(EVEDashboardClient *)client didReceiveState:(NSDictionary *)state { (void)client; - self.dashboardStatus = [NSString stringWithFormat:@"v%@", state[@"version"] ?: @"?"]; + NSString *title = [state[@"title"] isKindOfClass:NSString.class] ? state[@"title"] : @"dashboard"; + self.dashboardStatus = [NSString stringWithFormat:@"%@ v%@", title, state[@"version"] ?: @"?"]; + self.dashboardStatusLabel.text = self.dashboardStatus; NSString *selected = state[@"selectedNodeId"]; if ([selected isKindOfClass:NSString.class]) { self.selectedNodeId = selected; @@ -630,7 +634,7 @@ static int64_t EVEHostTimeNowNs(void) { } UILabel *title = [[UILabel alloc] initWithFrame:CGRectZero]; - title.text = @"Scene Graph"; + title.text = @"Dashboards"; title.textColor = UIColor.whiteColor; title.font = [UIFont systemFontOfSize:16.0 weight:UIFontWeightBold]; [self.hierarchyStackView addArrangedSubview:title]; @@ -659,8 +663,7 @@ static int64_t EVEHostTimeNowNs(void) { return; } - self.selectedNodeId = nodeId; - [self.dashboardClient sendCommand:@{@"type": @"select", @"nodeId": nodeId}]; + [self selectOrOpenDashboardNode:nodeId]; } - (void)nodePanned:(UIPanGestureRecognizer *)recognizer { @@ -722,7 +725,19 @@ static int64_t EVEHostTimeNowNs(void) { return; } + [self selectOrOpenDashboardNode:nodeId]; +} + +- (void)selectOrOpenDashboardNode:(NSString *)nodeId { self.selectedNodeId = nodeId; + NSDictionary *node = self.dashboardNodes[nodeId]; + NSString *command = [node[@"command"] isKindOfClass:NSString.class] ? node[@"command"] : nil; + NSString *providerId = [node[@"providerId"] isKindOfClass:NSString.class] ? node[@"providerId"] : nil; + if ([command isEqualToString:@"open-provider"] && providerId) { + [self.dashboardClient sendCommand:@{@"type": @"open-provider", @"nodeId": nodeId, @"providerId": providerId}]; + return; + } + [self.dashboardClient sendCommand:@{@"type": @"select", @"nodeId": nodeId}]; }