fix(recorder): stop segment thumbs getting stranded invisible (vendor react-native-sortables#610 via patch-package) - #175
Open
morepriyam wants to merge 1 commit into
Conversation
…n't strand an invisible segment thumb A segment thumb could render fully invisible (blank slot in the segment bar, space still reserved) until the draft was closed and reopened. Root cause (#173): with Sortable.PortalProvider, the real cell is hidden with opacity 0 while a copy is teleported for the drag, and the only restore path requires the activation progress to return to exactly 0 — a gesture that dies without onTouchesUp/onTouchesCancelled (or a drop animation interrupted mid-flight) freezes it above 0, stranding the cell hidden and dead to input. Vendor the upstream fix (MatiPl01/react-native-sortables#610, unreleased) via patch-package: onFinalize cleanup on both gesture-handler adapters, per-item activation-timeout ownership, and discardAbandonedDrag so a stuck cell heals on the next touch. Verified red/green/red against a v1.10.0 checkout with a regression test driving the real DragProvider worklets (see #173); the library's own suite stays green under the patch. RNGH stays at ~2.32.0 — the Expo SDK 57 bundled version; the fix wires the v2 adapter this app selects, so the 3.x bump isn't needed for it. Fixes #173
morepriyam
force-pushed
the
fix/segment-bar-stranded-thumb
branch
from
August 15, 2026 02:14
ead3391 to
2bdd594
Compare
3 tasks
morepriyam
force-pushed
the
fix/segment-bar-stranded-thumb
branch
from
August 15, 2026 02:46
a888101 to
2bdd594
Compare
There was a problem hiding this comment.
Pull request overview
This PR applies an upstream (unreleased) fix from react-native-sortables#610 via patch-package to prevent recorder segment thumbnails from becoming permanently invisible due to a stranded hidden Sortable cell.
Changes:
- Adds a
patch-packagepatch forreact-native-sortables@1.10.0to harden gesture-finalization and activation handling (including abandoned-drag recovery). - Wires
patch-packageinto installs via a rootpostinstallscript. - Updates the lockfile to include
patch-packageand its transitive dependencies.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| patches/react-native-sortables+1.10.0.patch | Vendors the upstream fix (gesture onFinalize safety net, activation-timeout ownership, abandoned-drag discard, and related tests) as a patch-package patch. |
| package.json | Adds patch-package and runs it in postinstall so the vendored fix is applied after installs. |
| package-lock.json | Locks patch-package and related deps; marks the package as having install scripts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #173.
What
A segment thumb could render fully invisible: a blank slot in the segment bar, space still reserved, no badge, no duration, no icon, until the draft was closed and reopened. Field-reported with before/after screenshots on #173.
Why
Root-caused in #173 to
react-native-sortables@1.10.0(the latest release). WithSortable.PortalProvider, the real grid cell is hidden (opacity: 0) while a copy is teleported for the drag, and the only restore path requires the activation progress to return to exactly 0. A gesture that dies withoutonTouchesUp/onTouchesCancelled(documented upstream on iOS in MatiPl01/react-native-sortables#494), or a drop animation interrupted mid-flight, freezes the progress above 0. The cell is then stranded invisible and rejects further touches. Only a remount healed it.How
Vendor the upstream fix, MatiPl01/react-native-sortables#610 (open draft, in no published release), via
patch-package:onFinalizecleanup safety net on both gesture-handler adapters (v2 is the one RNGH 2.32 selects)discardAbandonedDrag: a stranded cell now heals on the next touch instead of staying deadfail()instead of silent returns when activation finds no measurementsThe patch is the verbatim #610 diff (test files included for provenance). It applies to
src/, which is what Metro bundles (react-nativemain field; the package ships noexports).Why patch instead of fork: #610 is authored by the maintainer of react-native-sortables himself (MatiPl01, the repo owner). This is the library's own in-flight fix, not a third-party proposal, so it's expected to merge and ship upstream, and maintaining a fork for code the maintainer is already landing would be pure overhead. The patch is a stopgap with a defined end of life: when #610 ships in a release, version-bump
react-native-sortablesand delete the patch. patch-package will loudly fail the install on any version bump that forgets, by design.RNGH bump: evaluated, deliberately not taken
3.2.1 is current, but Expo SDK 57's validated version is
~2.32.0(expo/bundledNativeModules.json), and bumping would step outside the SDK's tested set. The strand fix doesn't need it anyway, since #610 wires the v2 adapter this app selects. When a future SDK bumps RNGH to 3.x, sortables auto-selects its v3 adapter and the patch's v3 changes take effect for free.Validation
DragProviderworklets; full run outputs on #173)react-native-sortablestest suite with patch appliedrm -rf+npm install,postinstall)discardAbandonedDragandonFinalizepresenttsc --noEmitDemo
The bug this PR fixes, reproduced on a physical iPhone (the stranded state injected on demand via a temporary dev-only trigger; full story on #173):
ScreenRecording_08-15-2026.08-13-07_1.mov
With this patch applied, touching the stranded thumb heals it instantly. With the patch reversed, it stays blank and dead to input until the draft is reopened.
Stacked on
feat/glass-remaining(#172).