ReviewOS

also looking at this

craft-native/craft

feat(maps): add key-free native Android maps and shared map controls

#363
Merged chris wants to merge codex/wildloop-native-map-providers into main
28 files +1857 -481

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/ios/fixtures/native-screen/NativeLayoutUnitTests.swiftmodified+23-0
Changes to packages/ios/fixtures/native-screen/NativeLayoutUnitTests.swift
@@ -562,6 +562,29 @@ final class NativeLayoutUnitTests: XCTestCase {
562562 XCTAssertEqual(after.maxX, before.maxX, accuracy: 1, "absolute sibling changed horizontal position")
563563 }
564564
565 func testAbsoluteChildrenHonorSizeBoundsAndKeepTheirInsetAnchors() throws {
566 let controller = screen(box("root", style: ["height": 240], [
567 ["id": "expand", "type": "Button", "props": ["testID": "expand", "title": "+"],
568 "style": ["position": "absolute", "top": 12, "right": 12, "minWidth": 44, "minHeight": 44]],
569 box("bounded", style: ["position": "absolute", "right": 12, "bottom": 12, "width": 300, "height": 120, "maxWidth": "50%", "maxHeight": 60]),
570 text("wrapped", "An absolutely positioned label still wraps at its authored maximum width", style: ["position": "absolute", "left": 12, "top": 12, "maxWidth": 80, "fontSize": 17]),
571 ]))
572 settle(controller)
573 let root = try frame("root", in: controller)
574 let expand = try frame("expand", in: controller)
575 XCTAssertGreaterThanOrEqual(expand.width, 44)
576 XCTAssertEqual(expand.height, 44, accuracy: 0.5, "Floating buttons retain their minimum touch target")
577 XCTAssertEqual(expand.maxX, root.maxX - 12, accuracy: 0.5)
578 let bounded = try frame("bounded", in: controller)
579 XCTAssertEqual(bounded.width, root.width / 2, accuracy: 0.5)
580 XCTAssertEqual(bounded.height, 60, accuracy: 0.5)
581 XCTAssertEqual(bounded.maxX, root.maxX - 12, accuracy: 0.5)
582 XCTAssertEqual(bounded.maxY, root.maxY - 12, accuracy: 0.5)
583 let wrapped = try frame("wrapped", in: controller)
584 XCTAssertEqual(wrapped.width, 80, accuracy: 0.5)
585 XCTAssertGreaterThan(wrapped.height, 44, "Width bounds participate in intrinsic text measurement")
586 }
587
565588 func testAStyleUpdateIsAppliedInPlaceLayoutIncluded() throws {
566589 let controller = screen(box("root", style: ["padding": 10], [
567590 box("grows", style: ["height": 24, "marginHorizontal": 48]),
packages/ios/templates/CraftNativeScreen.swiftmodified+11-4
Changes to packages/ios/templates/CraftNativeScreen.swift
@@ -2685,10 +2685,17 @@ private class CraftNativeFlowView: UIStackView {
26852685 ? max(0, content.height - (style.top ?? 0) - (style.bottom ?? 0))
26862686 : style.height?.resolve(content.height)
26872687 (fixedWidth, fixedHeight) = aspectDimensions(style, width: fixedWidth, height: fixedHeight)
2688 let measured = CraftNativeFlexLayout.measure(child, width: fixedWidth, height: fixedHeight, maxWidth: content.width, maxHeight: content.height)
2689 let x = style.left ?? (style.right.map { content.width - $0 - measured.width } ?? 0)
2690 let y = style.top ?? (style.bottom.map { content.height - $0 - measured.height } ?? 0)
2691 frames.append((child, CGRect(x: content.minX + x, y: content.minY + y, width: measured.width, height: measured.height)))
2688 var measured = CraftNativeFlexLayout.measure(child, width: fixedWidth, height: fixedHeight, maxWidth: content.width, maxHeight: content.height)
2689 let boundedWidth = clamp(measured.width, style.minWidth?.resolve(content.width), style.maxWidth?.resolve(content.width))
2690 if abs(boundedWidth - measured.width) > 0.0001 {
2691 // A narrower label or container must wrap before its
2692 // height and bottom anchor are resolved.
2693 measured = CraftNativeFlexLayout.measure(child, width: boundedWidth, height: fixedHeight, maxWidth: content.width, maxHeight: content.height)
2694 }
2695 let boundedHeight = clamp(measured.height, style.minHeight?.resolve(content.height), style.maxHeight?.resolve(content.height))
2696 let x = style.left ?? (style.right.map { content.width - $0 - boundedWidth } ?? 0)
2697 let y = style.top ?? (style.bottom.map { content.height - $0 - boundedHeight } ?? 0)
2698 frames.append((child, CGRect(x: content.minX + x, y: content.minY + y, width: boundedWidth, height: boundedHeight)))
26922699 }
26932700 }
26942701 return (size, frames)