Session replay: turn stepper + transport bar (P1+P2)#9
Merged
Conversation
Replay is a time cursor over the same session data: pairs whose response completed at or before the cursor are visible, everything after doesn't exist yet. visibleAt() feeds the existing buildSession path, so both panes (wire threads + conversation) rebuild naturally from partial history — exactly the code path that renders mid-capture live sessions today. - src/replay.ts: pure timeline primitives (visibleAt, replayEvents, boundary walkers, anchorAt, nextTick with idle compression), inlined into the page and unit-tested like summarize.ts. - Transport bar in the Session view: play/pause at 1/2/8/60x with idle gaps compressed to <=2s, scrubber-as-minimap (turns tall accent, errors red, probes ticks), drag to scrub, elapsed/total clock. - Keyboard: arrows step turns, shift+arrows step wire requests, Space plays, Home/End jump, Esc exits back to the live tail. - Deep links anchor on pair id (#/session/<key>/@<pair-id>) — pausing updates the URL, opening one starts replay paused at that moment; ids survive cross-run history merges where wall-clock offsets wouldn't. - Live captures keep extending the track; "live" exits and re-attaches the tail. Snapshots replay identically offline. Verified by 12 unit tests plus a stubbed-DOM behavioral smoke driving the page script end-to-end (step/seek/play/deep-link). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Implements P1+P2 of docs/design/session-replay.md — zero capture changes, works on every trace ever captured.
What
src/replay.ts(new, pure, inlined):visibleAt(pairs, cursor)is the whole feature — the wire as of a moment, fed through the existingbuildSessionpath. PlusreplayEvents(response-end boundaries),nextBoundary/prevBoundary/anchorAtwalkers, andnextTick(playback scheduler with ≤2s idle compression).←/→step turns,shift+←/→step wire requests,Spaceplay/pause,Home/End,Escexits. Entering via→starts at the beginning; via←steps back from now.#/session/<key>/@<pair-id>opens paused at that pair; pausing/stepping updates the URL viareplaceState. Anchored on pair id so links survive cross-run history merges.Design-doc open questions resolved: requests list stays full during replay; probes render as minimap ticks. Doc updated (P1+P2 shipped, P3/P4 remain).
Verification
tests/replay.test.ts, replay-machinery guards in the snapshot test)🤖 Generated with Claude Code