Skip to content

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
feat/glass-remainingfrom
fix/segment-bar-stranded-thumb
Open

fix(recorder): stop segment thumbs getting stranded invisible (vendor react-native-sortables#610 via patch-package)#175
morepriyam wants to merge 1 commit into
feat/glass-remainingfrom
fix/segment-bar-stranded-thumb

Conversation

@morepriyam

@morepriyam morepriyam commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

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). With Sortable.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 without onTouchesUp/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:

  • an onFinalize cleanup safety net on both gesture-handler adapters (v2 is the one RNGH 2.32 selects)
  • per-item activation-timeout ownership, so a sibling's touch can no longer revoke a pending activation
  • discardAbandonedDrag: a stranded cell now heals on the next touch instead of staying dead
  • fail() instead of silent returns when activation finds no measurements

The patch is the verbatim #610 diff (test files included for provenance). It applies to src/, which is what Metro bundles (react-native main field; the package ships no exports).

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-sortables and 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

Check Result
Red/green/red against a v1.10.0 library checkout (regression test drives the real DragProvider worklets; full run outputs on #173) strand reproduced on vanilla, heals with patch, red again on revert
Full react-native-sortables test suite with patch applied 10 suites / 40 tests pass
Patch survives a fresh install (rm -rf + npm install, postinstall) applied; discardAbandonedDrag and onFinalize present
On-device check (physical iPhone, dev build) stranded state injected on demand heals on touch with the patch; stays stuck with the patch reversed (screen recording on #173)
App jest suite 12 suites / 126 tests pass
tsc --noEmit clean

Demo

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).

…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
morepriyam force-pushed the fix/segment-bar-stranded-thumb branch from ead3391 to 2bdd594 Compare August 15, 2026 02:14
@morepriyam
morepriyam force-pushed the fix/segment-bar-stranded-thumb branch from a888101 to 2bdd594 Compare August 15, 2026 02:46
@morepriyam morepriyam changed the title fix(recorder): stranded invisible segment thumb — vendor react-native-sortables#610 via patch-package fix(recorder): stop segment thumbs getting stranded invisible (vendor react-native-sortables#610 via patch-package) Aug 15, 2026
@morepriyam morepriyam self-assigned this Aug 15, 2026
@morepriyam
morepriyam requested a lite review from Copilot August 15, 2026 03:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-package patch for react-native-sortables@1.10.0 to harden gesture-finalization and activation handling (including abandoned-drag recovery).
  • Wires patch-package into installs via a root postinstall script.
  • Updates the lockfile to include patch-package and 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

recorder: segment thumb renders invisible (blank slot) until the draft is reopened

2 participants