ReviewOS

also looking at this

craft-native/craft

fix(mobile): preserve native editing, navigation, and durable media requests

#369
Merged chris wants to merge codex/native-vertical-scroll-tab-swipes into main
36 files +864 -185

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

packages/zig/src/ios_config.zigmodified+14-1
Changes to packages/zig/src/ios_config.zig
@@ -174,7 +174,7 @@ pub const Flags = std.EnumSet(Feature);
174174const string_keys = [_][]const u8{ "appName", "bundleId", "renderer", "backgroundColor" };
175175const extra_bool_keys = [_][]const u8{"darkMode"};
176176const array_of_string_keys = [_][]const u8{ "associatedDomains", "trustedOrigins" };
177const optional_string_keys = [_][]const u8{ "appearance", "backgroundColorDark", "devServerURL", "nativeApp", "sessionTokenKey" };
177const optional_string_keys = [_][]const u8{ "appearance", "backgroundColorDark", "devServerURL", "nativeApp", "nativeScriptThread", "sessionTokenKey" };
178178const optional_bool_keys = [_][]const u8{ "swipeNavigation", "limitNavigationsToAppBoundDomains", "allowsLinkPreview", "keyboardAccessory", "disableZoom" };
179179/// Swift `Double`s with a default. Any JSON number decodes; a string or a
180180/// boolean throws.
@@ -781,6 +781,19 @@ test "optional fields are type-checked when present" {
781781 }
782782}
783783
784test "the native script thread matches Swift optional string decoding" {
785 inline for (.{ "\"nativeScriptThread\":\"main\"", "\"nativeScriptThread\":\"background\"", "\"nativeScriptThread\":null" }) |good| {
786 const json = try completeConfig(testing.allocator, good);
787 defer testing.allocator.free(json);
788 try testing.expectEqual(std.enums.values(Feature).len, parse(testing.allocator, json).count());
789 }
790 inline for (.{ "\"nativeScriptThread\":true", "\"nativeScriptThread\":1", "\"nativeScriptThread\":[]" }) |bad| {
791 const json = try completeConfig(testing.allocator, bad);
792 defer testing.allocator.free(json);
793 try testing.expectEqual(@as(usize, 0), parse(testing.allocator, json).count());
794 }
795}
796
784797test "number fields take any JSON number and nothing else" {
785798 // `Double` decodes an integer as readily as a fraction; a quoted number
786799 // or a boolean throws. Checked against `swiftc`.