Repository navigation
fix(test-app): make the reorder handle a labelled native hold-then-drag - #4811
Conversation
The handle was an unlabelled PanResponder inside the page scroll view. A finger could not reorder with it either: after the hold the scroll view took the move, and the list only swapped when the first move event already carried half a row. The handle is now a labelled button driven by a pan that activates after the hold and blocks the page scroll view, the order changes on release by whole rows, and the handle leads the row so the dev client's floating Tools button does not cover it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
The gesture target loaded its image from the network and the other targets were empty grey boxes. The target now shows a bundled public-domain NASA photo, and the drag endpoints, the multi-finger tap target and the reorder handles carry symbols. Element sizes and positions are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
The reorder only showed in the status lines below the list. The dragged row now lifts and follows the touch, and the other rows slide to the order a release would commit. Rows keep their place in the view tree and move by transform, so the drag is not cancelled mid-way. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 07b4cc7. The verdict and the full list are in the summary comment.
A drag re-renders the row on every move, which rebuilt the gesture and let the native handler be reconfigured mid-drag. The gesture is now memoized and reads the current callbacks through a ref. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
At 9b3f424 the reorder handle change has one gap: it has no Android run, and Android is where the riskiest part of it lands. The Home page ScrollView now comes from react-native-gesture-handler on both platforms. The handle also relies on Could you post an Android emulator run on 9b3f424 (the CI profile, pixel_7 1080x2400 @420dpi) that reaches these states? (1) CI is green: 20 checks reported, none failing, and one matrix job was skipped because the native fingerprint did not change. That says nothing about this fixture, because no PR job runs the test-app replays or the live-replay scenarios. No conflicts. Before merge, the Android run above needs to be posted. The open inline thread about rebuilding the gesture on every drag re-render no longer applies: head builds it once with Not blocking, and fine to take or leave: no replay or e2e scenario touches |
…t in the drag replays A cancelled handle drag could still commit its move. The drop now runs only when the gesture ends successfully. drag.ad and drag-android.ad drag the Alpha handle onto the Gamma handle and wait for the new order, so the reorder handle has replay coverage. Two comments that said the gesture lab loads a remote image now describe what it loads. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Android run for the reorder handle, on Setup
1, 2, 3, 5: drag by id, held pan, page scroll, snapshot
4: replays
The Material Symbols glyphs and the bundled photo render on Android. Follow-ups taken from the review, in
Left as is: the |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 9f25156. The verdict and the full list are in the summary comment.
The order was committed on gesture end and the drag cleared on finalize, so one render could combine the new order with the old drag travel and place the dropped row a drag further before it settled. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
The Home scroll view and the handle gesture that blocks it both accept an untyped ref, so the double cast on the gesture side is not needed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Follow-up at Re-run on this head: |
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
The PR is ready at 4244175. The earlier evidence request (9b3f424) is now met: the Android and iOS runs are posted, and the delta since then is correct. CI is green with 20 checks and none failing, and no conflicts are known. Device behavior rests on the posted runs, because no PR job runs the test-app replays. The full Android transcript ran at 9f25156, and only the three replays were re-run on head, so please keep the author-reported results in the thread. Not blocking, take or leave: the comment at examples/test-app/src/screens/HomeScreen.tsx:24 says the ref is "left untyped", but The two inline threads on the drop update (#4811 (comment)) and the handle gesture memo (#4811 (comment)) are fixed at this head, so the author can resolve them. |
…nts-main * origin/main: feat(platform-apple): admit screen recording on watchOS simulators (#4819) feat(audit): run Apple's native accessibility checks on iOS (#4776) fix(test-app): make the reorder handle a labelled native hold-then-drag (#4811) # Conflicts: # packages/command-surface/src/recording/index.ts
Summary
The reorder list in the test app's Gesture lab could not be reordered by a finger. Its handle was an unlabelled
PanResponderinside the page scroll view: after the hold, the scroll view took the move, and the list swapped only when the first move event already carried half a row. In practice only a near-instant move worked.This makes the handle behave like a sortable-list handle in a real app:
Reorder Alpha, test idreorder-handle-Alpha), so it has a ref.ScrollViewfor that.reorder orderline changes on release. Rows keep their place in the view tree and move by transform, because moving the dragged row's view mid-drag cancelled the touch.It also makes the lab look less like placeholders, without moving or resizing any element:
expo-symbols, with Android and web names).Test app only; no package code changes.
Verification
iPhone 17 Pro simulator, iOS 27.0, CLI built from main.
scroll down --until 'label="Reorder Gamma"'from the top of Homegesture draghandle Alpha to handle GammaBeta,Gamma,Alphagesture draghandle Alpha (row 3) to handle Beta (row 1)Alpha,Beta,Gammagesture draghandle Gamma to handle BetaAlpha,Gamma,Betagesture panon a handle,--hold-ms 900, 48 px down, 600 ms moveBefore the change, on the same device, a 1000 ms hold with a 600, 1500 or 3000 ms move left the order unchanged and scrolled the page.
Android: run on a dedicated pixel_7 emulator (1080x2400 @ 420 dpi, API 37) at
9f25156; the transcript is in a PR comment. Drag by id, a held pan, page scroll outside the handles, and thedrag-android.adandgesture-lab-android.adreplays all pass.drag.adanddrag-android.adnow include a reorder step.Known gap: on iOS a plain
gesture panwithout--hold-msand a 600 ms move also reordered once. The pan seems to dwell at the start point for about as long as the handle's hold. Not addressed here.tscandoxlintpass on the touched files; the full check is left to CI.🤖 Generated with Claude Code