Commit d20d2da
committed
refactor(daemon): drop the numeric-token heuristic instead of wrapping it
The previous commit replaced `formatGestureNoEffectWarning`'s
"drop numeric-looking positionals" regex with a per-action builder table —
but kept the regex as the table's fallback. That is two mechanisms where
there was one, and the heuristic this finding exists to remove is still
in the file.
Only `scroll`, `swipe` and `gesture <subtype> …` reach the warning by
default (`isPostGestureStabilizingAction`), and across all three exactly
one positional is not part of the gesture's identity: `scroll`'s optional
trailing amount. Echoing everything else verbatim is simpler than either
version and strictly more truthful than the original, which ate all four
coordinates of `swipe <x1> <y1> <x2> <y2>` and reported a contentless
bare "swipe".
scroll down 0.6 -> "scroll down"
scroll up -> "scroll up"
swipe 10 20 30 40 -> "swipe 10 20 30 40" (was: "swipe")
swipe -> "swipe"
gesture swipe left -> "gesture swipe left"
gesture fling down 100 200 -> "gesture fling down 100 200"
35 lines of table, dispatch and regex become 4 lines with one named
exception. `--postGestureStabilization` can still force an arbitrary
action through; echoing its positionals is the honest answer for one
warning string, and reconstructing each gesture subtype's layout would
fork a grammar that lives in GestureSemanticInput, downstream of the raw
positionals this function receives.1 parent 215b2c6 commit d20d2da
1 file changed
Lines changed: 17 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
255 | 249 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
265 | 261 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | 262 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 263 | + | |
| 264 | + | |
279 | 265 | | |
280 | 266 | | |
281 | 267 | | |
| |||
0 commit comments