@native-sdk/cli 0.8.4 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/app.zig +1178 -74
- package/build.zig +715 -17
- package/build.zig.zon +1 -0
- package/native-sdk.d.ts +10 -0
- package/package.json +12 -11
- package/packages/core/compile-surface/core.ts +435 -3
- package/packages/core/package-lock.json +11 -11
- package/packages/core/package.json +2 -2
- package/packages/core/scripts/compiler_typecheck.mjs +116 -15
- package/packages/core/scripts/gen_service_surface.mjs +268 -0
- package/packages/core/scripts/merge_static_archives.mjs +78 -0
- package/packages/core/scripts/npm_static_spike.mjs +64 -0
- package/packages/core/scripts/run_external_core_compiler.mjs +122 -6
- package/packages/core/scripts/run_external_service_compiler.mjs +280 -0
- package/packages/core/scripts/stage_external_core.mjs +9 -1
- package/packages/core/scripts/stage_external_services.mjs +172 -0
- package/packages/core/scripts/surface_manifest_diff.mjs +253 -0
- package/packages/core/scripts/vendor_service_packages.mjs +189 -0
- package/packages/core/sdk/core.d.ts +224 -0
- package/packages/core/sdk/core.ts +694 -22
- package/packages/core/sdk/events.d.ts +89 -0
- package/packages/core/sdk/events.ts +128 -0
- package/packages/core/src/checker.ts +936 -15
- package/packages/core/src/cli.ts +156 -3
- package/packages/core/src/contract.ts +28 -5
- package/packages/core/src/devhost.ts +1876 -16
- package/packages/core/src/devhost_journal.mjs +183 -0
- package/packages/core/src/devhost_resolver.mjs +17 -1
- package/packages/core/src/devhost_service_worker.mjs +90 -0
- package/packages/core/src/diagnostics.ts +179 -22
- package/packages/core/src/frontend.ts +210 -34
- package/packages/core/src/infer.ts +24 -0
- package/packages/core/src/modules.ts +129 -80
- package/packages/core/src/service_contract.ts +597 -0
- package/packages/core/src/sqlite_cli.ts +93 -0
- package/packages/core/src/sqlite_codegen.ts +806 -0
- package/packages/core/src/sqlite_runtime_policy.ts +364 -0
- package/packages/core/src/typed_ast.ts +36 -8
- package/skill-data/automation/SKILL.md +1 -1
- package/skill-data/core/references/project-anatomy.md +1 -1
- package/skill-data/native-ui/SKILL.md +58 -5
- package/skill-data/ts-core/SKILL.md +123 -41
- package/skill-data/ts-services/SKILL.md +126 -0
- package/skill-data/ts-services/references/service-surface.md +604 -0
- package/skill-data/zig/SKILL.md +1 -1
- package/skills/native-sdk/SKILL.md +1 -1
- package/src/app_runner/no_migrations.zig +3 -0
- package/src/app_runner/no_services.zig +20 -0
- package/src/app_runner/root.zig +133 -4
- package/src/app_runner/ts_core_main.zig +254 -8
- package/src/app_runner/ts_core_mobile.zig +241 -0
- package/src/automation/protocol.zig +5 -1
- package/src/automation/snapshot.zig +31 -11
- package/src/embed/app_exports.zig +12 -1
- package/src/embed/c_api.zig +48 -2
- package/src/embed/conversions.zig +4 -5
- package/src/embed/host.zig +109 -1
- package/src/embed/root.zig +8 -0
- package/src/embed/tests.zig +241 -0
- package/src/embed/types.zig +51 -0
- package/src/embed/ui_host.zig +185 -5
- package/src/platform/android/NativeSdkActivity.java +131 -0
- package/src/platform/android/android_host.c +182 -1
- package/src/platform/android/native_sdk_app.h +17 -0
- package/src/platform/ios/native_sdk_app.h +17 -0
- package/src/platform/ios/uikit_host.m +115 -0
- package/src/platform/linux/cef_host.cpp +8 -2
- package/src/platform/linux/gtk_host.c +289 -22
- package/src/platform/linux/gtk_host.h +5 -1
- package/src/platform/linux/root.zig +109 -22
- package/src/platform/macos/appkit_host.h +24 -7
- package/src/platform/macos/appkit_host.m +686 -64
- package/src/platform/macos/cef_host.mm +400 -66
- package/src/platform/macos/root.zig +304 -47
- package/src/platform/null_platform.zig +435 -48
- package/src/platform/null_platform_tests.zig +113 -0
- package/src/platform/root.zig +19 -0
- package/src/platform/types.zig +281 -28
- package/src/platform/windows/root.zig +207 -27
- package/src/platform/windows/webview2_host.cpp +334 -51
- package/src/primitives/app_manifest/comptime_scene.zig +2 -0
- package/src/primitives/app_manifest/root.zig +4 -0
- package/src/primitives/app_manifest/tests.zig +3 -0
- package/src/primitives/app_manifest/types.zig +32 -0
- package/src/primitives/app_manifest/validation.zig +19 -1
- package/src/root.zig +53 -0
- package/src/runtime/api.zig +19 -0
- package/src/runtime/automation_commands.zig +35 -2
- package/src/runtime/automation_snapshot.zig +32 -20
- package/src/runtime/bridge_permission_tests.zig +58 -3
- package/src/runtime/bridge_responses.zig +4 -2
- package/src/runtime/builtin_bridge.zig +11 -1
- package/src/runtime/canvas_frame.zig +18 -11
- package/src/runtime/canvas_frame_animation_tests.zig +4 -0
- package/src/runtime/clock.zig +13 -1
- package/src/runtime/core.zig +145 -7
- package/src/runtime/credentials_store.zig +115 -0
- package/src/runtime/effects.zig +3701 -231
- package/src/runtime/effects_credentials_tests.zig +332 -0
- package/src/runtime/effects_file_tests.zig +587 -0
- package/src/runtime/effects_host_tests.zig +208 -1
- package/src/runtime/effects_notification_tests.zig +11 -0
- package/src/runtime/effects_relational_tests.zig +314 -0
- package/src/runtime/effects_store_tests.zig +211 -0
- package/src/runtime/file_access.zig +400 -0
- package/src/runtime/file_effect_crash_helper.zig +28 -0
- package/src/runtime/file_effect_crash_tests.zig +37 -0
- package/src/runtime/flow.zig +35 -10
- package/src/runtime/gpu_surface_events.zig +6 -1
- package/src/runtime/native_command_event_tests.zig +86 -2
- package/src/runtime/persist_store.zig +666 -0
- package/src/runtime/pty.zig +5 -2
- package/src/runtime/record_store.zig +788 -0
- package/src/runtime/relational_store.zig +854 -0
- package/src/runtime/root.zig +54 -0
- package/src/runtime/runtime_event_tests.zig +70 -0
- package/src/runtime/service_host.zig +711 -0
- package/src/runtime/service_pool.zig +1314 -0
- package/src/runtime/session_blobs.zig +4 -1
- package/src/runtime/session_journal.zig +158 -5
- package/src/runtime/session_record.zig +215 -0
- package/src/runtime/session_replay.zig +206 -11
- package/src/runtime/session_tests.zig +81 -0
- package/src/runtime/shell_layout.zig +1 -0
- package/src/runtime/shell_layout_tests.zig +120 -0
- package/src/runtime/sqlite_engine.zig +474 -0
- package/src/runtime/state.zig +16 -0
- package/src/runtime/system_services.zig +170 -38
- package/src/runtime/tests.zig +4 -0
- package/src/runtime/ts_core_host.zig +1067 -95
- package/src/runtime/ts_core_host_tests.zig +325 -11
- package/src/runtime/ts_ui_app.zig +953 -2
- package/src/runtime/ui_app.zig +434 -96
- package/src/runtime/ui_app_tests.zig +287 -11
- package/src/runtime/ui_app_window_tests.zig +61 -7
- package/src/runtime/validation.zig +42 -0
- package/src/runtime/view.zig +9 -0
- package/src/runtime/window_storage.zig +1 -0
- package/src/runtime/window_view_runtime.zig +2 -3
- package/src/runtime/window_views.zig +19 -0
- package/src/tooling/android.zig +21 -16
- package/src/tooling/db.zig +160 -0
- package/src/tooling/ios.zig +7 -1
- package/src/tooling/manifest.zig +214 -2
- package/src/tooling/package.zig +116 -0
- package/src/tooling/raw_manifest.zig +30 -0
- package/src/tooling/root.zig +1 -0
- package/src/tooling/templates.zig +189 -4
- package/src/tooling/ts_core.zig +366 -17
- package/src/tooling/verbs.zig +7 -0
- package/third_party/sqlite/README.md +13 -0
- package/third_party/sqlite/sqlite3.c +269649 -0
- package/third_party/sqlite/sqlite3.h +14349 -0
- package/tools/corewire/core_abi.zig +14 -2
- package/tools/corewire/emit.zig +98 -29
- package/tools/corewire/emit_facade.zig +442 -27
- package/tools/corewire/emit_profile.zig +6 -2
- package/tools/corewire/emit_service.zig +924 -0
- package/tools/corewire/main.zig +122 -0
- package/tools/corewire/service_contract.zig +250 -0
- package/tools/corewire/sidecar.zig +26 -15
package/src/runtime/flow.zig
CHANGED
|
@@ -45,7 +45,7 @@ const parseAutomationWidgetKey = automation_commands.parseAutomationWidgetKey;
|
|
|
45
45
|
const parseAutomationWidgetPinch = automation_commands.parseAutomationWidgetPinch;
|
|
46
46
|
const parseAutomationWidgetPointerDrag = automation_commands.parseAutomationWidgetPointerDrag;
|
|
47
47
|
const parseAutomationResizeCommand = automation_commands.parseAutomationResizeCommand;
|
|
48
|
-
const
|
|
48
|
+
const parseAutomationTrayTarget = automation_commands.parseAutomationTrayTarget;
|
|
49
49
|
const parseAutomationScreenshotCommand = automation_commands.parseAutomationScreenshotCommand;
|
|
50
50
|
const canvas = @import("canvas");
|
|
51
51
|
|
|
@@ -185,6 +185,7 @@ pub fn RuntimeFlow(comptime Runtime: type) type {
|
|
|
185
185
|
const runtime_index = try WindowViewMethods().reserveWindow(self, window.id, window.label, window.resolvedTitle(app_info.app_name), null, true, .allow_source_less);
|
|
186
186
|
self.windows[runtime_index].activate_on_show = window.activate_on_show;
|
|
187
187
|
self.windows[runtime_index].info.focused = window.activate_on_show and window.show == .immediate;
|
|
188
|
+
self.windows[runtime_index].info.hidden = window.show == .hidden;
|
|
188
189
|
self.windows[runtime_index].main_focused = self.windows[runtime_index].info.focused;
|
|
189
190
|
self.windows[runtime_index].info.frame = window.default_frame;
|
|
190
191
|
self.windows[runtime_index].main_frame = geometry.RectF.init(0, 0, window.default_frame.width, window.default_frame.height);
|
|
@@ -361,12 +362,13 @@ pub fn RuntimeFlow(comptime Runtime: type) type {
|
|
|
361
362
|
},
|
|
362
363
|
.frame_requested => try frame(self, app),
|
|
363
364
|
.bridge_message => |message| try handleBridgeMessage(self, app, message),
|
|
364
|
-
.tray_action => |
|
|
365
|
-
log(self, "tray.action", "tray item selected", &.{trace.uint("item_id", item_id)});
|
|
365
|
+
.tray_action => |action| {
|
|
366
|
+
log(self, "tray.action", "tray item selected", &.{ trace.uint("status_item_id", action.status_item_id), trace.uint("item_id", action.item_id) });
|
|
366
367
|
try dispatchCommand(self, app, .{
|
|
367
|
-
.name = SystemServiceMethods().
|
|
368
|
+
.name = SystemServiceMethods().statusItemCommandNameForItem(self, action.status_item_id, action.item_id),
|
|
368
369
|
.source = .tray,
|
|
369
|
-
.
|
|
370
|
+
.status_item_id = action.status_item_id,
|
|
371
|
+
.tray_item_id = action.item_id,
|
|
370
372
|
});
|
|
371
373
|
},
|
|
372
374
|
.shortcut => |shortcut| {
|
|
@@ -444,6 +446,21 @@ pub fn RuntimeFlow(comptime Runtime: type) type {
|
|
|
444
446
|
.window_id = command.window_id,
|
|
445
447
|
});
|
|
446
448
|
},
|
|
449
|
+
.tray_command => |command| {
|
|
450
|
+
try dispatchCommand(self, app, .{
|
|
451
|
+
.name = command.name,
|
|
452
|
+
.source = .tray,
|
|
453
|
+
.window_id = command.window_id,
|
|
454
|
+
.status_item_id = command.status_item_id,
|
|
455
|
+
});
|
|
456
|
+
},
|
|
457
|
+
.notification_command => |command| {
|
|
458
|
+
try dispatchCommand(self, app, .{
|
|
459
|
+
.name = command.name,
|
|
460
|
+
.source = .notification,
|
|
461
|
+
.window_id = command.window_id,
|
|
462
|
+
});
|
|
463
|
+
},
|
|
447
464
|
.timer => |timer_event| {
|
|
448
465
|
try dispatchEvent(self, app, .{ .timer = timer_event });
|
|
449
466
|
},
|
|
@@ -994,9 +1011,12 @@ pub fn RuntimeFlow(comptime Runtime: type) type {
|
|
|
994
1011
|
// UiApp's window fallback are all the real path. A
|
|
995
1012
|
// stale or unknown item id is loud driver misuse,
|
|
996
1013
|
// like widget-click on an unmounted widget.
|
|
997
|
-
const
|
|
998
|
-
if (!
|
|
999
|
-
try dispatchPlatformEvent(self, app, .{ .tray_action =
|
|
1014
|
+
const target = try parseAutomationTrayTarget(command.value);
|
|
1015
|
+
if (!SystemServiceMethods().statusItemMenuItemExists(self, target.status_item_id, target.item_id)) return error.InvalidCommand;
|
|
1016
|
+
try dispatchPlatformEvent(self, app, .{ .tray_action = .{
|
|
1017
|
+
.status_item_id = target.status_item_id,
|
|
1018
|
+
.item_id = target.item_id,
|
|
1019
|
+
} });
|
|
1000
1020
|
},
|
|
1001
1021
|
.focus_view => {
|
|
1002
1022
|
try WindowViewMethods().focusView(self, 1, try parseAutomationViewLabel(command.value));
|
|
@@ -1016,7 +1036,12 @@ pub fn RuntimeFlow(comptime Runtime: type) type {
|
|
|
1016
1036
|
self.command_count += 1;
|
|
1017
1037
|
const enable = std.mem.eql(u8, command.value, "on");
|
|
1018
1038
|
if (!enable and !std.mem.eql(u8, command.value, "off")) return error.InvalidCommand;
|
|
1019
|
-
if (enable and !self.frame_profile.enabled)
|
|
1039
|
+
if (enable and !self.frame_profile.enabled) {
|
|
1040
|
+
self.frame_profile.reset();
|
|
1041
|
+
for (self.views[0..self.view_count]) |*view| {
|
|
1042
|
+
view.gpu_frame_profile_timestamp_ns = 0;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1020
1045
|
self.frame_profile.enabled = enable;
|
|
1021
1046
|
self.invalidateFor(.command, null);
|
|
1022
1047
|
},
|
|
@@ -1173,7 +1198,7 @@ pub fn RuntimeFlow(comptime Runtime: type) type {
|
|
|
1173
1198
|
else if (is_credentials)
|
|
1174
1199
|
dispatchCredentialBridgeCommand(self, request, &result_buffer, &response_buffer)
|
|
1175
1200
|
else
|
|
1176
|
-
dispatchOsBridgeCommand(self, request, &result_buffer, &response_buffer);
|
|
1201
|
+
dispatchOsBridgeCommand(self, request, message.origin, &result_buffer, &response_buffer);
|
|
1177
1202
|
|
|
1178
1203
|
try completeBridgeResponse(self, message.window_id, message.webview_label, result);
|
|
1179
1204
|
self.invalidateFor(.command, null);
|
|
@@ -45,10 +45,13 @@ pub fn RuntimeGpuSurfaceEvents(comptime Runtime: type) type {
|
|
|
45
45
|
// interval, useless for drop detection). Profiling-gated;
|
|
46
46
|
// a dropped frame shows as max >> p50 on this channel.
|
|
47
47
|
if (self.frame_profile.enabled) {
|
|
48
|
-
const previous_timestamp_ns = self.views[index].
|
|
48
|
+
const previous_timestamp_ns = self.views[index].gpu_frame_profile_timestamp_ns;
|
|
49
49
|
if (previous_timestamp_ns > 0 and frame_event.timestamp_ns > previous_timestamp_ns) {
|
|
50
50
|
self.frame_profile.recordNs(.interval, frame_event.timestamp_ns - previous_timestamp_ns);
|
|
51
51
|
}
|
|
52
|
+
self.views[index].gpu_frame_profile_timestamp_ns = frame_event.timestamp_ns;
|
|
53
|
+
} else {
|
|
54
|
+
self.views[index].gpu_frame_profile_timestamp_ns = 0;
|
|
52
55
|
}
|
|
53
56
|
self.views[index].gpu_timestamp_ns = frame_event.timestamp_ns;
|
|
54
57
|
self.views[index].recordGpuSurfaceFrameInterval(frame_event.frame_interval_ns);
|
|
@@ -106,12 +109,14 @@ pub fn RuntimeGpuSurfaceEvents(comptime Runtime: type) type {
|
|
|
106
109
|
// state 60 times a second.
|
|
107
110
|
const first_frame_latency_recorded = !first_frame_latency_was_recorded and self.views[index].gpu_first_frame_latency_recorded;
|
|
108
111
|
if (self.views[index].gpu_frame_nonblank != frame_event.nonblank or
|
|
112
|
+
self.views[index].gpu_occluded != frame_event.occluded or
|
|
109
113
|
self.views[index].gpu_backend != frame_event.backend or
|
|
110
114
|
first_frame_latency_recorded)
|
|
111
115
|
{
|
|
112
116
|
self.invalidateFor(.state, self.views[index].frame);
|
|
113
117
|
}
|
|
114
118
|
self.views[index].gpu_frame_nonblank = frame_event.nonblank;
|
|
119
|
+
self.views[index].gpu_occluded = frame_event.occluded;
|
|
115
120
|
self.views[index].gpu_sample_color = frame_event.sample_color;
|
|
116
121
|
self.views[index].gpu_backend = frame_event.backend;
|
|
117
122
|
self.views[index].gpu_pixel_format = frame_event.pixel_format;
|
|
@@ -289,13 +289,13 @@ test "runtime dispatches tray item commands" {
|
|
|
289
289
|
.{ .id = 8, .label = "Legacy" },
|
|
290
290
|
} });
|
|
291
291
|
|
|
292
|
-
try harness.runtime.dispatchPlatformEvent(app_state.app(), .{ .tray_action = 7 });
|
|
292
|
+
try harness.runtime.dispatchPlatformEvent(app_state.app(), .{ .tray_action = .{ .item_id = 7 } });
|
|
293
293
|
try std.testing.expectEqual(@as(u32, 1), app_state.command_count);
|
|
294
294
|
try std.testing.expectEqualStrings("app.refresh", app_state.last_name);
|
|
295
295
|
try std.testing.expectEqual(CommandSource.tray, app_state.last_source);
|
|
296
296
|
try std.testing.expectEqual(@as(platform.TrayItemId, 7), app_state.last_tray_item_id);
|
|
297
297
|
|
|
298
|
-
try harness.runtime.dispatchPlatformEvent(app_state.app(), .{ .tray_action = 8 });
|
|
298
|
+
try harness.runtime.dispatchPlatformEvent(app_state.app(), .{ .tray_action = .{ .item_id = 8 } });
|
|
299
299
|
try std.testing.expectEqual(@as(u32, 2), app_state.command_count);
|
|
300
300
|
try std.testing.expectEqualStrings("tray.action", app_state.last_name);
|
|
301
301
|
try std.testing.expectEqual(@as(platform.TrayItemId, 8), app_state.last_tray_item_id);
|
|
@@ -307,6 +307,90 @@ test "runtime dispatches tray item commands" {
|
|
|
307
307
|
try std.testing.expectError(error.InvalidTrayOptions, harness.runtime.updateTrayMenu(&.{.{ .label = "Missing id", .command = "app.missing-id" }}));
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
+
test "runtime dispatches named tray lifecycle commands with tray source" {
|
|
311
|
+
const TestApp = struct {
|
|
312
|
+
command_count: u32 = 0,
|
|
313
|
+
last_name: []const u8 = "",
|
|
314
|
+
last_source: CommandSource = .runtime,
|
|
315
|
+
last_window_id: platform.WindowId = 0,
|
|
316
|
+
|
|
317
|
+
fn app(self: *@This()) App {
|
|
318
|
+
return .{ .context = self, .name = "tray-lifecycle-command", .source = platform.WebViewSource.html("<p>Tray</p>"), .event_fn = event };
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
fn event(context: *anyopaque, runtime: *Runtime, event_value: Event) anyerror!void {
|
|
322
|
+
_ = runtime;
|
|
323
|
+
const self: *@This() = @ptrCast(@alignCast(context));
|
|
324
|
+
switch (event_value) {
|
|
325
|
+
.command => |command| {
|
|
326
|
+
self.command_count += 1;
|
|
327
|
+
self.last_name = command.name;
|
|
328
|
+
self.last_source = command.source;
|
|
329
|
+
self.last_window_id = command.window_id;
|
|
330
|
+
},
|
|
331
|
+
else => {},
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
const harness = try TestHarness().create(std.testing.allocator, .{});
|
|
337
|
+
defer harness.destroy(std.testing.allocator);
|
|
338
|
+
var app_state: TestApp = .{};
|
|
339
|
+
try harness.start(app_state.app());
|
|
340
|
+
|
|
341
|
+
try harness.runtime.dispatchPlatformEvent(app_state.app(), .{ .tray_command = .{
|
|
342
|
+
.name = "app.refresh",
|
|
343
|
+
.window_id = 3,
|
|
344
|
+
} });
|
|
345
|
+
|
|
346
|
+
try std.testing.expectEqual(@as(u32, 1), app_state.command_count);
|
|
347
|
+
try std.testing.expectEqualStrings("app.refresh", app_state.last_name);
|
|
348
|
+
try std.testing.expectEqual(CommandSource.tray, app_state.last_source);
|
|
349
|
+
try std.testing.expectEqual(@as(platform.WindowId, 3), app_state.last_window_id);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
test "runtime dispatches notification actions through the normal command path" {
|
|
353
|
+
const TestApp = struct {
|
|
354
|
+
command_count: u32 = 0,
|
|
355
|
+
last_name: []const u8 = "",
|
|
356
|
+
last_source: CommandSource = .runtime,
|
|
357
|
+
last_window_id: platform.WindowId = 0,
|
|
358
|
+
|
|
359
|
+
fn app(self: *@This()) App {
|
|
360
|
+
return .{ .context = self, .name = "notification-command", .source = platform.WebViewSource.html("<p>Notification</p>"), .event_fn = event };
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
fn event(context: *anyopaque, runtime: *Runtime, event_value: Event) anyerror!void {
|
|
364
|
+
_ = runtime;
|
|
365
|
+
const self: *@This() = @ptrCast(@alignCast(context));
|
|
366
|
+
switch (event_value) {
|
|
367
|
+
.command => |command| {
|
|
368
|
+
self.command_count += 1;
|
|
369
|
+
self.last_name = command.name;
|
|
370
|
+
self.last_source = command.source;
|
|
371
|
+
self.last_window_id = command.window_id;
|
|
372
|
+
},
|
|
373
|
+
else => {},
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
const harness = try TestHarness().create(std.testing.allocator, .{});
|
|
379
|
+
defer harness.destroy(std.testing.allocator);
|
|
380
|
+
var app_state: TestApp = .{};
|
|
381
|
+
try harness.start(app_state.app());
|
|
382
|
+
|
|
383
|
+
try harness.runtime.dispatchPlatformEvent(app_state.app(), .{ .notification_command = .{
|
|
384
|
+
.name = "build.open",
|
|
385
|
+
.window_id = 4,
|
|
386
|
+
} });
|
|
387
|
+
|
|
388
|
+
try std.testing.expectEqual(@as(u32, 1), app_state.command_count);
|
|
389
|
+
try std.testing.expectEqualStrings("build.open", app_state.last_name);
|
|
390
|
+
try std.testing.expectEqual(CommandSource.notification, app_state.last_source);
|
|
391
|
+
try std.testing.expectEqual(@as(platform.WindowId, 4), app_state.last_window_id);
|
|
392
|
+
}
|
|
393
|
+
|
|
310
394
|
test "runtime dispatches file drop events to app and window bridge" {
|
|
311
395
|
const TestApp = struct {
|
|
312
396
|
drop_count: u32 = 0,
|