mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-24 06:39:33 +01:00
fix: apply the review items for #699 at merge
pageKeysForGesture comment (terminal-ui.js:218): the gap stretches to PAGE_KEY_NOTCH_DEBT_MS after a notch-sized opener, not only PAGE_KEY_DEBT_MS pageKeysForGesture comment (terminal-ui.js:286): a repaid debt ends either lifetime, not only the one-second one Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
77eefce4f6
commit
2936063ea3
1 file changed
+6
-5
@@ -215,9 +215,10 @@
|
|||||||
// (`ev.touchId`, set by the touch paths per touchstart and carried by that
|
// (`ev.touchId`, set by the touch paths per touchstart and carried by that
|
||||||
// contact's momentum; a wheel event has none, so wheel and touch never
|
// contact's momentum; a wheel event has none, so wheel and touch never
|
||||||
// share a gesture), or, for events outside any contact, after quiet:
|
// share a gesture), or, for events outside any contact, after quiet:
|
||||||
// PAGE_KEY_GESTURE_GAP_MS, stretched to PAGE_KEY_DEBT_MS while a pre-paid
|
// PAGE_KEY_GESTURE_GAP_MS, stretched to PAGE_KEY_DEBT_MS (PAGE_KEY_NOTCH_DEBT_MS
|
||||||
// page is still owed in the same direction. One contact is never split by
|
// when a notch-sized opener pre-paid it) while a pre-paid page is still owed
|
||||||
// time, so a slow drag (one line per 170 ms) is one gesture;
|
// in the same direction. One contact is never split by time, so a slow drag
|
||||||
|
// (one line per 170 ms) is one gesture;
|
||||||
// - a new gesture's opening event (at least PAGE_KEY_MIN_START_ROWS and
|
// - a new gesture's opening event (at least PAGE_KEY_MIN_START_ROWS and
|
||||||
// under one page: a trackpad flick, or a mouse notch) pages AT ONCE,
|
// under one page: a trackpad flick, or a mouse notch) pages AT ONCE,
|
||||||
// pre-paid: the half screen it skipped is owed back by the rest of the
|
// pre-paid: the half screen it skipped is owed back by the rest of the
|
||||||
@@ -282,8 +283,8 @@
|
|||||||
}
|
}
|
||||||
const step = pageKeysForTravel(pending, lines, rows);
|
const step = pageKeysForTravel(pending, lines, rows);
|
||||||
// A debt carries the sign opposite to its direction; once the travel reaches
|
// A debt carries the sign opposite to its direction; once the travel reaches
|
||||||
// or crosses zero it is repaid, and what is left is plain travel (so the
|
// or crosses zero it is repaid, and what is left is plain travel (so neither
|
||||||
// one-second debt lifetime no longer applies).
|
// debt lifetime, PAGE_KEY_DEBT_MS or PAGE_KEY_NOTCH_DEBT_MS, applies any more).
|
||||||
if (prepaid && step.pending * dir >= 0) prepaid = false;
|
if (prepaid && step.pending * dir >= 0) prepaid = false;
|
||||||
return {
|
return {
|
||||||
state: { pending: step.pending, lastAt: now, dir, prepaid, notch: prepaid && !!prev.notch, touchId },
|
state: { pending: step.pending, lastAt: now, dir, prepaid, notch: prepaid && !!prev.notch, touchId },
|
||||||
|
|||||||
Reference in new issue
Block a user