Skip to content

Conversation

@jerryzhou196
Copy link
Member

@jerryzhou196 jerryzhou196 commented Nov 3, 2025

playlist_demo

…imestamps

Added functionality to display the start and end timestamps of replays in the ReplayTable and ReplayDetails components. This allows users to navigate between replays with context on their timing, improving the overall user experience. Updated ReplayDetailsUserBadge to include navigation buttons for previous and next replays.
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 3, 2025
@jerryzhou196 jerryzhou196 changed the title feat(replays): Enhance replay details navigation with start and end timestamps feat(replays): add ability to travel to previous and next replay Nov 3, 2025
@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #102583      +/-   ##
===========================================
+ Coverage   79.46%    80.66%   +1.19%     
===========================================
  Files        9225      9241      +16     
  Lines      394205    393373     -832     
  Branches    25104     25052      -52     
===========================================
+ Hits       313252    317311    +4059     
+ Misses      80505     75600    -4905     
- Partials      448       462      +14     

…ed props for next and previous replays in the ReplayDetailsUserBadge component, streamlining the code. Adjusted the loading placeholder height for better visual consistency. This change enhances the component's clarity and performance by eliminating unnecessary complexity
…ation Refactored the ReplayDetails component to use 'undefined' instead of 'null' for next and previous replay checks, enhancing clarity. Updated ReplayDetailsPageBreadcrumbs to include navigation buttons for previous and next replays, improving user experience by allowing seamless navigation between replays. This change streamlines the code and enhances the overall functionality of the replay details view.
Replaced the 'Next' icon in ReplayPlayPauseBar with 'IconChevron' for improved clarity. Refactored ReplayDetailsPageBreadcrumbs to utilize 'ButtonBar' for previous and next replay navigation buttons, enhancing the user interface and experience. This change streamlines the navigation between replays, making it more intuitive for users.
…d components

Refactored the ReplayTable component to streamline the handling of replay start times by removing the end timestamp logic. Updated related components to eliminate unnecessary props and improve clarity. This change enhances the overall performance and readability of the replay table, making it easier to manage replay data.
…ameters

- Imported `encodeSort` from `eventView` to handle sorting in the replay table.
- Updated the `ReplaySessionColumn` to utilize the new sorting mechanism without modifying the URL directly.
- Refactored query parameters in `ReplayDetails` to include `playlistStart` and improved handling of the `sort` parameter using `useUrlParams`.
- Exported `DEFAULT_SORT` from `useReplayTableSort` for broader accessibility.
@jerryzhou196 jerryzhou196 marked this pull request as ready for review November 5, 2025 21:31
@jerryzhou196 jerryzhou196 requested a review from a team as a code owner November 5, 2025 21:31
Updated the replay table component to calculate and pass the latest replay timestamp as 'end' instead of 'start'. Adjusted related components and queries to reflect this change, ensuring consistency across the application.
andrewshie-sentry pushed a commit that referenced this pull request Nov 13, 2025
…o IconChevron (#102985)

In prep for #102583, swap the `IconNext` logo with `IconChevron` to free
up for the replay playlist buttons.
…adcrumbs

- Replaced direct usage of location with useRef to store the initial location.
- Updated query object construction to utilize the ref, enhancing consistency in query handling.
- Replaced `StyledFlex` with `Flex` for consistency in component usage.
- Introduced `StyledDiv` for better styling of the replay link.
…istency

- Changed `queryReferrer` from 'replayList' to 'playlist' to align with updated naming conventions.
- This change enhances clarity in the query handling logic.
…yDetailsProviders

- Updated query construction in `ReplaySessionColumn` to include `start` and `end` parameters for better playlist navigation.
- Renamed `queryReferrer` from 'playlist' to 'replaysPlayList' for consistency across components.
- Improved clarity in query handling by explicitly managing playlist parameters in `ReplayDetailsProviders`.
- Streamlined the query object to avoid confusion with regular parameters, enhancing maintainability.
- Updated query construction to use `DEFAULT_REPLAY_LIST_SORT` for sorting, ensuring consistent default behavior.
- Removed conditional check for `playlistSort` to streamline query handling logic.
- Enhanced the `enabled` flag in the query to focus on essential parameters, improving clarity in data fetching.
…sPageBreadcrumbs

- Replaced `StyledDiv` with `ShortId` to better represent the component's purpose.
- Updated the component usage in the breadcrumb section to maintain consistency and improve readability.
- Modified the query sorting logic to use `DEFAULT_REPLAY_LIST_SORT` when `playlistSort` is an empty string, ensuring consistent default behavior.
- This change enhances the clarity of the query construction process in the component.
…ter clarity

- Updated the query sorting logic to handle cases where `playlistSort` is undefined or an empty string, ensuring consistent default behavior with `DEFAULT_REPLAY_LIST_SORT`.
- This change enhances the clarity and robustness of the query construction process.

// We use a ref to store the initial location so that we can use it to navigate to the previous and next replays
// without dirtying the URL with the URL params from the tabs navigation.
const initialLocation = useRef(location);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Replay Navigation Loses Query Context

The initialLocation ref captures the location only on component mount and never updates. When navigating between replays using next/previous buttons, the component doesn't remount (only the route param changes), so subsequent navigations will incorrectly use query parameters from the very first replay viewed rather than preserving the query context as you move through the playlist.

Fix in Cursor Fix in Web

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about this offline and agreed this is fine - I'm re-thinking this because I think this will be a maintenance nightmare down the road. It might be better to be explicit about the query params we want to preserve. Let's not change anything on this PR for now, but let's talk about it some more after this gets merged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

- Updated the parseStatsPeriod function to include an optional UTC parameter, allowing for more flexible date handling.
- Adjusted the ReplaySessionColumn to utilize the new UTC functionality when parsing the stats period, improving the accuracy of date calculations.
true
);
detailsTabQuery.playlistStart = playlistStart;
detailsTabQuery.playlistEnd = playlistEnd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Time Zone Mismatch Causes Data Errors

When statsPeriod is converted to absolute timestamps using UTC via parseStatsPeriod(..., undefined, true), the resulting playlistStart and playlistEnd are UTC timestamps. However, the code doesn't set a corresponding utc parameter in detailsTabQuery to indicate this. Without explicitly setting utc: 'true', the API might misinterpret these UTC timestamps as local time, potentially returning incorrect replays from the wrong time range.

Fix in Cursor Fix in Web

Copy link
Member

@billyvg billyvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

…handling

- Updated comment in `ReplaySessionColumn` to improve clarity on the manual addition of fields to the query, enhancing code readability.
@jerryzhou196 jerryzhou196 merged commit ddb060f into master Nov 13, 2025
48 checks passed
@jerryzhou196 jerryzhou196 deleted the replay-carousal branch November 13, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants