@native-sdk/cli 0.8.2 → 0.8.4
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 +50 -3
- package/build.zig +134 -360
- package/native-sdk.d.ts +4 -0
- package/package.json +9 -9
- package/packages/core/compile-surface/core.ts +90 -1
- package/packages/core/package-lock.json +2 -2
- package/packages/core/package.json +1 -1
- package/packages/core/sdk/core.d.ts +65 -2
- package/packages/core/sdk/core.ts +189 -33
- package/packages/core/sdk/events.d.ts +14 -0
- package/packages/core/sdk/events.ts +18 -0
- package/packages/core/src/checker.ts +61 -1
- package/packages/core/src/devhost.ts +3 -3
- package/packages/core/src/diagnostics.ts +4 -4
- package/skill-data/core/SKILL.md +4 -2
- package/skill-data/core/references/project-anatomy.md +2 -1
- package/skill-data/core/references/web-engines-packaging-debugging.md +3 -1
- package/skill-data/native-ui/SKILL.md +8 -8
- package/skill-data/ts-core/SKILL.md +16 -13
- package/src/app_runner/app_assets.zig +138 -0
- package/src/app_runner/root.zig +2 -0
- package/src/app_runner/ts_core_main.zig +27 -3
- package/src/embed/host.zig +6 -0
- package/src/embed/ui_host.zig +2 -0
- package/src/platform/linux/root.zig +1 -0
- package/src/platform/macos/appkit_host.h +10 -0
- package/src/platform/macos/appkit_host.m +515 -93
- package/src/platform/macos/capture_info_plist.c +25 -0
- package/src/platform/macos/cef_host.mm +22 -0
- package/src/platform/macos/root.zig +68 -0
- package/src/platform/null_platform.zig +58 -0
- package/src/platform/root.zig +7 -0
- package/src/platform/types.zig +100 -0
- package/src/platform/windows/root.zig +56 -0
- package/src/platform/windows/webview2_host.cpp +171 -0
- package/src/primitives/app_manifest/types.zig +2 -0
- package/src/primitives/canvas/code_tests.zig +9 -9
- package/src/primitives/canvas/events.zig +12 -11
- package/src/primitives/canvas/frame.zig +44 -9
- package/src/primitives/canvas/icons/mic.svg +1 -0
- package/src/primitives/canvas/icons.zig +2 -0
- package/src/primitives/canvas/root.zig +8 -0
- package/src/primitives/canvas/text_span_tests.zig +39 -0
- package/src/primitives/canvas/ui.zig +23 -4
- package/src/primitives/canvas/ui_markup.zig +15 -0
- package/src/primitives/canvas/ui_markup_compiled.zig +9 -0
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +1 -1
- package/src/primitives/canvas/ui_markup_tests.zig +5 -0
- package/src/primitives/canvas/ui_markup_view.zig +9 -0
- package/src/primitives/canvas/ui_markup_view_tests.zig +9 -6
- package/src/primitives/canvas/ui_schema.zig +19 -10
- package/src/primitives/canvas/ui_schema_tests.zig +5 -3
- package/src/primitives/canvas/ui_tests.zig +18 -4
- package/src/primitives/canvas/widget_invalidation.zig +9 -2
- package/src/primitives/canvas/widget_render.zig +321 -115
- package/src/primitives/canvas/widget_runtime_tests.zig +173 -0
- package/src/primitives/canvas/widget_text_input.zig +10 -10
- package/src/primitives/canvas/widget_tree.zig +1 -1
- package/src/primitives/canvas/widgets.zig +41 -5
- package/src/root.zig +10 -0
- package/src/runtime/automation_widget_dispatch.zig +1 -0
- package/src/runtime/bridge_payload.zig +2 -0
- package/src/runtime/canvas_frame.zig +13 -2
- package/src/runtime/canvas_frame_invalidation_tests.zig +35 -10
- package/src/runtime/canvas_widget_anchored_tests.zig +83 -0
- package/src/runtime/canvas_widget_event_tests.zig +1 -0
- package/src/runtime/canvas_widget_events.zig +69 -24
- package/src/runtime/canvas_widget_runtime.zig +101 -6
- package/src/runtime/canvas_widget_scroll_driver_tests.zig +47 -4
- package/src/runtime/canvas_widget_scroll_drivers.zig +3 -3
- package/src/runtime/canvas_widget_semantics_tests.zig +2 -0
- package/src/runtime/canvas_widget_split_tree_tests.zig +228 -0
- package/src/runtime/canvas_widget_state.zig +10 -1
- package/src/runtime/canvas_widget_text_tests.zig +112 -3
- package/src/runtime/effects.zig +313 -2
- package/src/runtime/effects_audio_capture_tests.zig +251 -0
- package/src/runtime/root.zig +3 -0
- package/src/runtime/tests.zig +1 -0
- package/src/runtime/ts_core_host.zig +401 -32
- package/src/runtime/ts_core_host_tests.zig +407 -0
- package/src/runtime/ts_ui_app.zig +39 -1
- package/src/runtime/ui_app.zig +18 -3
- package/src/runtime/ui_app_tests.zig +48 -0
- package/src/runtime/view.zig +2 -0
- package/src/runtime/view_widget_scroll.zig +56 -5
- package/src/runtime/view_widget_text.zig +24 -5
- package/src/runtime/view_widget_tree.zig +1 -1
- package/src/tooling/manifest.zig +1034 -0
- package/src/tooling/package.zig +841 -10
- package/src/tooling/raw_manifest.zig +35 -0
- package/src/tooling/templates.zig +55 -0
- package/tools/corewire/emit_facade.zig +36 -0
package/build.zig
CHANGED
|
@@ -102,6 +102,7 @@ pub fn build(b: *std.Build) void {
|
|
|
102
102
|
const diagnostics_mod = module(b, target, optimize, "src/primitives/diagnostics/root.zig");
|
|
103
103
|
const platform_info_mod = module(b, target, optimize, "src/primitives/platform_info/root.zig");
|
|
104
104
|
const json_mod = module(b, target, optimize, "src/primitives/json/root.zig");
|
|
105
|
+
const app_runner_assets_mod = module(b, target, optimize, "src/app_runner/app_assets.zig");
|
|
105
106
|
const canvas_mod = module(b, target, optimize, "src/primitives/canvas/root.zig");
|
|
106
107
|
canvas_mod.addImport("geometry", geometry_mod);
|
|
107
108
|
canvas_mod.addImport("json", json_mod);
|
|
@@ -126,6 +127,7 @@ pub fn build(b: *std.Build) void {
|
|
|
126
127
|
const diagnostics_tests = testArtifact(b, diagnostics_mod);
|
|
127
128
|
const platform_info_tests = testArtifact(b, platform_info_mod);
|
|
128
129
|
const json_tests = testArtifact(b, json_mod);
|
|
130
|
+
const app_runner_assets_tests = testArtifact(b, app_runner_assets_mod);
|
|
129
131
|
const canvas_tests = testArtifact(b, canvas_mod);
|
|
130
132
|
|
|
131
133
|
const desktop_mod = module(b, target, optimize, "src/root.zig");
|
|
@@ -468,6 +470,7 @@ pub fn build(b: *std.Build) void {
|
|
|
468
470
|
test_step.dependOn(&b.addRunArtifact(diagnostics_tests).step);
|
|
469
471
|
test_step.dependOn(&b.addRunArtifact(platform_info_tests).step);
|
|
470
472
|
test_step.dependOn(&b.addRunArtifact(json_tests).step);
|
|
473
|
+
test_step.dependOn(&b.addRunArtifact(app_runner_assets_tests).step);
|
|
471
474
|
test_step.dependOn(&b.addRunArtifact(canvas_tests).step);
|
|
472
475
|
for (desktop_test_shards) |shard_tests| {
|
|
473
476
|
test_step.dependOn(&b.addRunArtifact(shard_tests).step);
|
|
@@ -780,6 +783,11 @@ pub fn build(b: *std.Build) void {
|
|
|
780
783
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "NSAccessibilityProgressIndicatorRole" },
|
|
781
784
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "view.accessibilityRole = NativeSdkAccessibilityRoleForNativeViewKind(kind)" },
|
|
782
785
|
});
|
|
786
|
+
addFileContainsCheckStep(b, file_contains_checker, test_step, "test-appkit-audio-capture-start-stop-serialized", "Verify asynchronous ScreenCaptureKit startup cannot publish a stream after stop returns", &.{
|
|
787
|
+
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "@property(nonatomic, strong) NSLock *lifecycleLock;" },
|
|
788
|
+
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "[strongSelf.lifecycleLock lock];\n if (![strongSelf.target isCaptureActive]) {\n [strongSelf.lifecycleLock unlock];\n return;\n }\n strongSelf.stream = stream;" },
|
|
789
|
+
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "[self.lifecycleLock lock];\n SCStream *stream = self.stream;\n self.stream = nil;\n [self.lifecycleLock unlock];" },
|
|
790
|
+
});
|
|
783
791
|
addFileContainsCheckStep(b, file_contains_checker, test_step, "test-appkit-gpu-input-repaints-retained-canvas", "Verify GPU input wakes retained canvas frames", &.{
|
|
784
792
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "- (void)requestRetainedCanvasFrame" },
|
|
785
793
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "[self requestRetainedCanvasFrame];" },
|
|
@@ -1014,6 +1022,8 @@ pub fn build(b: *std.Build) void {
|
|
|
1014
1022
|
addFileContainsCheckStep(b, file_contains_checker, test_step, "test-appkit-gpu-packet-blur-effects", "Verify AppKit GPU packet presenter applies blur effects", &.{
|
|
1015
1023
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "NativeSdkPacketApplyBlur" },
|
|
1016
1024
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "CGBitmapContextGetData(context)" },
|
|
1025
|
+
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "NativeSdkGaussianBoxRadii" },
|
|
1026
|
+
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "vImageBoxConvolve_ARGB8888" },
|
|
1017
1027
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "NSIntersectionRect(rect, clipRect)" },
|
|
1018
1028
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "NativeSdkPacketTransformRect(transformValue, NativeSdkPacketRect(effect[@\"rect\"]))" },
|
|
1019
1029
|
.{ .path = "src/platform/macos/appkit_host.m", .pattern = "return NativeSdkPacketApplyBlur(effect, opacity, context, scale, transformValue, hasClip, clipRect)" },
|
|
@@ -1411,6 +1421,7 @@ pub fn build(b: *std.Build) void {
|
|
|
1411
1421
|
addExampleTestStep(b, host_cli_exe, native_examples_step, "test-example-soundboard", "Run soundboard example tests", "examples/soundboard", .managed),
|
|
1412
1422
|
addExampleTestStep(b, host_cli_exe, native_examples_step, "test-example-video-player", "Run video player example tests", "examples/video-player", .managed),
|
|
1413
1423
|
addExampleTestStep(b, host_cli_exe, native_examples_step, "test-example-soundboard-ts", "Run soundboard-ts example tests", "examples/soundboard-ts", .managed),
|
|
1424
|
+
addExampleTestStep(b, host_cli_exe, native_examples_step, "test-example-voice-memo", "Run voice memo example tests", "examples/voice-memo", .managed),
|
|
1414
1425
|
addExampleTestStep(b, host_cli_exe, native_examples_step, "test-example-deck", "Run deck example tests", "examples/deck", .managed),
|
|
1415
1426
|
addExampleTestStep(b, host_cli_exe, native_examples_step, "test-example-markdown-viewer", "Run markdown viewer example tests", "examples/markdown-viewer", .managed),
|
|
1416
1427
|
addExampleTestStep(b, host_cli_exe, native_examples_step, "test-example-code-editor", "Run code editor example tests", "examples/code-editor", .managed),
|
|
@@ -2281,7 +2292,7 @@ pub fn build(b: *std.Build) void {
|
|
|
2281
2292
|
canvas_preview_smoke_run.step.dependOn(&cli_exe.step);
|
|
2282
2293
|
canvas_preview_smoke_step.dependOn(&canvas_preview_smoke_run.step);
|
|
2283
2294
|
|
|
2284
|
-
const gpu_components_smoke_step = b.step("test-gpu-components-smoke", "Run
|
|
2295
|
+
const gpu_components_smoke_step = b.step("test-gpu-components-smoke", "Run the TypeScript component gallery automation smoke test");
|
|
2285
2296
|
const gpu_components_smoke_build = managedExampleRun(b, cli_exe, &.{ "build", "-Dplatform=macos", "-Dweb-engine=system", "-Dautomation=true", "-Doptimize=Debug" });
|
|
2286
2297
|
gpu_components_smoke_build.setCwd(b.path("examples/gpu-components"));
|
|
2287
2298
|
const gpu_components_smoke_run = b.addSystemCommand(&.{
|
|
@@ -2293,361 +2304,115 @@ pub fn build(b: *std.Build) void {
|
|
|
2293
2304
|
\\case "$cli" in /*) ;; *) cli="../../$cli" ;; esac
|
|
2294
2305
|
\\automation_dir=".zig-cache/native-sdk-automation"
|
|
2295
2306
|
\\mkdir -p "$automation_dir"
|
|
2296
|
-
|
|
2297
|
-
\\# NATIVE_SDK_SMOKE_BUDGET_MS raises the first-frame latency budget (default
|
|
2298
|
-
\\# stays 150 ms) and the automation-ready ceiling (default stays
|
|
2299
|
-
\\# 500 ms; the ceiling never drops below it) without weakening the
|
|
2300
|
-
\\# local defaults; every correctness assertion stays strict.
|
|
2301
|
-
\\smoke_budget_ms="${NATIVE_SDK_SMOKE_BUDGET_MS:-150}"
|
|
2302
|
-
\\case "$smoke_budget_ms" in ''|*[!0-9]*) echo "NATIVE_SDK_SMOKE_BUDGET_MS must be a positive integer of milliseconds: $smoke_budget_ms" >&2; exit 1 ;; esac
|
|
2303
|
-
\\if [ "$smoke_budget_ms" -le 0 ]; then echo "NATIVE_SDK_SMOKE_BUDGET_MS must be a positive integer of milliseconds: $smoke_budget_ms" >&2; exit 1; fi
|
|
2304
|
-
\\smoke_budget_ns=$((smoke_budget_ms * 1000000))
|
|
2305
|
-
\\ready_budget_ms="$smoke_budget_ms"
|
|
2306
|
-
\\if [ "$ready_budget_ms" -lt 500 ]; then ready_budget_ms=500; fi
|
|
2307
|
-
\\ready_budget_ns=$((ready_budget_ms * 1000000))
|
|
2308
|
-
\\rm -f "$automation_dir/snapshot.txt" "$automation_dir/accessibility.txt" "$automation_dir/windows.txt" "$automation_dir"/command*.txt
|
|
2307
|
+
\\rm -f "$automation_dir/snapshot.txt" "$automation_dir/accessibility.txt" "$automation_dir/windows.txt" "$automation_dir/screenshot-components-canvas.png" "$automation_dir/screenshot-components-house.png" "$automation_dir/screenshot-components-geist.png" "$automation_dir"/command*.txt
|
|
2309
2308
|
\\"$app" > .zig-cache/native-sdk-gpu-components-smoke.log 2>&1 &
|
|
2310
2309
|
\\pid=$!
|
|
2311
2310
|
\\trap 'status=$?; kill "$pid" >/dev/null 2>&1 || true; wait "$pid" >/dev/null 2>&1 || true; if [ "$status" -ne 0 ]; then echo "---- app log (.zig-cache/native-sdk-gpu-components-smoke.log) ----" >&2; cat .zig-cache/native-sdk-gpu-components-smoke.log >&2 2>/dev/null || true; fi' EXIT
|
|
2312
2311
|
\\ready="$("$cli" automate wait 2>&1)"
|
|
2313
2312
|
\\case "$ready" in *"ready=true"*) ;; *) echo "gpu-components automation snapshot was not ready" >&2; exit 1 ;; esac
|
|
2314
|
-
\\
|
|
2315
|
-
\\
|
|
2316
|
-
\\
|
|
2317
|
-
\\
|
|
2318
|
-
\\
|
|
2319
|
-
\\case "$snapshot" in *'view @w1/main kind=webview'*) echo "components should not create an implicit main WebView" >&2; exit 1 ;; *) ;; esac
|
|
2320
|
-
\\case "$snapshot" in *'source kind=html bytes=0'*) echo "components should not publish an empty default WebView source" >&2; exit 1 ;; *) ;; esac
|
|
2321
|
-
\\attempts=0
|
|
2322
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2323
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2324
|
-
\\ case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'gpu_nonblank=true'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) break ;; esac
|
|
2325
|
-
\\ attempts=$((attempts + 1))
|
|
2326
|
-
\\ sleep 0.1
|
|
2327
|
-
\\done
|
|
2328
|
-
\\case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'gpu_nonblank=true'*) ;; *) echo "components GPU surface was not ready and nonblank" >&2; exit 1 ;; esac
|
|
2329
|
-
\\case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) ;; *) echo "components GPU frame was not packet-representable" >&2; exit 1 ;; esac
|
|
2330
|
-
\\first_frame_latency="$(printf '%s\n' "$snapshot" | sed -n 's/.*view @w1\/components-canvas kind=gpu_surface.* gpu_first_frame_latency_ns=\([0-9][0-9]*\).*/\1/p')"
|
|
2331
|
-
\\case "$first_frame_latency" in ''|*[!0-9]*) echo "components GPU first frame latency was missing" >&2; exit 1 ;; esac
|
|
2332
|
-
\\if [ "$first_frame_latency" -le 0 ] || [ "$first_frame_latency" -gt "$smoke_budget_ns" ]; then echo "components GPU first frame exceeded $smoke_budget_ms ms: $first_frame_latency ns" >&2; exit 1; fi
|
|
2333
|
-
\\# The runtime publishes its own fixed 150 ms budget verdict. Within that
|
|
2334
|
-
\\# budget the verdict must agree exactly; beyond it (reachable only when
|
|
2335
|
-
\\# NATIVE_SDK_SMOKE_BUDGET_MS > 150) the runtime must report the overrun honestly.
|
|
2336
|
-
\\if [ "$first_frame_latency" -le 150000000 ]; then
|
|
2337
|
-
\\ case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'gpu_first_frame_latency_budget_ns=150000000'*'gpu_first_frame_latency_budget_exceeded=0'*'gpu_first_frame_latency_budget_ok=true'*) ;; *) echo "components GPU first frame exceeded the latency budget" >&2; exit 1 ;; esac
|
|
2338
|
-
\\else
|
|
2339
|
-
\\ case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'gpu_first_frame_latency_budget_ns=150000000'*'gpu_first_frame_latency_budget_ok=false'*) ;; *) echo "components runtime did not report the first-frame budget overrun" >&2; exit 1 ;; esac
|
|
2340
|
-
\\fi
|
|
2341
|
-
\\gpu_frame_from_snapshot() {
|
|
2342
|
-
\\ printf '%s\n' "$snapshot" | sed -n 's/.*view @w1\/components-canvas kind=gpu_surface.* gpu_frame=\([0-9][0-9]*\).*/\1/p'
|
|
2313
|
+
\\snapshot="$automation_dir/snapshot.txt"
|
|
2314
|
+
\\widget_id() {
|
|
2315
|
+
\\ role="$1"
|
|
2316
|
+
\\ name="$2"
|
|
2317
|
+
\\ sed -n "s/.*widget @w1\\/components-canvas#\\([0-9][0-9]*\\) role=$role name=\\\"$name\\\".*/\\1/p" "$snapshot" | head -1
|
|
2343
2318
|
\\}
|
|
2344
|
-
\\canvas_revision_from_snapshot() {
|
|
2345
|
-
\\ printf '%s\n' "$snapshot" | sed -n 's/.*view @w1\/components-canvas kind=gpu_surface.* canvas_revision=\([0-9][0-9]*\).*/\1/p'
|
|
2346
|
-
\\}
|
|
2347
|
-
\\snapshot_contains() {
|
|
2348
|
-
\\ case "$snapshot" in *"$1"*) return 0 ;; *) return 1 ;; esac
|
|
2349
|
-
\\}
|
|
2350
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#113 role=checkbox'*'value=1'*'actions=[focus,toggle]'*) ;; *) echo "checkbox widget was not initially selected" >&2; exit 1 ;; esac
|
|
2351
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#114 role=switch'*'value=1'*'actions=[focus,toggle]'*) ;; *) echo "switch widget was not initially selected" >&2; exit 1 ;; esac
|
|
2352
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#116 role=progressbar'*'value=1'*) ;; *) echo "progress widget was missing from the initial snapshot" >&2; exit 1 ;; esac
|
|
2353
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#117 role=tab'*'value=1'*'actions=[focus,select]'*) ;; *) echo "small segmented control was not initially selected" >&2; exit 1 ;; esac
|
|
2354
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#119 role=tab'*'value=0'*'actions=[focus,select]'*) ;; *) echo "large segmented control was not initially available" >&2; exit 1 ;; esac
|
|
2355
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#142 role=menuitem'*'actions=[focus,press,select]'*) ;; *) echo "menu item widget was not initially actionable" >&2; exit 1 ;; esac
|
|
2356
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#86 role=tab'*'actions=[focus,press,select]'*) ;; *) echo "theme toolbar trigger was not initially actionable" >&2; exit 1 ;; esac
|
|
2357
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#83 role=button'*'actions=[focus,press]'*) ;; *) echo "refresh toolbar widget was not initially actionable" >&2; exit 1 ;; esac
|
|
2358
|
-
\\gpu_frame_before="$(gpu_frame_from_snapshot)"
|
|
2359
|
-
\\case "$gpu_frame_before" in ''|*[!0-9]*) gpu_frame_before=0 ;; esac
|
|
2360
|
-
\\gpu_frame_after="$gpu_frame_before"
|
|
2361
|
-
\\canvas_revision_before="$(canvas_revision_from_snapshot)"
|
|
2362
|
-
\\case "$canvas_revision_before" in ''|*[!0-9]*) canvas_revision_before=0 ;; esac
|
|
2363
|
-
\\canvas_revision_after="$canvas_revision_before"
|
|
2364
|
-
\\"$cli" automate widget-click components-canvas 86 >/dev/null 2>&1
|
|
2365
|
-
\\attempts=0
|
|
2366
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2367
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2368
|
-
\\ gpu_frame_after="$(gpu_frame_from_snapshot)"
|
|
2369
|
-
\\ case "$gpu_frame_after" in ''|*[!0-9]*) gpu_frame_after=0 ;; esac
|
|
2370
|
-
\\ canvas_revision_after="$(canvas_revision_from_snapshot)"
|
|
2371
|
-
\\ case "$canvas_revision_after" in ''|*[!0-9]*) canvas_revision_after=0 ;; esac
|
|
2372
|
-
\\ if [ "$gpu_frame_after" -gt "$gpu_frame_before" ] || [ "$canvas_revision_after" -gt "$canvas_revision_before" ]; then
|
|
2373
|
-
\\ if snapshot_contains 'GPU component theme: ' && snapshot_contains ' from native_view. Count 1.' && snapshot_contains 'view @w1/components-canvas kind=gpu_surface' && snapshot_contains 'canvas_frame_gpu_packet_unsupported=0' && snapshot_contains 'canvas_frame_gpu_packet_representable=true'; then break; fi
|
|
2374
|
-
\\ fi
|
|
2375
|
-
\\ attempts=$((attempts + 1))
|
|
2376
|
-
\\ sleep 0.1
|
|
2377
|
-
\\done
|
|
2378
|
-
\\if [ "$gpu_frame_after" -le "$gpu_frame_before" ] && [ "$canvas_revision_after" -le "$canvas_revision_before" ]; then echo "theme automation command did not update the retained GPU canvas" >&2; exit 1; fi
|
|
2379
|
-
\\case "$snapshot" in *'GPU component theme: '*' from native_view. Count 1.'*) ;; *) echo "theme automation command did not update status" >&2; exit 1 ;; esac
|
|
2380
|
-
\\case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) ;; *) echo "theme automation command did not present a packet-renderable GPU frame" >&2; exit 1 ;; esac
|
|
2381
|
-
\\"$cli" automate widget-action components-canvas 111 focus >/dev/null 2>&1
|
|
2382
|
-
\\attempts=0
|
|
2383
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2384
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2385
|
-
\\ case "$snapshot" in *'widget @w1/components-canvas#111 role=textbox'*'focused=true'*'text="native-sdk"'*) break ;; esac
|
|
2386
|
-
\\ attempts=$((attempts + 1))
|
|
2387
|
-
\\ sleep 0.1
|
|
2388
|
-
\\done
|
|
2389
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#111 role=textbox'*'focused=true'*'text="native-sdk"'*) ;; *) echo "widget focus automation did not focus retained text" >&2; exit 1 ;; esac
|
|
2390
|
-
\\"$cli" automate widget-key components-canvas z z >/dev/null 2>&1
|
|
2391
|
-
\\attempts=0
|
|
2392
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2393
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2394
|
-
\\ case "$snapshot" in *'widget @w1/components-canvas#111 role=textbox'*'focused=true'*'text="native-sdkz"'*) break ;; esac
|
|
2395
|
-
\\ attempts=$((attempts + 1))
|
|
2396
|
-
\\ sleep 0.1
|
|
2397
|
-
\\done
|
|
2398
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#111 role=textbox'*'focused=true'*'text="native-sdkz"'*) ;; *) echo "widget keyboard automation did not update retained text" >&2; exit 1 ;; esac
|
|
2399
|
-
\\"$cli" automate widget-key components-canvas tab >/dev/null 2>&1
|
|
2400
|
-
\\attempts=0
|
|
2401
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2402
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2403
|
-
\\ case "$snapshot" in *'widget @w1/components-canvas#112 role=textbox'*'focused=true'*) break ;; esac
|
|
2404
|
-
\\ attempts=$((attempts + 1))
|
|
2405
|
-
\\ sleep 0.1
|
|
2406
|
-
\\done
|
|
2407
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#112 role=textbox'*'focused=true'*) ;; *) echo "widget keyboard automation did not move focus" >&2; exit 1 ;; esac
|
|
2408
|
-
\\"$cli" automate widget-action components-canvas 105 press >/dev/null 2>&1
|
|
2409
|
-
\\attempts=0
|
|
2410
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2411
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2412
|
-
\\ if snapshot_contains 'Keyed icon_button #105.' && snapshot_contains 'widget @w1/components-canvas#105 role=button' && snapshot_contains 'actions=[focus,press]'; then break; fi
|
|
2413
|
-
\\ attempts=$((attempts + 1))
|
|
2414
|
-
\\ sleep 0.1
|
|
2415
|
-
\\done
|
|
2416
|
-
\\if ! snapshot_contains 'Keyed icon_button #105.' || ! snapshot_contains 'widget @w1/components-canvas#105 role=button' || ! snapshot_contains 'actions=[focus,press]'; then echo "icon button automation press did not update status" >&2; exit 1; fi
|
|
2417
|
-
\\"$cli" automate widget-action components-canvas 111 set-text native-engine >/dev/null 2>&1
|
|
2418
|
-
\\attempts=0
|
|
2419
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2420
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2421
|
-
\\ case "$snapshot" in *'widget @w1/components-canvas#111 role=textbox'*'text="native-engine"'*) break ;; esac
|
|
2422
|
-
\\ attempts=$((attempts + 1))
|
|
2423
|
-
\\ sleep 0.1
|
|
2424
|
-
\\done
|
|
2425
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#111 role=textbox'*'text="native-engine"'*) ;; *) echo "text field automation did not update retained text" >&2; exit 1 ;; esac
|
|
2426
|
-
\\"$cli" automate widget-action components-canvas 115 increment >/dev/null 2>&1
|
|
2427
|
-
\\attempts=0
|
|
2428
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2429
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2430
|
-
\\ case "$snapshot" in *'Keyed slider #115: value '*)
|
|
2431
|
-
\\ case "$snapshot" in *'widget @w1/components-canvas#115 role=slider'*'value=0.62'*) ;; *'widget @w1/components-canvas#115 role=slider'*) break ;; esac
|
|
2432
|
-
\\ ;;
|
|
2433
|
-
\\ esac
|
|
2434
|
-
\\ attempts=$((attempts + 1))
|
|
2435
|
-
\\ sleep 0.1
|
|
2436
|
-
\\done
|
|
2437
|
-
\\case "$snapshot" in *'Keyed slider #115: value '*) ;; *) echo "slider automation increment did not update status" >&2; exit 1 ;; esac
|
|
2438
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#115 role=slider'*'value=0.62'*) echo "slider automation increment did not change value" >&2; exit 1 ;; *'widget @w1/components-canvas#115 role=slider'*) ;; *) echo "slider widget was missing after increment" >&2; exit 1 ;; esac
|
|
2439
|
-
\\gpu_frame_before="$(gpu_frame_from_snapshot)"
|
|
2440
|
-
\\case "$gpu_frame_before" in ''|*[!0-9]*) gpu_frame_before=0 ;; esac
|
|
2441
|
-
\\gpu_frame_after="$gpu_frame_before"
|
|
2442
|
-
\\"$cli" automate widget-drag components-canvas 115 0.25 0.82 >/dev/null 2>&1
|
|
2443
|
-
\\attempts=0
|
|
2444
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2445
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2446
|
-
\\ gpu_frame_after="$(gpu_frame_from_snapshot)"
|
|
2447
|
-
\\ case "$gpu_frame_after" in ''|*[!0-9]*) gpu_frame_after=0 ;; esac
|
|
2448
|
-
\\ if [ "$gpu_frame_after" -gt "$gpu_frame_before" ]; then
|
|
2449
|
-
\\ if snapshot_contains 'Clicked slider #115: value 0.82.' && snapshot_contains 'widget @w1/components-canvas#115 role=slider' && { snapshot_contains 'value=0.82' || snapshot_contains 'value=0.819'; }; then
|
|
2450
|
-
\\ case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) break ;; esac
|
|
2451
|
-
\\ fi
|
|
2452
|
-
\\ fi
|
|
2453
|
-
\\ attempts=$((attempts + 1))
|
|
2454
|
-
\\ sleep 0.1
|
|
2455
|
-
\\done
|
|
2456
|
-
\\if [ "$gpu_frame_after" -le "$gpu_frame_before" ]; then echo "slider automation drag did not request a GPU frame" >&2; exit 1; fi
|
|
2457
|
-
\\if ! snapshot_contains 'Clicked slider #115: value 0.82.' || ! snapshot_contains 'widget @w1/components-canvas#115 role=slider' || { ! snapshot_contains 'value=0.82' && ! snapshot_contains 'value=0.819'; }; then echo "slider automation drag did not update retained slider state" >&2; exit 1; fi
|
|
2458
|
-
\\case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) ;; *) echo "slider automation drag did not present an incremental GPU packet without interaction-time uploads" >&2; exit 1 ;; esac
|
|
2459
|
-
\\"$cli" automate widget-action components-canvas 156 press >/dev/null 2>&1
|
|
2460
|
-
\\attempts=0
|
|
2461
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2462
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2463
|
-
\\ if snapshot_contains 'Keyed data_cell #156: selected.' && snapshot_contains 'widget @w1/components-canvas#156 role=gridcell' && snapshot_contains 'focused=true' && snapshot_contains 'value=1'; then break; fi
|
|
2464
|
-
\\ attempts=$((attempts + 1))
|
|
2465
|
-
\\ sleep 0.1
|
|
2466
|
-
\\done
|
|
2467
|
-
\\if ! snapshot_contains 'Keyed data_cell #156: selected.' || ! snapshot_contains 'widget @w1/components-canvas#156 role=gridcell' || ! snapshot_contains 'focused=true' || ! snapshot_contains 'value=1'; then echo "grid cell automation press did not focus and report status" >&2; exit 1; fi
|
|
2468
|
-
\\gpu_frame_before="$(gpu_frame_from_snapshot)"
|
|
2469
|
-
\\case "$gpu_frame_before" in ''|*[!0-9]*) gpu_frame_before=0 ;; esac
|
|
2470
|
-
\\gpu_frame_after="$gpu_frame_before"
|
|
2471
|
-
\\"$cli" automate widget-click components-canvas 119 >/dev/null 2>&1
|
|
2472
|
-
\\attempts=0
|
|
2473
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2474
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2475
|
-
\\ gpu_frame_after="$(gpu_frame_from_snapshot)"
|
|
2476
|
-
\\ case "$gpu_frame_after" in ''|*[!0-9]*) gpu_frame_after=0 ;; esac
|
|
2477
|
-
\\ if [ "$gpu_frame_after" -gt "$gpu_frame_before" ]; then
|
|
2478
|
-
\\ if snapshot_contains 'Clicked segmented_control #119: selected.' && snapshot_contains 'widget @w1/components-canvas#117 role=tab' && snapshot_contains 'value=0' && snapshot_contains 'widget @w1/components-canvas#119 role=tab' && snapshot_contains 'focused=true' && snapshot_contains 'value=1'; then
|
|
2479
|
-
\\ case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) break ;; esac
|
|
2480
|
-
\\ fi
|
|
2481
|
-
\\ fi
|
|
2482
|
-
\\ attempts=$((attempts + 1))
|
|
2483
|
-
\\ sleep 0.1
|
|
2484
|
-
\\done
|
|
2485
|
-
\\if [ "$gpu_frame_after" -le "$gpu_frame_before" ]; then echo "segmented control automation click did not request a GPU frame" >&2; exit 1; fi
|
|
2486
|
-
\\if ! snapshot_contains 'Clicked segmented_control #119: selected.' || ! snapshot_contains 'widget @w1/components-canvas#117 role=tab' || ! snapshot_contains 'value=0' || ! snapshot_contains 'widget @w1/components-canvas#119 role=tab' || ! snapshot_contains 'focused=true' || ! snapshot_contains 'value=1'; then echo "segmented control automation click did not update retained selection state" >&2; exit 1; fi
|
|
2487
|
-
\\case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) ;; *) echo "segmented control automation click did not present an incremental GPU packet without interaction-time uploads" >&2; exit 1 ;; esac
|
|
2488
|
-
\\# The catalog's project menu is an ACTIONS menu (no sibling declares a
|
|
2489
|
-
\\# committed row), so automation select mints NO selection: value
|
|
2490
|
-
\\# stays 0. Automation focus follows the pointer contract (rows take
|
|
2491
|
-
\\# focus QUIETLY, no visible affordance), so nothing repaints and no
|
|
2492
|
-
\\# frame is requested — the republished snapshot alone carries the
|
|
2493
|
-
\\# focus move. A picker menu would mint value=1 and repaint; the
|
|
2494
|
-
\\# select specimen's committed-row tests cover that register.
|
|
2495
|
-
\\"$cli" automate widget-action components-canvas 142 select >/dev/null 2>&1
|
|
2496
2319
|
\\attempts=0
|
|
2497
2320
|
\\while [ "$attempts" -lt 50 ]; do
|
|
2498
|
-
\\
|
|
2499
|
-
\\ case "$
|
|
2321
|
+
\\ ready_snapshot="$(cat "$snapshot" 2>/dev/null || true)"
|
|
2322
|
+
\\ case "$ready_snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'gpu_nonblank=true'*'canvas_frame_gpu_packet_representable=true'*) break ;; esac
|
|
2500
2323
|
\\ attempts=$((attempts + 1))
|
|
2501
2324
|
\\ sleep 0.1
|
|
2502
2325
|
\\done
|
|
2503
|
-
\\
|
|
2504
|
-
\\case "$
|
|
2505
|
-
\\"$
|
|
2506
|
-
\\
|
|
2507
|
-
\\
|
|
2508
|
-
\\
|
|
2509
|
-
\\
|
|
2510
|
-
\\
|
|
2511
|
-
\\
|
|
2326
|
+
\\case "$ready_snapshot" in *'window @w1 "Native SDK GPU Components"'*) ;; *) echo "gpu-components window was missing" >&2; exit 1 ;; esac
|
|
2327
|
+
\\case "$ready_snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'gpu_nonblank=true'*'canvas_frame_gpu_packet_representable=true'*) ;; *) echo "component gallery GPU surface was not ready" >&2; exit 1 ;; esac
|
|
2328
|
+
\\case "$ready_snapshot" in *'view @w1/main kind=webview'*) echo "component gallery created an implicit WebView" >&2; exit 1 ;; *) ;; esac
|
|
2329
|
+
\\"$cli" automate assert 'role=tree name="Components"' 'role=treeitem name="Components".*state=\[expanded\]' 'role=treeitem name="Accordion".*state=\[selected\]' 'role=group name="Details".*state=\[selected,expanded\]' 'name="Accordion details are visible. The model owns this expanded state."'
|
|
2330
|
+
\\"$cli" automate assert 'role=group name="Theme"' 'role=button name="Default".*state=\[selected\]' 'role=button name="Geist"'
|
|
2331
|
+
\\"$cli" automate screenshot components-canvas >/dev/null 2>&1
|
|
2332
|
+
\\cp "$automation_dir/screenshot-components-canvas.png" "$automation_dir/screenshot-components-house.png"
|
|
2333
|
+
\\rm -f "$automation_dir/screenshot-components-canvas.png"
|
|
2334
|
+
\\theme_geist_id="$(widget_id button Geist)"
|
|
2335
|
+
\\case "$theme_geist_id" in ''|*[!0-9]*) echo "Geist theme toggle id was missing" >&2; exit 1 ;; esac
|
|
2336
|
+
\\"$cli" automate widget-click components-canvas "$theme_geist_id" >/dev/null 2>&1
|
|
2337
|
+
\\"$cli" automate assert 'role=button name="Geist".*state=\[[^]]*selected'
|
|
2338
|
+
\\"$cli" automate screenshot components-canvas >/dev/null 2>&1
|
|
2339
|
+
\\cp "$automation_dir/screenshot-components-canvas.png" "$automation_dir/screenshot-components-geist.png"
|
|
2340
|
+
\\test -s "$automation_dir/screenshot-components-house.png" || { echo "house theme screenshot was empty" >&2; exit 1; }
|
|
2341
|
+
\\test -s "$automation_dir/screenshot-components-geist.png" || { echo "Geist theme screenshot was empty" >&2; exit 1; }
|
|
2342
|
+
\\if cmp -s "$automation_dir/screenshot-components-house.png" "$automation_dir/screenshot-components-geist.png"; then echo "theme toggle did not change rendered pixels" >&2; exit 1; fi
|
|
2343
|
+
\\accordion_id="$(widget_id group Details)"
|
|
2344
|
+
\\case "$accordion_id" in ''|*[!0-9]*) echo "accordion id was missing" >&2; exit 1 ;; esac
|
|
2345
|
+
\\"$cli" automate widget-action components-canvas "$accordion_id" toggle >/dev/null 2>&1
|
|
2346
|
+
\\"$cli" automate assert --absent 'name="Accordion details are visible. The model owns this expanded state."'
|
|
2347
|
+
\\"$cli" automate widget-action components-canvas "$accordion_id" toggle >/dev/null 2>&1
|
|
2348
|
+
\\"$cli" automate assert 'name="Accordion details are visible. The model owns this expanded state."'
|
|
2349
|
+
\\accordion_row_id="$(widget_id treeitem Accordion)"
|
|
2350
|
+
\\case "$accordion_row_id" in ''|*[!0-9]*) echo "accordion navigation id was missing" >&2; exit 1 ;; esac
|
|
2351
|
+
\\"$cli" automate widget-action components-canvas "$accordion_row_id" focus >/dev/null 2>&1
|
|
2352
|
+
\\arrow_count=0
|
|
2353
|
+
\\while [ "$arrow_count" -lt 33 ]; do
|
|
2354
|
+
\\ "$cli" automate widget-key components-canvas arrowdown >/dev/null 2>&1
|
|
2355
|
+
\\ arrow_count=$((arrow_count + 1))
|
|
2512
2356
|
\\done
|
|
2513
|
-
\\
|
|
2514
|
-
\\
|
|
2515
|
-
\\case "$
|
|
2516
|
-
\\
|
|
2517
|
-
\\"$cli" automate widget-
|
|
2518
|
-
\\
|
|
2519
|
-
\\
|
|
2520
|
-
\\
|
|
2521
|
-
\\
|
|
2522
|
-
\\
|
|
2523
|
-
\\
|
|
2524
|
-
\\
|
|
2525
|
-
\\
|
|
2526
|
-
\\
|
|
2527
|
-
\\
|
|
2528
|
-
\\
|
|
2529
|
-
\\
|
|
2530
|
-
\\
|
|
2531
|
-
\\
|
|
2532
|
-
\\
|
|
2533
|
-
\\
|
|
2534
|
-
\\"$cli" automate widget-
|
|
2535
|
-
\\
|
|
2536
|
-
\\
|
|
2537
|
-
\\
|
|
2538
|
-
\\
|
|
2539
|
-
\\
|
|
2540
|
-
\\
|
|
2541
|
-
\\
|
|
2542
|
-
\\
|
|
2543
|
-
\\
|
|
2544
|
-
\\
|
|
2545
|
-
\\
|
|
2546
|
-
\\"$cli" automate widget-
|
|
2547
|
-
\\
|
|
2548
|
-
\\
|
|
2549
|
-
\\
|
|
2550
|
-
\\
|
|
2551
|
-
\\
|
|
2552
|
-
\\
|
|
2553
|
-
\\
|
|
2554
|
-
\\
|
|
2555
|
-
\\
|
|
2556
|
-
\\
|
|
2557
|
-
\\
|
|
2558
|
-
\\
|
|
2559
|
-
\\
|
|
2560
|
-
\\
|
|
2561
|
-
\\
|
|
2562
|
-
\\
|
|
2563
|
-
\\
|
|
2564
|
-
\\
|
|
2565
|
-
\\
|
|
2566
|
-
\\
|
|
2567
|
-
\\case "$
|
|
2568
|
-
\\
|
|
2569
|
-
\\"$cli" automate
|
|
2570
|
-
\\
|
|
2571
|
-
\\
|
|
2572
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2573
|
-
\\ gpu_frame_after="$(gpu_frame_from_snapshot)"
|
|
2574
|
-
\\ case "$gpu_frame_after" in ''|*[!0-9]*) gpu_frame_after=0 ;; esac
|
|
2575
|
-
\\ canvas_revision_after="$(canvas_revision_from_snapshot)"
|
|
2576
|
-
\\ case "$canvas_revision_after" in ''|*[!0-9]*) canvas_revision_after=0 ;; esac
|
|
2577
|
-
\\ if [ "$gpu_frame_after" -gt "$gpu_frame_before" ] || [ "$canvas_revision_after" -gt "$canvas_revision_before" ]; then
|
|
2578
|
-
\\ if snapshot_contains 'Keyed list #120: offset 56.' && snapshot_contains 'widget @w1/components-canvas#120 role=list' && snapshot_contains 'scroll=[offset=56,viewport=56,content=168]'; then
|
|
2579
|
-
\\ case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) break ;; esac
|
|
2580
|
-
\\ fi
|
|
2581
|
-
\\ fi
|
|
2582
|
-
\\ attempts=$((attempts + 1))
|
|
2583
|
-
\\ sleep 0.1
|
|
2584
|
-
\\done
|
|
2585
|
-
\\if [ "$gpu_frame_after" -le "$gpu_frame_before" ] && [ "$canvas_revision_after" -le "$canvas_revision_before" ]; then echo "list automation increment did not update the retained GPU canvas" >&2; exit 1; fi
|
|
2586
|
-
\\if ! snapshot_contains 'Keyed list #120: offset 56.' || ! snapshot_contains 'widget @w1/components-canvas#120 role=list' || ! snapshot_contains 'scroll=[offset=56,viewport=56,content=168]'; then echo "list automation increment did not update retained scroll semantics" >&2; exit 1; fi
|
|
2587
|
-
\\case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) ;; *) echo "list automation increment did not present an incremental GPU packet without interaction-time uploads" >&2; exit 1 ;; esac
|
|
2588
|
-
\\gpu_frame_before="$(gpu_frame_from_snapshot)"
|
|
2589
|
-
\\case "$gpu_frame_before" in ''|*[!0-9]*) gpu_frame_before=0 ;; esac
|
|
2590
|
-
\\gpu_frame_after="$gpu_frame_before"
|
|
2591
|
-
\\canvas_revision_before="$(canvas_revision_from_snapshot)"
|
|
2592
|
-
\\case "$canvas_revision_before" in ''|*[!0-9]*) canvas_revision_before=0 ;; esac
|
|
2593
|
-
\\canvas_revision_after="$canvas_revision_before"
|
|
2594
|
-
\\"$cli" automate widget-action components-canvas 150 increment >/dev/null 2>&1
|
|
2595
|
-
\\attempts=0
|
|
2596
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2597
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2598
|
-
\\ gpu_frame_after="$(gpu_frame_from_snapshot)"
|
|
2599
|
-
\\ case "$gpu_frame_after" in ''|*[!0-9]*) gpu_frame_after=0 ;; esac
|
|
2600
|
-
\\ canvas_revision_after="$(canvas_revision_from_snapshot)"
|
|
2601
|
-
\\ case "$canvas_revision_after" in ''|*[!0-9]*) canvas_revision_after=0 ;; esac
|
|
2602
|
-
\\ if [ "$gpu_frame_after" -gt "$gpu_frame_before" ] || [ "$canvas_revision_after" -gt "$canvas_revision_before" ]; then
|
|
2603
|
-
\\ if snapshot_contains 'Keyed table #150: offset 56.' && snapshot_contains 'widget @w1/components-canvas#150 role=grid' && snapshot_contains 'scroll=[offset=56,viewport=28,content=140]'; then
|
|
2604
|
-
\\ case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) break ;; esac
|
|
2605
|
-
\\ fi
|
|
2606
|
-
\\ fi
|
|
2607
|
-
\\ attempts=$((attempts + 1))
|
|
2608
|
-
\\ sleep 0.1
|
|
2609
|
-
\\done
|
|
2610
|
-
\\if [ "$gpu_frame_after" -le "$gpu_frame_before" ] && [ "$canvas_revision_after" -le "$canvas_revision_before" ]; then echo "data grid automation increment did not update the retained GPU canvas" >&2; exit 1; fi
|
|
2611
|
-
\\if ! snapshot_contains 'Keyed table #150: offset 56.' || ! snapshot_contains 'widget @w1/components-canvas#150 role=grid' || ! snapshot_contains 'scroll=[offset=56,viewport=28,content=140]'; then echo "data grid automation increment did not update retained scroll semantics" >&2; exit 1; fi
|
|
2612
|
-
\\case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) ;; *) echo "data grid automation increment did not present an incremental GPU packet without interaction-time uploads" >&2; exit 1 ;; esac
|
|
2613
|
-
\\gpu_frame_before="$(gpu_frame_from_snapshot)"
|
|
2614
|
-
\\case "$gpu_frame_before" in ''|*[!0-9]*) gpu_frame_before=0 ;; esac
|
|
2615
|
-
\\gpu_frame_after="$gpu_frame_before"
|
|
2616
|
-
\\canvas_revision_before="$(canvas_revision_from_snapshot)"
|
|
2617
|
-
\\case "$canvas_revision_before" in ''|*[!0-9]*) canvas_revision_before=0 ;; esac
|
|
2618
|
-
\\canvas_revision_after="$canvas_revision_before"
|
|
2619
|
-
\\"$cli" automate widget-wheel components-canvas 130 20 >/dev/null 2>&1
|
|
2620
|
-
\\attempts=0
|
|
2621
|
-
\\while [ "$attempts" -lt 50 ]; do
|
|
2622
|
-
\\ snapshot="$(cat "$automation_dir/snapshot.txt" 2>/dev/null || true)"
|
|
2623
|
-
\\ gpu_frame_after="$(gpu_frame_from_snapshot)"
|
|
2624
|
-
\\ case "$gpu_frame_after" in ''|*[!0-9]*) gpu_frame_after=0 ;; esac
|
|
2625
|
-
\\ canvas_revision_after="$(canvas_revision_from_snapshot)"
|
|
2626
|
-
\\ case "$canvas_revision_after" in ''|*[!0-9]*) canvas_revision_after=0 ;; esac
|
|
2627
|
-
\\ if [ "$gpu_frame_after" -gt "$gpu_frame_before" ] || [ "$canvas_revision_after" -gt "$canvas_revision_before" ]; then
|
|
2628
|
-
\\ case "$snapshot" in *'widget @w1/components-canvas#130 role=group'*'scroll=[offset=84,viewport=56,content=140]'*)
|
|
2629
|
-
\\ case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) break ;; esac
|
|
2630
|
-
\\ ;;
|
|
2631
|
-
\\ esac
|
|
2632
|
-
\\ fi
|
|
2633
|
-
\\ attempts=$((attempts + 1))
|
|
2634
|
-
\\ sleep 0.1
|
|
2635
|
-
\\done
|
|
2636
|
-
\\if [ "$gpu_frame_after" -le "$gpu_frame_before" ] && [ "$canvas_revision_after" -le "$canvas_revision_before" ]; then echo "scroll automation wheel did not update the retained GPU canvas" >&2; exit 1; fi
|
|
2637
|
-
\\case "$snapshot" in *'widget @w1/components-canvas#130 role=group'*'scroll=[offset=84,viewport=56,content=140]'*) ;; *) echo "scroll automation wheel did not update retained scroll semantics" >&2; exit 1 ;; esac
|
|
2638
|
-
\\case "$snapshot" in *'view @w1/components-canvas kind=gpu_surface'*'canvas_frame_full_repaint=false'*'canvas_frame_pipeline_uploads=0'*'canvas_frame_image_uploads=0'*'canvas_frame_glyph_uploads=0'*'canvas_frame_text_uploads=0'*'canvas_frame_gpu_packet_unsupported=0'*'canvas_frame_gpu_packet_representable=true'*) ;; *) echo "scroll automation wheel did not present an incremental GPU packet without interaction-time uploads" >&2; exit 1 ;; esac
|
|
2639
|
-
\\input_timestamp="$(printf '%s\n' "$snapshot" | sed -n 's/.*view @w1\/components-canvas kind=gpu_surface.* gpu_input_timestamp_ns=\([0-9][0-9]*\).*/\1/p')"
|
|
2640
|
-
\\case "$input_timestamp" in ''|*[!0-9]*) echo "components GPU input timestamp was missing after widget interaction" >&2; exit 1 ;; esac
|
|
2641
|
-
\\if [ "$input_timestamp" -le 0 ]; then echo "components GPU input timestamp was not recorded" >&2; exit 1; fi
|
|
2642
|
-
\\input_latency="$(printf '%s\n' "$snapshot" | sed -n 's/.*view @w1\/components-canvas kind=gpu_surface.* gpu_input_latency_ns=\([0-9][0-9]*\).*/\1/p')"
|
|
2643
|
-
\\case "$input_latency" in ''|*[!0-9]*) echo "components GPU input latency was missing after widget interaction" >&2; exit 1 ;; esac
|
|
2644
|
-
\\# gpu_input_latency now stamps at the RESPONDING present's completion
|
|
2645
|
-
\\# (input to glass), which legitimately spans the paced render wait —
|
|
2646
|
-
\\# up to a couple of display intervals while animations hold the paced
|
|
2647
|
-
\\# loop. Assert an explicit input-to-glass bound (the perf harness
|
|
2648
|
-
\\# budgets the same channel at 100 ms) instead of the one-interval
|
|
2649
|
-
\\# budget flag the old completion-channel stamp happened to satisfy.
|
|
2650
|
-
\\if [ "$input_latency" -le 0 ] || [ "$input_latency" -gt 100000000 ]; then echo "components GPU input-to-glass latency was implausible: $input_latency ns" >&2; exit 1; fi
|
|
2357
|
+
\\"$cli" automate assert 'role=treeitem name="Tree".*state=\[[^]]*selected' 'role=text name="Tree"'
|
|
2358
|
+
\\scroll_line="$(grep 'name="Scrollable component tree"' "$snapshot" | head -1)"
|
|
2359
|
+
\\case "$scroll_line" in *'scroll=[offset=0,'*) echo "tree selection did not scroll the final row into view" >&2; exit 1 ;; *'scroll=[offset='*) ;; *) echo "component tree scroll semantics were missing" >&2; exit 1 ;; esac
|
|
2360
|
+
\\"$cli" automate widget-key components-canvas arrowleft >/dev/null 2>&1
|
|
2361
|
+
\\"$cli" automate widget-key components-canvas arrowleft >/dev/null 2>&1
|
|
2362
|
+
\\"$cli" automate assert --absent 'role=treeitem name="Accordion"'
|
|
2363
|
+
\\"$cli" automate widget-key components-canvas arrowright >/dev/null 2>&1
|
|
2364
|
+
\\"$cli" automate assert 'role=treeitem name="Accordion"'
|
|
2365
|
+
\\dropdown_row_id="$(widget_id treeitem "Dropdown Menu")"
|
|
2366
|
+
\\case "$dropdown_row_id" in ''|*[!0-9]*) echo "dropdown navigation id was missing" >&2; exit 1 ;; esac
|
|
2367
|
+
\\"$cli" automate widget-action components-canvas "$dropdown_row_id" press >/dev/null 2>&1
|
|
2368
|
+
\\"$cli" automate assert 'role=text name="Dropdown Menu"' 'role=button name="Actions"'
|
|
2369
|
+
\\actions_id="$(widget_id button Actions)"
|
|
2370
|
+
\\case "$actions_id" in ''|*[!0-9]*) echo "dropdown trigger id was missing" >&2; exit 1 ;; esac
|
|
2371
|
+
\\"$cli" automate widget-click components-canvas "$actions_id" >/dev/null 2>&1
|
|
2372
|
+
\\"$cli" automate assert 'role=menu name=""' 'role=menuitem name="Duplicate"' 'role=menuitem name="Rename"' 'role=menuitem name="Download"' 'role=menuitem name="Delete"'
|
|
2373
|
+
\\"$cli" automate widget-key components-canvas arrowdown >/dev/null 2>&1
|
|
2374
|
+
\\"$cli" automate widget-key components-canvas arrowdown >/dev/null 2>&1
|
|
2375
|
+
\\"$cli" automate widget-key components-canvas enter >/dev/null 2>&1
|
|
2376
|
+
\\"$cli" automate assert --absent 'role=menu name=""' 'role=menuitem name="Duplicate"'
|
|
2377
|
+
\\"$cli" automate assert 'role=text name="Last action: Rename"'
|
|
2378
|
+
\\"$cli" automate widget-click components-canvas "$actions_id" >/dev/null 2>&1
|
|
2379
|
+
\\"$cli" automate widget-key components-canvas arrowup >/dev/null 2>&1
|
|
2380
|
+
\\"$cli" automate widget-key components-canvas enter >/dev/null 2>&1
|
|
2381
|
+
\\"$cli" automate assert 'role=text name="Last action: Delete"'
|
|
2382
|
+
\\select_row_id="$(widget_id treeitem Select)"
|
|
2383
|
+
\\case "$select_row_id" in ''|*[!0-9]*) echo "select navigation id was missing" >&2; exit 1 ;; esac
|
|
2384
|
+
\\"$cli" automate widget-action components-canvas "$select_row_id" press >/dev/null 2>&1
|
|
2385
|
+
\\"$cli" automate assert 'role=text name="Select"' 'role=button name="Environment selector"'
|
|
2386
|
+
\\select_id="$(widget_id button "Environment selector")"
|
|
2387
|
+
\\case "$select_id" in ''|*[!0-9]*) echo "select trigger id was missing" >&2; exit 1 ;; esac
|
|
2388
|
+
\\"$cli" automate widget-click components-canvas "$select_id" >/dev/null 2>&1
|
|
2389
|
+
\\"$cli" automate assert 'role=menuitem name="Production".*state=\[selected\]' 'role=menuitem name="Staging"' 'role=menuitem name="Development"'
|
|
2390
|
+
\\"$cli" automate widget-key components-canvas arrowdown >/dev/null 2>&1
|
|
2391
|
+
\\"$cli" automate widget-key components-canvas arrowdown >/dev/null 2>&1
|
|
2392
|
+
\\"$cli" automate widget-key components-canvas enter >/dev/null 2>&1
|
|
2393
|
+
\\"$cli" automate assert --absent 'role=menu name=""'
|
|
2394
|
+
\\"$cli" automate widget-click components-canvas "$select_id" >/dev/null 2>&1
|
|
2395
|
+
\\"$cli" automate assert 'role=menuitem name="Staging".*state=\[selected\]'
|
|
2396
|
+
\\"$cli" automate widget-key components-canvas arrowup >/dev/null 2>&1
|
|
2397
|
+
\\"$cli" automate widget-key components-canvas arrowup >/dev/null 2>&1
|
|
2398
|
+
\\"$cli" automate widget-key components-canvas enter >/dev/null 2>&1
|
|
2399
|
+
\\"$cli" automate widget-click components-canvas "$select_id" >/dev/null 2>&1
|
|
2400
|
+
\\"$cli" automate assert 'role=menuitem name="Production".*state=\[selected\]'
|
|
2401
|
+
\\"$cli" automate widget-key components-canvas escape >/dev/null 2>&1
|
|
2402
|
+
\\"$cli" automate assert --absent 'role=menu name=""'
|
|
2403
|
+
\\navigation_scroll_id="$(widget_id group "Scrollable component tree")"
|
|
2404
|
+
\\case "$navigation_scroll_id" in ''|*[!0-9]*) echo "component navigation scroll id was missing" >&2; exit 1 ;; esac
|
|
2405
|
+
\\"$cli" automate widget-wheel components-canvas "$navigation_scroll_id" 220 >/dev/null 2>&1
|
|
2406
|
+
\\switch_row_id="$(widget_id treeitem Switch)"
|
|
2407
|
+
\\case "$switch_row_id" in ''|*[!0-9]*) echo "switch navigation id was missing" >&2; exit 1 ;; esac
|
|
2408
|
+
\\"$cli" automate widget-action components-canvas "$switch_row_id" press >/dev/null 2>&1
|
|
2409
|
+
\\"$cli" automate assert 'role=text name="Switch"' 'role=switch name="Notifications".*value=1' 'role=switch name="Airplane mode".*value=0'
|
|
2410
|
+
\\airplane_id="$(widget_id switch "Airplane mode")"
|
|
2411
|
+
\\case "$airplane_id" in ''|*[!0-9]*) echo "airplane mode switch id was missing" >&2; exit 1 ;; esac
|
|
2412
|
+
\\"$cli" automate widget-click components-canvas "$airplane_id" >/dev/null 2>&1
|
|
2413
|
+
\\"$cli" automate assert 'role=switch name="Notifications".*value=1' 'role=switch name="Airplane mode".*value=1'
|
|
2414
|
+
\\"$cli" automate screenshot components-canvas >/dev/null 2>&1
|
|
2415
|
+
\\test -s "$automation_dir/screenshot-components-canvas.png" || { echo "component gallery screenshot was empty" >&2; exit 1; }
|
|
2651
2416
|
\\echo "gpu-components smoke ok"
|
|
2652
2417
|
,
|
|
2653
2418
|
"sh",
|
|
@@ -2892,19 +2657,28 @@ pub fn build(b: *std.Build) void {
|
|
|
2892
2657
|
const notarize_step = b.step("notarize", "Package, sign with identity, and notarize for macOS distribution");
|
|
2893
2658
|
notarize_step.dependOn(¬arize_run.step);
|
|
2894
2659
|
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
,
|
|
2660
|
+
// Run the same styled archive path app developers get from
|
|
2661
|
+
// `native package --archive`: generated/custom background, Applications
|
|
2662
|
+
// alias, Finder geometry, then compressed UDZO output. Keeping this as a
|
|
2663
|
+
// CLI invocation means the repository helper cannot drift into producing
|
|
2664
|
+
// a plainer image than the product surface it documents.
|
|
2665
|
+
const dmg_run = b.addRunArtifact(host_cli_exe);
|
|
2666
|
+
dmg_run.addArgs(&.{
|
|
2667
|
+
"package",
|
|
2668
|
+
"--target",
|
|
2669
|
+
"macos",
|
|
2670
|
+
"--output",
|
|
2671
|
+
b.fmt("zig-out/package/native-sdk-{s}-macos-{s}.app", .{ package_version, optimize_name }),
|
|
2672
|
+
"--binary",
|
|
2904
2673
|
});
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2674
|
+
dmg_run.addFileArg(embed_lib.getEmittedBin());
|
|
2675
|
+
dmg_run.addArgs(&.{ "--manifest", "app.zon", "--assets", "assets", "--optimize", optimize_name, "--signing", @tagName(signing_mode), "--web-engine", @tagName(web_engine), "--cef-dir", cef_dir, "--archive" });
|
|
2676
|
+
if (cef_auto_install) dmg_run.addArg("--cef-auto-install");
|
|
2677
|
+
dmg_run.step.dependOn(&embed_lib.step);
|
|
2678
|
+
dmg_run.step.dependOn(&bundle_run.step);
|
|
2679
|
+
dmg_run.has_side_effects = true;
|
|
2680
|
+
const dmg_step = b.step("dmg", "Create a styled macOS .dmg with a drag-to-Applications layout");
|
|
2681
|
+
dmg_step.dependOn(&dmg_run.step);
|
|
2908
2682
|
|
|
2909
2683
|
const cef_bundle_script = b.addSystemCommand(&.{
|
|
2910
2684
|
"sh", "-c",
|
|
@@ -3160,18 +2934,18 @@ fn tsCoreE2eArtifact(
|
|
|
3160
2934
|
const scaffold_ide_mod = module(b, target, optimize, "tests/ts-core/scaffold_ide_e2e_tests.zig");
|
|
3161
2935
|
scaffold_ide_mod.addImport("tooling", tooling_mod);
|
|
3162
2936
|
|
|
3163
|
-
// The
|
|
2937
|
+
// The Chatbot example's core and markup, tested the same way:
|
|
3164
2938
|
// the chat client for an OpenAI-compatible endpoint, driven through
|
|
3165
2939
|
// the fake fetch feed (no network) with its shipping markup.
|
|
3166
2940
|
const ai_chat_fixture = externalCoreFixtureModule(b, target, optimize, node, corewire_exe, .{
|
|
3167
|
-
.entry = "examples/
|
|
3168
|
-
.src_dir = b.path("examples/
|
|
2941
|
+
.entry = "examples/chatbot/src/core.ts",
|
|
2942
|
+
.src_dir = b.path("examples/chatbot/src"),
|
|
3169
2943
|
.name = "ai_chat_core",
|
|
3170
2944
|
});
|
|
3171
2945
|
const ai_chat_core_mod = ai_chat_fixture.module;
|
|
3172
2946
|
const ai_chat_stage = b.addWriteFiles();
|
|
3173
2947
|
const ai_chat_root = ai_chat_stage.addCopyFile(b.path("tests/ts-core/ai_chat_e2e_tests.zig"), "ai_chat_e2e_tests.zig");
|
|
3174
|
-
_ = ai_chat_stage.addCopyFile(b.path("examples/
|
|
2948
|
+
_ = ai_chat_stage.addCopyFile(b.path("examples/chatbot/src/app.native"), "app.native");
|
|
3175
2949
|
const ai_chat_mod = b.createModule(.{
|
|
3176
2950
|
.root_source_file = ai_chat_root,
|
|
3177
2951
|
.target = target,
|