Add live scrub: keyboard and mouse seeking for pyflow play (TASK-048) - #86
Merged
Conversation
Closes Stage 8's Completion Criterion 6, the one clause of the stage's
own Goal ("scrubbed to any point") that shipped without a mechanism at
all. Left/Right step one frame, Home/End jump to the loaded window's
own edges, and a draggable scrub bar reaches any frame in between
directly -- all scoped to the window already materialized at launch.
The task's own biggest open risk -- a scrub-bar drag also panning the
camera underneath it, since RenderWindow.run() wires its own pan
handlers on the same canvas -- resolved in favour of the primary
approach rather than the stated fallback: rendercanvas's own
EventEmitter.emit dispatches handlers by order then registration order
and stops once a handler sets event["stop_propagation"], confirmed
live with two handlers on one canvas before being relied on. The
scrub bar's own handlers register at order=-1, one level above the
pan handlers' default order=0, so a drag on the bar suppresses panning
for that gesture with no change to window.py needed at all.
Building the bar also needed an absolute screen-to-world mapping
nothing in this codebase had (_update_pan only ever tracked a delta) --
screen_to_world, verified against a real rendered marker at a known
world position before being trusted.
Two real glfw-window integration tests, with genuine injected keyboard
and pointer events, prove both that seeking works and -- the literal
claim this task exists to prove -- that the camera does not move at
all during a scrub drag.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes Stage 8's Completion Criterion 6 (see #83, #84, #85) -- the one
clause of the stage's own Goal ("scrubbed to any point") that shipped
without any mechanism at all.
edges; a draggable scrub bar reaches any frame in between directly.
Scoped to the window already materialized at launch.
approach, not the stated fallback: a scrub-bar drag must not also
pan the camera, since
RenderWindow.run()wires its own pan handlerson the same canvas. Read directly and confirmed live:
rendercanvas'sEventEmitter.emitdispatches handlers byorderthen registration order and stops once a handler sets
event["stop_propagation"]. The scrub bar's own handlers register atorder=-1, one level above the pan handlers' defaultorder=0, so adrag on the bar suppresses panning for that gesture with no change
to
window.pyneeded at all.screen_to_world(rendering/window.py) -- the absolutescreen-pixel-to-world mapping the bar needs for placing its thumb and
hit-testing a drag, since
_update_panonly ever tracked a delta --verified against a real rendered marker at a known world position
before being trusted.
pointer events, prove both that seeking works and -- the literal
claim this task exists to prove -- that the camera does not move at
all during a scrub drag.
Stacked on #85 (
feat/partial-overlap-cache-reuse, itself stackedon #84 → #83). The diff will shrink as the earlier PRs merge.
Test plan
stop_propagationcheck, and a real-markerscreen_to_worldcheck) -- both recorded in
docs/CHANGELOG-DESIGN.mdmake lintand every relevantmake check-*target cleanmake test-- 1175 passed, 21 skipped, exit 0actually drawing (non-background pixels present);
pyflow play --helpunchanged (no new CLI flag, confirmed directly)🤖 Generated with Claude Code