also looking at this
feat(ios): AR moves to Zig — ratchet 18 -> 13
#126
5 files
+1480
-10
| @@ -454,6 +454,14 @@ pub fn gateFor(action: []const u8) ?Feature { | ||
| 454 | 454 | // and adding one here would strand a track on disk with no action able |
| 455 | 455 | // to reach it. |
| 456 | 456 | .{ "startLocationRecording", .geolocation }, |
| 457 | // All five AR actions carry the same `config.enableAR` guard in the | |
| 458 | // spec (`CraftApp.swift:1210-1249`), unlike the recorder where only | |
| 459 | // the start is gated. | |
| 460 | .{ "startAR", .ar }, | |
| 461 | .{ "stopAR", .ar }, | |
| 462 | .{ "placeARObject", .ar }, | |
| 463 | .{ "removeARObject", .ar }, | |
| 464 | .{ "getARPlanes", .ar }, | |
| 457 | 465 | }; |
| 458 | 466 | inline for (table) |entry| { |
| 459 | 467 | if (std.mem.eql(u8, action, entry[0])) return entry[1]; |
| @@ -637,10 +645,12 @@ test "gateFor answers for a served action and stays quiet for the rest" { | ||
| 637 | 645 | try testing.expectEqual(Feature.camera, gateFor("pickImage").?); |
| 638 | 646 | try testing.expectEqual(Feature.secure_storage, gateFor("secureSet").?); |
| 639 | 647 | |
| 640 | // `openURL` is served and ungated in the spec; `startAR` is gated but not | |
| 641 | // served here, so the shim's own gate applies and this must not answer. | |
| 648 | // `openURL` is served and ungated in the spec, so this must not answer for | |
| 649 | // it. `startAR` used to be here for the opposite reason — gated but still on | |
| 650 | // the shim — and now that Zig serves it, the gate has to come from here. | |
| 642 | 651 | try testing.expect(gateFor("openURL") == null); |
| 643 | try testing.expect(gateFor("startAR") == null); | |
| 652 | try testing.expectEqual(Feature.ar, gateFor("startAR").?); | |
| 653 | try testing.expectEqual(Feature.ar, gateFor("getARPlanes").?); | |
| 644 | 654 | try testing.expect(gateFor("") == null); |
| 645 | 655 | } |
| 646 | 656 | |