Add a hold-by-name gesture to ui-trace

A row held to select it was the one gesture that could only be written as a
pair of coordinates: `tap`'s press is 60ms so nothing sees a long press, and
`holddrag` takes numbers and always drags afterwards. `hold 'helper 3'`
resolves the label the way `tap` does -- the resolution is now `locate`,
shared by both -- and holds the press past the platform's 500ms threshold.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
irisandClaude Opus 5 committed 2026-09-06 13:10:06 -04:00
1 parent 86cf4e8088
commit c9be26c6d1
3 files changed
+54 -13

No files matched your search

+5 -2
View File
@@ -21,7 +21,9 @@ after seeing the first answer.
ui-trace show /tmp/t.txt # what moved (the default question)
ui-trace show /tmp/t.txt -m 'Called|ask' # a timeline for those
Press things by **name**, not by coordinate. `tap 'Save'` resolves the label
Press things by **name**, not by coordinate. `tap 'Save'` and `hold 'Save'`
(a press held past the platform's long-press threshold, for a list row that is
held to select it) resolve the label
against the tree at the moment of the gesture, so it survives anything that
moves the control and fails loudly when the control is genuinely not there.
`tap X Y` still works and is the exception: a coordinate is a position measured
@@ -367,7 +369,8 @@ def main():
rec.add_argument("-i", "--interval", type=int, default=16,
help="ms between samples (0 = as fast as possible)")
rec.add_argument("--do", action="append", default=[], metavar="ACTION",
help="'wait MS' | 'tap X Y' | 'swipe X1 Y1 X2 Y2 [MS]' | "
help="'wait MS' | 'tap X Y' | \"tap 'Label'\" | "
"\"hold 'Label'\" | 'swipe X1 Y1 X2 Y2 [MS]' | "
"'holddrag X1 Y1 X2 Y2 HOLD_MS MOVE_MS', repeatable")
rec.add_argument("-o", "--out", help="where to save the trace")
rec.add_argument("-m", "--match", help="show a timeline for these afterwards")