Skip to content

feat(replays): Add next/previous navigation to session replays modal - #4431

Open
Yashh56 wants to merge 4 commits into
umami-software:devfrom
Yashh56:feat/nav-replay
Open

Yashh56 wants to merge 4 commits into
umami-software:devfrom
Yashh56:feat/nav-replay

Conversation

@Yashh56

@Yashh56 Yashh56 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Description

What does this PR do?
This PR adds the ability to seamlessly navigate between consecutive session replays directly from the playback modal, without needing to close it and return to the data table.

Changes included:

  • Global Store: Introduces a new useReplays Zustand store (src/store/replays.ts) to track the list of replays currently being viewed on the active page (works for both the standard Replays table and the Saved Replays table).
  • UI Controls: Adds "Previous" (ChevronLeft) and "Next" (ChevronRight) action buttons to the ReplayPlayback header. These automatically disable when the user reaches the beginning or end of the visible list.
  • Keyboard Shortcuts: Implements ArrowLeft and ArrowRight keyboard navigation inside the modal to quickly jump between adjacent replays. The event listener is attached via the capture phase to bypass any potential focus traps, and prevents default action to avoid conflicting with the rrweb-player's internal seeking controls.

Closes: #4416


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

@Yashh56 is attempting to deploy a commit to the Umami Software Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds previous/next controls and arrow-key navigation to replay playback, backed by the replay rows on the active table page.

  • Stores the active standard or saved replay list in a shared Zustand store.
  • Resolves standard replay IDs from id and saved replay IDs from visitId.
  • Updates the replay query parameter when navigating between adjacent modal entries.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/app/(main)/websites/[websiteId]/replays/ReplaysTable.tsx Publishes the visible standard replay rows to the shared navigation store.
src/app/(main)/websites/[websiteId]/replays/SavedReplaysTable.tsx Publishes saved replay rows while retaining their visit identifiers for playback navigation.
src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayback.tsx Adds adjacent replay buttons and keyboard shortcuts, with identifier selection compatible with both table row shapes.
src/store/replays.ts Adds ephemeral shared Zustand state for the replay rows currently available to modal navigation.

Sequence Diagram

sequenceDiagram
  participant T as Replay table
  participant S as Replay store
  participant M as Playback modal
  participant R as Router
  T->>S: Store visible replay rows
  T->>R: Open selected visit ID
  R->>M: Set replay query parameter
  M->>S: Find current and adjacent rows
  M->>R: Navigate using adjacent visit ID
Loading

Reviews (2): Last reviewed commit: "fix(replays): use visitId over id for sa..." | Re-trigger Greptile

Comment thread src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayback.tsx Outdated
@Yashh56

Yashh56 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai

@Yashh56

Yashh56 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Hey @franciscao633, Can you please review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant