derive-seek-from-progress-flow

Installation
SKILL.md

The only thing that changes when you scrub is the position

Drag a scrubber and check what the app can observe: the current item did not change, the running/paused state did not change, no user-action callback fired anywhere above the component. Exactly one thing moved — the position — and the progress stream that reports it is already running because the UI needs it. So derive the event from that:

// adapted — names generalized; the send call and log elided
var lastProgress = 0L
var lastAt = 0L
progressFlow.collect { position ->
    val now = PROCESS_START.elapsedNow().inWholeMilliseconds   // monotonic
    val previous = lastProgress
    val previousAt = lastAt
    lastProgress = position                                    // baseline updated FIRST
    lastAt = now
Installs
2
GitHub Stars
35
First Seen
6 days ago
derive-seek-from-progress-flow — maxrave-dev/kotlin-footguns