feat(replay): interactive session replay with timeline scrubber - #265
Open
Mukller wants to merge 1 commit into
Open
feat(replay): interactive session replay with timeline scrubber#265Mukller wants to merge 1 commit into
Mukller wants to merge 1 commit into
Conversation
…gsonww#2) Adds a new Session Replay page at /sessions/:id/replay that reconstructs agent/session state from persisted events and lets users scrub through time. Features: - Timeline scrubber (range input) with play/pause/step-forward/step-back and jump-to-start/end controls - Speed selector: 0.5x / 1x / 2x / 5x (interval-based playback) - Deterministic state engine: sorts events by created_at + id tie-break, applies event_type → AgentStatus mapping, builds checkpoints every 100 events for O(1) seek to any arbitrary position - Windowed event list (±50 events around cursor) for 10k+ event sessions - Lifecycle mini-map (SessionStart / Stop / SubagentStop / Compaction / APIError markers) with click-to-jump support - Agent state panel showing derived status of each agent at the cursor - Keyboard shortcuts: Space play/pause, ← → step, Home/End jump - i18n: replay namespace (en) wired; translations in English - "Replay" button added to SessionDetail header (linked to /replay route) - detail.replay key added to sessions.json for en/zh/vi/ko Closes hoangsonww#2
Dcastroro
suggested changes
Jul 30, 2026
Dcastroro
left a comment
There was a problem hiding this comment.
The replay cursor and playback state are not reset when the route id changes or when a new event set is loaded. React can reuse this page instance when navigating between sessions, so a cursor from a long session may remain beyond the end of a shorter session. That leaves currentEvent null, the range value outside its new max, and reconstructed state at an unrelated checkpoint until the user manually jumps or presses play. Reset cursor to zero and stop playback when id changes or immediately before applying the new session payload, and add a navigation test from a longer session to a shorter one.
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 #2 — adds a full Session Replay page at
/sessions/:id/replay.Features
<input type="range">that spans the entire event sequence; dragging or using arrow keys steps through events deterministicallySpaceplay/pause ·←/→step ·Home/Endjump to start/end (ignored when focus is in a form field)Implementation notes
created_atthenidtie-break;applyEventmapsevent_type → AgentStatusand accumulates per-agent stateseekToIndexjumps to the nearest checkpoint then replays the tail, keeping seek cost O(checkpoint_interval) instead of O(n)replayi18n namespace — full English locale; falls back toenfor other languages (zh/vi/ko) until community translations landdetail.replaykey added to all four existingsessions.jsonlocales; "Replay" button added to theSessionDetailheader barTest plan
Space,←,→,Home,End— all work without focus issuescd client && npx tsc --noEmit— zero errors