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/android/fixtures/native-navigation/NativeFlatListTest.ktmodified+12-12
Changes to packages/android/fixtures/native-navigation/NativeFlatListTest.kt
@@ -147,7 +147,7 @@ class NativeFlatListTest {
147147 instrumentation.runOnMainSync {
148148 list = CraftNativeFlatList(context)
149149 attach(list)
150 list.apply(rows, false, 1, false, 0.1, renderer(context, renders), { _ -> }, null, null)
150 list.apply(rows, false, 1, false, 0.1, renderer(context, renders), { _ -> }, { _ -> }, null)
151151 }
152152 awaitCount(list, 10_000)
153153 instrumentation.runOnMainSync {
@@ -163,7 +163,7 @@ class NativeFlatListTest {
163163
164164 val moved = listOf(rows[1], rows[0]) + rows.drop(2)
165165 instrumentation.runOnMainSync {
166 list.apply(moved, false, 1, false, 0.1, renderer(context, renders), { _ -> }, null, null)
166 list.apply(moved, false, 1, false, 0.1, renderer(context, renders), { _ -> }, { _ -> }, null)
167167 }
168168 awaitCount(list, 10_000)
169169 instrumentation.runOnMainSync { attach(list) }
@@ -186,7 +186,7 @@ class NativeFlatListTest {
186186 list.onScrollEvent = { scrollCount.incrementAndGet() }
187187 list.onMomentumScrollBegin = { momentumBeginCount.incrementAndGet() }
188188 list.onMomentumScrollEnd = { momentumEndCount.incrementAndGet() }
189 list.apply(rows, false, 1, false, 0.1, renderer(context, AtomicInteger()), { _ -> }, null, null)
189 list.apply(rows, false, 1, false, 0.1, renderer(context, AtomicInteger()), { _ -> }, { _ -> }, null)
190190 }
191191 awaitCount(list, 100)
192192 instrumentation.runOnMainSync {
@@ -214,7 +214,7 @@ class NativeFlatListTest {
214214 instrumentation.runOnMainSync {
215215 list = CraftNativeFlatList(context)
216216 attach(list)
217 list.apply(nodes, true, 1, true, 0.1, renderer(context, renders), { _ -> }, null, null)
217 list.apply(nodes, true, 1, true, 0.1, renderer(context, renders), { _ -> }, { _ -> }, null)
218218 }
219219 awaitCount(list, 9)
220220 val horizontal = list.layoutManager as LinearLayoutManager
@@ -224,7 +224,7 @@ class NativeFlatListTest {
224224 assertEquals("mounted identities must stay in adapter order", invertedIdentities, invertedIdentities.sortedBy { it.substringAfter('-').toInt() })
225225
226226 instrumentation.runOnMainSync {
227 list.apply(nodes, false, 3, false, 0.1, renderer(context, renders), { _ -> }, null, null)
227 list.apply(nodes, false, 3, false, 0.1, renderer(context, renders), { _ -> }, { _ -> }, null)
228228 }
229229 awaitCount(list, 9)
230230 SystemClock.sleep(200)
@@ -236,7 +236,7 @@ class NativeFlatListTest {
236236 val updated = listOf(chrome("header", "header"), row(0).put("children", JSONArray().put("Updated"))) +
237237 (1 until 8).map(::row)
238238 instrumentation.runOnMainSync {
239 list.apply(updated, false, 3, false, 0.1, renderer(context, renders), { _ -> }, null, null)
239 list.apply(updated, false, 3, false, 0.1, renderer(context, renders), { _ -> }, { _ -> }, null)
240240 }
241241 SystemClock.sleep(300)
242242 instrumentation.runOnMainSync { attach(list) }
@@ -248,7 +248,7 @@ class NativeFlatListTest {
248248 chrome("footer", "footer"),
249249 )
250250 instrumentation.runOnMainSync {
251 list.apply(chromeOnly, false, 1, false, 0.1, renderer(context, renders), { _ -> }, null, {
251 list.apply(chromeOnly, false, 1, false, 0.1, renderer(context, renders), { _ -> }, { _ -> }, {
252252 chromeEndReached.incrementAndGet()
253253 })
254254 }
@@ -266,7 +266,7 @@ class NativeFlatListTest {
266266 assertTrue("vertical indicator should be hidden", !list.isVerticalScrollBarEnabled)
267267 assertTrue("horizontal indicator should be visible", list.isHorizontalScrollBarEnabled)
268268 assertEquals(View.OVER_SCROLL_NEVER, list.overScrollMode)
269 list.apply(emptyList(), true, 1, false, 0.1, renderer(context, AtomicInteger()), { _ -> }, null, null)
269 list.apply(emptyList(), true, 1, false, 0.1, renderer(context, AtomicInteger()), { _ -> }, { _ -> }, null)
270270 list.setBounceOptions(enabled = true, vertical = false, horizontal = true)
271271 assertEquals(View.OVER_SCROLL_ALWAYS, list.overScrollMode)
272272 list.setBounceOptions(enabled = false, vertical = true, horizontal = true)
@@ -291,7 +291,7 @@ class NativeFlatListTest {
291291 instrumentation.runOnMainSync {
292292 list.setScrollEnabled(false)
293293 list.onContentSizeChanged = { contentSizeChanges.incrementAndGet() }
294 list.apply(rows, false, 1, false, 0.1, renderer(context, AtomicInteger()), { _ -> }, null, null)
294 list.apply(rows, false, 1, false, 0.1, renderer(context, AtomicInteger()), { _ -> }, { _ -> }, null)
295295 }
296296 awaitCount(list, rows.size)
297297 instrumentation.runOnMainSync {
@@ -387,7 +387,7 @@ class NativeFlatListTest {
387387 }
388388 },
389389 { _ -> },
390 null,
390 { _ -> },
391391 null,
392392 )
393393 }
@@ -424,7 +424,7 @@ class NativeFlatListTest {
424424 }
425425 },
426426 { _ -> },
427 null,
427 { _ -> },
428428 null,
429429 )
430430 }
@@ -465,7 +465,7 @@ class NativeFlatListTest {
465465 }
466466 },
467467 { _ -> },
468 null,
468 { _ -> },
469469 null,
470470 )
471471 }