fix: Improve data filtering logic and simplify date range checks in PlaybackPerformanceDashboard - #2056
Merged
Merged
Conversation
…laybackPerformanceDashboard
kishan-gondaliya-7270
approved these changes
Jul 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Improves analytics dashboard data handling and date range selection readability, plus adds a PHPCS ignore for a build-asset include in the image block renderer.
Changes:
- Simplified date-range “start new range” condition in
DateRangePicker. - Removed
|| []fallback when derivingfilteredDatainPlaybackPerformanceDashboard. - Added
phpcs:ignorecomment for including the generated asset metadata file ingodam-imagerender code.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pages/analytics/components/DateRangePicker/index.js | Simplifies condition used to start a new date-range selection. |
| pages/analytics/PlaybackPerformance.js | Removes empty-array fallback when filtering/assigning parsedData into filteredData. |
| assets/src/blocks/godam-image/render.php | Adds PHPCS ignore rationale for including a build-generated asset file via a variable path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
165
to
176
| if ( rangeActive ) { | ||
| startDate = fromISO( range.startDate ); | ||
| endDate = fromISO( range.endDate ); | ||
| filteredData = ( parsedData || [] ).filter( ( d ) => { | ||
| filteredData = parsedData.filter( ( d ) => { | ||
| const t = new Date( d.date ); | ||
| return t >= startDate && t <= endDate; | ||
| } ); | ||
| } else { | ||
| filteredData = parsedData || []; | ||
| filteredData = parsedData; | ||
| startDate = | ||
| filteredData.length > 0 | ||
| ? d3.min( filteredData, ( d ) => d.date ) |
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.
This pull request includes several small but important improvements to the analytics dashboard and image rendering code. The main changes focus on simplifying code, improving filtering logic, and minor code style adjustments.
Analytics dashboard improvements:
PlaybackPerformanceDashboardby removing unnecessary fallback to an empty array when filteringparsedData, ensuringfilteredDatais always an array.DateRangePicker, simplified the condition for starting a new date range selection, making the code more readable and reliable.Code style and maintainability:
phpcs:ignorecomment ingodam-image/render.phpto clarify the inclusion of a build asset file, improving maintainability and code clarity.