`@effect/ui-native` (Effect-TS/ui): `kit/Pan` fires stale non-zero `vx`/`vy` on `onEnd` after user pauses still before lifting
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react-native, typescript
Direzione di ricerca
Leggi packages/ui-native/src/kit/Pan.ts intorno alle righe 283–314 e il test di riproduzione collegato, 05-pan-stale-velocity-on-end-after-pause/repro.test.ts. Segui come gli eventi di movimento aggiornano la velocità e come l’evento di fine la segnala; riproduci il caso con una pausa di 500 ms. Il lavoro è terminato quando onEnd segnala una velocità prossima a zero dopo la pausa, preservando al contempo la velocità prevista per un rilascio subito dopo il movimento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
partially generated with help of my ai friend - neon 4.4
Hi effect team,
I was trying out this package and wanted to report some bugs encountered while porting a library to effect native
What version of Effect is running?
effect:4.1.7@effect/ui&@effect/ui-native:Effect-TS/uimainat77391ee50ae3d3175d670facbf675e9a819ba6a6react-native:0.88.1
What steps can reproduce the bug?
- Clone the minimal reproduction repository:
git clone https://github.com/cliffordfajardo/effectui-native-error-reproductions.git cd effectui-native-error-reproductions pnpm install pnpm vitest run 05-pan-stale-velocity-on-end-after-pause - Attach
Pan.on({ axis: "x", onMove, onEnd })to a draggable view (such as a swipeable row or drawer):topTouchStartat(x: 100, t: 1000)topTouchMovepast slop to(x: 120, t: 1016)- Fast
topTouchMoveto(x: 140, t: 1032)(vx = 1.25 px/ms) - User holds their finger completely stationary for 500 ms (no further move events)
topTouchEndat(x: 140, t: 1532)
See 05-pan-stale-velocity-on-end-after-pause/repro.test.ts.
What is the expected behavior?
After dragging and then holding still for 500 ms before releasing, onEnd should report near-zero velocity (Math.abs(vx) < 0.05) so snap-threshold and Animation.spring({ velocity }) handoff logic treats the release as a stationary release rather than a high-speed flick.
What do you see instead?
packages/ui-native/src/kit/Pan.ts:283-314 computes g.vx and g.vy exclusively during phase === 1 (topTouchMove) using dt = now - g.t, and on phase === 2 (topTouchEnd, lines 307–314) fires end with the unchanged g.vx and g.vy without checking elapsed time since the last move (t).
As a result, onEnd still receives the stale vx = 1.25 px/ms from 500 ms earlier even though the finger stopped moving half a second before lifting.
Additional information
Possible fix in packages/ui-native/src/kit/Pan.ts: on phase === 2, inspect the elapsed time now - t (using touch.timestamp ?? Date.now()). If the elapsed time since the last move exceeds a stillness window (e.g., > 60–100 ms), zero out g.vx and g.vy (or recompute/decay velocity using the total interval up to release).
- Lingua principale
- TypeScript
- Stelle
- 16.7k
- Fork
- 808
- Merge medio
- 21h 22m
- PR unite (30g)
- 486
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Effect-TS/effect
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing componentsForse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11097 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`Forse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11096 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): `internal/focus.ts` `trackKeyboard` ignores `keyboardWillChangeFrame` / `keyboardDidChangeFrame` dismissalForse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11095 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
check:failed streams:edit
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
iptv-org/iptv#60585 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Critical path skips a child span that ends exactly when the next one startsForse già presa @Piyush4801 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jaegertracing/jaeger-ui#4865 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno