Repository navigation
feat(ui): tune a row's swipe: a trackpad scroll never swipes, lifted fingers let go at once, a flick carries, and the row follows with no render - #3653
Merged
Conversation
…fingers let go at once, a flick carries, and the row follows with no render - A trackpad movement begins a swipe only once it leans sideways 5px and twice as far as up or down; one that begins up or down is the list's to scroll until its wheel rests. - Five shrinking deltas in a row are the fingers lifted: the swipe is let go then rather than after the coast, which moves nothing. - A release is carried along the hand's speed (120ms, at most 64px), so a flick right acts and one back closes. - Past 85% of the row it gives, keeping a third of the hand's travel. - The row follows the hand by writing its place onto the item, rendering only as it arms; the label rides a beat behind and the armed colour fades. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… the hand's whole travel, and carries its flick when the wheel rests Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
… row never acts on the scroll Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
13 of 14 tasks
This branch was successfully deployed
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.
Summary
Dean tried the Inbox row swipe (#3641) on his Mac and asked to tune its sensitivity and the smoothness of its animation. The swipe is hand-built in
packages/ui/src/components/list-row/use-row-swipe.ts, with no gesture library. This PR tunes that hook and its CSS.Sensitivity
Smoothness
--duration-hover, 70ms), so its jump from the button's middle to the row's edge on arming glides instead of snapping. The armed color also fades.Thresholds are unchanged: open past 24px, act past 60% of the row.
Evidence
pnpm check:affected:@luke/uitests: 79 files passed.@luke/web: 66 files passed.@luke/desktop: 214 of 215 files passed. The one failure issrc/main/app-menu.test.ts, which fails in this sandbox because Electron isn't installed; this PR doesn't touch it.discarded-effectran out of memory in the parallel run. Run alone,pnpm discarded-effectreports no discarded Effect in 2,340 files.pnpm lintandpnpm knippass when run alone.list-row.test.ts: 32 pass, 5 of them new. The fifth covers Devin's three findings: a trackpad swipe on an open row starts from its rest, the give is read off the hand's whole travel, and a flick carries once the wheel rests.desktop-inbox.test.ts: 90 pass.Invariants
./scripts/check.shgreen. (CI)astype assertion outside the allowlisted files. (CI via anti-slop)Effect.runPromise/runSync/runForkoutside the runtime edges. (CI)setTimeout/setInterval/new Promise/AbortController/fs.watch. Timing usesrequestAnimationFrameand the events' owntimeStamp. (CI)list-row.test.ts).CLAUDE.md/AGENTS.mdsentence names a changed part.PRIVACY.mdunchanged.Notes
SWIPEat the top ofuse-row-swipe.ts:LEAN,COAST,PROJECT_MS/PROJECT_MAX,GIVE_SHARE/GIVE,OPEN, andACT_SHARE.Made with Luke