feat: play replay tabs as sequential chapters#2024
Conversation
|
Greptile (@greptileai) review |
|
Claude (@claude) review |
|
Claude finished Nikhil (@shadowfax92)'s task in 2m 39s —— View job Claude finished the review
|
Greptile SummaryThis PR adds sequential, tab-local playback of replay recordings.
Confidence Score: 3/5The event-refresh serialization should be fixed before merging because an obsolete slow request can prevent the current replay from loading. Revision guards reject stale payloads, but all refetches share a persistent promise chain, so a slow or hanging request blocks newer session and revision downloads before those guards can run. packages/browseros-agent/apps/claw-app/screens/replay/replay.data.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant Metadata
participant ReplayData
participant Replay
participant Player as rrweb Player
Metadata->>ReplayData: Publish recording revision
ReplayData->>ReplayData: Fetch matching event snapshot
ReplayData->>Replay: Provide ordered tab chapters
Replay->>Player: Play selected chapter
Player-->>Replay: Reach chapter end
Replay->>Replay: Show one-second handoff
Replay->>Player: Reset and play next visual chapter
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/browseros-agent/apps/claw-app/screens/replay/replay.data.ts:150
**Obsolete refresh blocks current replay**
When an event request for an old revision or previous route session responds slowly or never settles, the persistent promise chain holds every newer refetch behind it, causing the current replay to remain empty with `eventsLoaded` false until that obsolete request finishes.
Reviews (1): Last reviewed commit: "fix(replay): resume growing chapter reco..." | Re-trigger Greptile |
Greptile SummaryAdds sequential, tab-local replay chapters with automatic handoffs and revision-aware event loading.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable issues identified. The chapter lifecycle, manual controls, timer invalidation, session resets, and revision-aware refresh behavior are internally coordinated and covered across the principal reachable playback states. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Replay
participant Viewport as ReplayViewport
participant Player as rrweb Replayer
User->>Replay: Open replay
Replay->>Replay: Select first playable chapter
Replay->>Viewport: Mount tab-local events
Viewport->>Player: Create Replayer
Replay->>Player: Play chapter
Player-->>Replay: Report local playback time
Replay->>Replay: Detect chapter completion
Replay->>Replay: Select next playable tab
Replay-->>User: Show one-second chapter handoff
Replay->>Player: Play next chapter
Replay-->>User: Show replay complete
Reviews (2): Last reviewed commit: "fix(replay): resume growing chapter reco..." | Re-trigger Greptile |
✅ Tests passed — 1718/1722
|
Sequential tab chapters (#2024) made the visible tab's rrweb stream the transport, so any tool that ran after its tab stopped emitting DOM events became unreachable. In the 2026-07-24 Trendshift session tab 1 records 9.003s of events but receives tools at 24.225s, 26.717s and 38.321s; the chapter ended at 9.003s, and only 6 of 16 tab-attributed tools fell inside their tab's span at all. Untabbed tools such as name_session were filtered out of every chapter. Replaces chapter orchestration with one global activity clock and a pure session plan: - session-replay.ts derives the current tool, the visible tab, and the tab-local projection as a function of global time. No camera history, so a backward seek, a forward seek, and a live refresh all agree. - usePlayback owns activity time from animation-frame timestamps instead of mirroring rrweb, and resumes when a live recording grows past where it stopped. - ReplayViewport keeps its single Replayer and aligns it to the projected time, holding a boundary frame while global activity continues past the end of the track. Caption and address bar now have separate sources. - The action timeline is global again: every tool is listed, untabbed and no-visual tools stay current without moving the camera, and a tab click pins the camera only. Tool starts come from the durationMs already on the dispatch row; missing, negative, and non-finite values fall back to completion.

Summary
This is built from the clean
mainreplay. It does not reuse the camera, global-clock, or double-buffer orchestration from #2019.Test plan
bun run scripts/run-bun-test.ts apps/claw-app/screens/replay/Replay.test.tsx apps/claw-app/screens/replay/ReplayViewport.test.tsx apps/claw-app/screens/replay/PlaybackTransport.test.tsx apps/claw-app/screens/replay/tab-view.test.ts apps/claw-app/screens/replay/replay-events.test.ts apps/claw-app/screens/replay/replay.data.test.tsbun run --filter @browseros/claw-app typecheckbun run checkbun run testAll Replay component regressions run under React Strict Mode.