From 2109098400fa37d7b448f232c848a0411c318591 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 16 Sep 2026 12:18:01 -0300 Subject: Give macOS scrolling momentum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A swipe that was still moving when the fingers lifted stopped dead. The dial next to it has thrown properly since pardes_rotate_end, and this is that same curve on the scroll accumulator: velocity sampled between events off the monotonic clock, weighted toward the newest sample because a flick is decided by how the hand was moving when it left, and a fling that ramps up from zero at the floor rather than switching on at it. A coast stops at the end of a document rather than spinning its remaining velocity against the edge, which is why spendScroll now reports whether the pane moved and why paneAt is public. Only a step that delivered a press can report an edge — the many steps between two rows cross nothing. Nothing suppresses AppKit's own momentum, and nothing needs to: its momentum events are ordinary pardes_scroll calls, every one of which cancels the coast before spending its travel, so on a real trackpad the system takes the gesture over about a frame after the lift and the tail it ends on is below the floor. This is the path for devices AppKit does not fling for — and the only one a script can reach, since NSEvent phases have no public constructor. momentum.snap asserts both halves, which is why it needs the long scrollback: a flick with no document left proves nothing. A slow swipe is byte-identical after the release; a hard one coasts twenty-four rows further on its own, and a finger back on the pad stops it there. Co-Authored-By: Claude Opus 5 (1M context) --- test/macos-snapshots/momentum.golden | 186 +++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 test/macos-snapshots/momentum.golden (limited to 'test/macos-snapshots/momentum.golden') diff --git a/test/macos-snapshots/momentum.golden b/test/macos-snapshots/momentum.golden new file mode 100644 index 00000000..b4471061 --- /dev/null +++ b/test/macos-snapshots/momentum.golden @@ -0,0 +1,186 @@ +== snap home grid=100x30 cursor=4,29 +|Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill +| New Tty Find Grep Joincol +|$ /private/tmp/pardes-macos-e2e/momentum/cwd Tty Save Del Mode Filter Collapse +| LINE 175 +| LINE 176 +| LINE 177 +| LINE 178 +| LINE 179 +| LINE 180 +| LINE 181 +| LINE 182 +| LINE 183 +| LINE 184 +| LINE 185 +| LINE 186 +| LINE 187 +| LINE 188 +| LINE 189 +| LINE 190 +| LINE 191 +| LINE 192 +| LINE 193 +| LINE 194 +| LINE 195 +| LINE 196 +| LINE 197 +| LINE 198 +| LINE 199 +| LINE 200 +| $ +== snap placed grid=100x30 cursor=0,0 +|Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill +| New Tty Find Grep Joincol +|$ /private/tmp/pardes-macos-e2e/momentum/cwd Tty Save Del Mode Filter Collapse +| LINE 174 +| LINE 175 +| LINE 176 +| LINE 177 +| LINE 178 +| LINE 179 +| LINE 180 +| LINE 181 +| LINE 182 +| LINE 183 +| LINE 184 +| LINE 185 +| LINE 186 +| LINE 187 +| LINE 188 +| LINE 189 +| LINE 190 +| LINE 191 +| LINE 192 +| LINE 193 +| LINE 194 +| LINE 195 +| LINE 196 +| LINE 197 +| LINE 198 +| LINE 199 +| LINE 200 +== snap placed_released grid=100x30 cursor=0,0 +|Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill +| New Tty Find Grep Joincol +|$ /private/tmp/pardes-macos-e2e/momentum/cwd Tty Save Del Mode Filter Collapse +| LINE 174 +| LINE 175 +| LINE 176 +| LINE 177 +| LINE 178 +| LINE 179 +| LINE 180 +| LINE 181 +| LINE 182 +| LINE 183 +| LINE 184 +| LINE 185 +| LINE 186 +| LINE 187 +| LINE 188 +| LINE 189 +| LINE 190 +| LINE 191 +| LINE 192 +| LINE 193 +| LINE 194 +| LINE 195 +| LINE 196 +| LINE 197 +| LINE 198 +| LINE 199 +| LINE 200 +== snap thrown grid=100x30 cursor=0,0 +|Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill +| New Tty Find Grep Joincol +|$ /private/tmp/pardes-macos-e2e/momentum/cwd Tty Save Del Mode Filter Collapse +| LINE 165 +| LINE 166 +| LINE 167 +| LINE 168 +| LINE 169 +| LINE 170 +| LINE 171 +| LINE 172 +| LINE 173 +| LINE 174 +| LINE 175 +| LINE 176 +| LINE 177 +| LINE 178 +| LINE 179 +| LINE 180 +| LINE 181 +| LINE 182 +| LINE 183 +| LINE 184 +| LINE 185 +| LINE 186 +| LINE 187 +| LINE 188 +| LINE 189 +| LINE 190 +| LINE 191 +== snap coasted grid=100x30 cursor=0,0 +|Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill +| New Tty Find Grep Joincol +|$ /private/tmp/pardes-macos-e2e/momentum/cwd Tty Save Del Mode Filter Collapse +| LINE 141 +| LINE 142 +| LINE 143 +| LINE 144 +| LINE 145 +| LINE 146 +| LINE 147 +| LINE 148 +| LINE 149 +| LINE 150 +| LINE 151 +| LINE 152 +| LINE 153 +| LINE 154 +| LINE 155 +| LINE 156 +| LINE 157 +| LINE 158 +| LINE 159 +| LINE 160 +| LINE 161 +| LINE 162 +| LINE 163 +| LINE 164 +| LINE 165 +| LINE 166 +| LINE 167 +== snap caught grid=100x30 cursor=0,0 +|Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill +| New Tty Find Grep Joincol +|$ /private/tmp/pardes-macos-e2e/momentum/cwd Tty Save Del Mode Filter Collapse +| LINE 141 +| LINE 142 +| LINE 143 +| LINE 144 +| LINE 145 +| LINE 146 +| LINE 147 +| LINE 148 +| LINE 149 +| LINE 150 +| LINE 151 +| LINE 152 +| LINE 153 +| LINE 154 +| LINE 155 +| LINE 156 +| LINE 157 +| LINE 158 +| LINE 159 +| LINE 160 +| LINE 161 +| LINE 162 +| LINE 163 +| LINE 164 +| LINE 165 +| LINE 166 +| LINE 167 -- cgit v1.3