Conversation
🦋 Changeset detectedLatest commit: 6468f6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
The new note marker adds per-marker global keydown listeners and overly broad keydown propagation blocking, which should be adjusted to avoid scalability and keyboard-interaction issues.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds an “annotation” custom-event convention to rrweb-player, enabling timed captions (stateful set/clear) and point-in-time hover notes (seekable timeline markers), along with public typing and documentation so recording authors can emit these events safely.
Changes:
- Introduces annotation parsing and caption state reconstruction (
parseAnnotation,getCaptions,getActiveCaption) plus new unit/integration tests. - Updates player/controller UI to render captions, add a CC toggle (
showCaptions), and render seekable note markers with tooltip behavior. - Documents the new payload shapes and adds a minor changeset for release.
File summaries
| File | Description |
|---|---|
| packages/rrweb-player/test/annotations.test.ts | Unit tests for annotation parsing and caption timeline state logic. |
| packages/rrweb-player/test/annotations-player.test.ts | Happy-dom integration tests covering captions, CC toggle, notes, seeking, packing, and dynamic events. |
| packages/rrweb-player/src/types.ts | Adds showCaptions option to the public player props typing. |
| packages/rrweb-player/src/Player.svelte | Wires caption state to controller time, renders caption overlay, and passes events/time/caption state into the controller. |
| packages/rrweb-player/src/main.ts | Re-exports CustomEventAnnotation type from the package entrypoint. |
| packages/rrweb-player/src/Controller.svelte | Filters annotation events so only notes create timeline markers; adds CC toggle UI and note marker component usage. |
| packages/rrweb-player/src/components/CustomEventMarker.svelte | New interactive marker component with tooltip + Escape dismissal behavior. |
| packages/rrweb-player/src/annotations.ts | New annotation parsing and caption state helpers with exported payload union type. |
| packages/rrweb-player/README.md | Documents showCaptions and the annotation note/caption custom-event usage. |
| docs/recipes/custom-event.md | Adds a detailed recipe section describing note/caption behavior, payload validation, and TypeScript usage. |
| .changeset/quiet-notes-play.md | Minor changeset describing the new captions/notes feature set. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Bundle Size ChangesSize change: +83.48 kB (+0.80%) | Total size: 10512.52 kB
|
| File | Base | PR | Diff |
|---|---|---|---|
rrweb-player.cjs |
473.44 kB | 497.25 kB | +23.81 kB (+5.03%) 🔍 |
rrweb-player.js |
473.32 kB | 497.13 kB | +23.81 kB (+5.03%) 🔍 |
rrweb-player.umd.cjs |
476.24 kB | 500.10 kB | +23.86 kB (+5.01%) 🔍 |
rrweb-player.umd.min.cjs |
221.15 kB | 229.02 kB | +7.86 kB (+3.56%) |
style.css |
5.44 kB | 7.52 kB | +2.09 kB (+38.38%) 🔍 |
style.min.css |
4.88 kB | 6.93 kB | +2.05 kB (+42.09%) 🔍 |
There was a problem hiding this comment.
🟡 Changes recommended
The new bind:currentTime coupling makes Player update every animation frame even when captions are disabled, creating a likely performance regression that should be addressed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
packages/rrweb-player/src/Controller.svelte:24
eventsis required forcustomEvents/inactivePeriodsderivations (events.length, indexing), but there is no runtime default. IfControlleris ever instantiated without passingevents(or during a refactor), it will throw at runtime.
Providing a safe default keeps the component more robust without changing current behavior when Player passes the prop.
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is coherent, documented, and thoroughly covered for parsing, playback behavior, accessibility, dynamic events, and performance.
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 0 new
- Review effort level: Balanced
…odex/player-annotations
There was a problem hiding this comment.
🟡 Changes recommended
Same-timestamp appended captions can diverge during playback, and dismissing a focused note loses keyboard focus.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 2
- Review effort level: Balanced
@rrweb/all
@rrweb/browser-client
@rrweb/packer
@rrweb/record
@rrweb/replay
rrdom
rrdom-nodejs
rrvideo
rrweb
rrweb-player
rrweb-snapshot
@rrweb/types
@rrweb/utils
@rrweb/rrweb-plugin-canvas-webrtc-record
@rrweb/rrweb-plugin-canvas-webrtc-replay
@rrweb/rrweb-plugin-console-record
@rrweb/rrweb-plugin-console-replay
@rrweb/rrweb-plugin-network-record
@rrweb/rrweb-plugin-network-replay
@rrweb/rrweb-plugin-sequential-id-record
@rrweb/rrweb-plugin-sequential-id-replay
commit: |
There was a problem hiding this comment.
🟡 Changes recommended
Caption restoration performs redundant logarithmic lookups for every caption crossed during a seek.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 1
- Review effort level: Balanced
Summary
Add captions and timeline notes to rrweb-player using custom events tagged
annotation.A caption stays visible until another caption replaces or clears it. Omitting
actionmeansset. Seeking restores the caption for that point in the recording. Captions default to hidden;showCaptions: trueenables them, and recordings containing captions show a CC toggle.Hovering or focusing a note's timeline marker opens its text. Clicking the marker seeks to that timestamp. Clicking or scrolling inside the open text panel leaves playback where it is. Notes do not change captions, and caption events do not add timeline markers.
CustomEventAnnotationis exported from@rrweb/typesand re-exported byrrweb-player. Other custom-event tags keep their existing markers.Implementation
The player listens for
custom-eventto update captions during playback. It indexes caption actions and timeline markers to restore state on seeks without scanning the recording every frame. Appended events extend the index; out-of-order insertions rebuild it. The parent player updates when caption text changes.Validation