Collapse bounds policies to reflect-only; drop abort and clamp
The executor kept every commanded point on-screen via a per-strategy
BoundsPolicy of abort / clamp / reflect. Measured against the real
strategies, the other two earned nothing: abort truncated a sweep at the
first edge (line on a narrow screen ran only 90 of 250 steps), and clamp
could park the cursor against an edge (a monotonic ramp stalled 162 steps
in a row) -- both counter to the program's whole purpose of keeping the
cursor moving. reflect bounces off the edge and keeps going, and is
already what line/diagonal need in loop mode. arc's declared clamp was
provably dead code (it clamps its own endpoint, so no sample ever leaves
the screen).
Collapse to reflect-only:
- strategies.ts: remove the BoundsPolicy type and the `bounds` field from
the interface and all six strategies. Keep the local clamp() helper --
it's arc's endpoint geometry, not an on-screen policy; docstring says so.
- executor.ts: resolveTarget loses its policy parameter and its null
return and just reflects both axes; delete clampInt; SweepOutcome drops
"aborted"; ExecuteOptions drops `bounds`; remove the Out of bounds log.
- keeper.ts: loopOpts is now { restore: false, loop: true } -- the
reflect override added with loop mode is redundant.
- tests: drop the abort-outcome, clamp, and bounds-override tests; simplify
fixed() to take no policy; add a regression test that a monotonic ramp
past an edge never yields two identical points in a row (the guarantee
that motivated removing clamp).
Behavior is unchanged for every pattern at normal cursor positions
(verified: line's normal sweep is byte-identical). The only differences
are at a screen edge, where motion now bounces instead of stopping. No
config keys, flags, or pattern names changed.
Docs updated to match, including in-code comments, the README strategies
table (Bounds column removed) and verbose description, the sequence
diagram (resolveTarget signature + getPosition/width ordering + a loop-mode
note), and a CHANGELOG Changed entry.
This commit is contained in:
+15
-5
@@ -11,11 +11,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Loop mode: `-l` / `--loop` (and the `loop` config key) keep the mouse
|
||||
moving after a sweep is triggered until real user activity is detected,
|
||||
instead of firing a single sweep. In loop mode the cursor is never restored
|
||||
between iterations and every pattern's bounds policy is forced to `reflect`,
|
||||
so `line` and `diagonal` bounce edge-to-edge across the screen (a
|
||||
roaming-DVD effect) rather than stopping at the first edge. Patterns with a
|
||||
finite path (`jitter`, `walk`, `arc`, `figureEight`) chain that path cycle
|
||||
after cycle. Interruption remains mouse-movement only.
|
||||
between iterations, so `line` and `diagonal` bounce edge-to-edge across the
|
||||
screen (a roaming-DVD effect) rather than stopping at the first edge.
|
||||
Patterns with a finite path (`jitter`, `walk`, `arc`, `figureEight`) chain
|
||||
that path cycle after cycle. Interruption remains mouse-movement only.
|
||||
|
||||
### Changed
|
||||
- Simplified on-screen confinement to a single policy: the executor now
|
||||
reflects every pattern's out-of-range coordinates back inside the screen.
|
||||
The `abort` and `clamp` bounds policies (and the per-strategy `bounds`
|
||||
field) were removed. `abort` truncated a sweep at the first edge and `clamp`
|
||||
could park the cursor against an edge — both counter to keeping the cursor
|
||||
moving — while `reflect` bounces and keeps going. Behavior is unchanged for
|
||||
every pattern at normal cursor positions; the only differences are at a
|
||||
screen edge, where motion now bounces instead of stopping. No config keys,
|
||||
flags, or pattern names changed.
|
||||
|
||||
## [1.3.3] - 2026-08-17
|
||||
|
||||
|
||||
Reference in New Issue
Block a user