Skip to content

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Oct 29, 2025

New Pull Request Checklist

Issue Description

The issue is that the ImageElement, VideoElement, and AudioElement components are simple functional components that don't handle URL changes properly. When the URL prop changes (because a different row is selected), the browser may still cache and display the previous media content.

Approach

The solution is to add a key prop based on the URL to force React to unmount and remount the component when the URL changes.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved stability and rendering consistency for collections of images, videos, and audio items in the aggregation panel.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 29, 2025

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

@parseplatformorg
Copy link
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Oct 29, 2025

📝 Walkthrough

Walkthrough

React element keys for media items (images, videos, audio) in the AggregationPanel component now incorporate the item URL alongside the index to ensure uniqueness, replacing index-only keys. Other item types remain unaffected.

Changes

Cohort / File(s) Change Summary
Media item key composition
src/components/AggregationPanel/AggregationPanel.js
Updated React keys for image, video, and audio items from index-only (key={idx}) to composite format (key={\${idx}-${item.url}`}`) to improve uniqueness and prevent re-rendering issues when items with different URLs share the same index.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that item.url is consistently available for all image, video, and audio items to prevent key generation issues
  • Confirm the change doesn't introduce unintended re-renders or side effects in related components
  • Check whether existing tests need updates to accommodate the new key format

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "fix: Info panel briefly shows cached media content from previously selected cell when using pre-fetch" is specific, clear, and directly relates to the main change in the changeset. It accurately describes the bug being fixed and aligns with the code modification that adds unique keys for media elements based on URLs to prevent React from reusing stale components. The title uses professional conventional commit formatting and is concise without vague terminology, effectively communicating the primary change to reviewers.
Description Check ✅ Passed The pull request description follows the provided template structure and includes the substantive sections required: the New Pull Request Checklist with appropriate items checked, a detailed Issue Description explaining the problem with media component caching, and a clear Approach section describing the solution. However, the description is incomplete in that the "Closes: FILL_THIS_OUT" field for linking to a specific issue was not filled in with an actual issue number, and the TODOs checklist items remain unchecked without clarification on their status. Despite these gaps, the core informational content about the issue and solution is well-documented and sufficient for understanding the PR's purpose.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 92ba334 and b7f48cc.

📒 Files selected for processing (1)
  • src/components/AggregationPanel/AggregationPanel.js (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/AggregationPanel/AggregationPanel.js (1)
src/components/AggregationPanel/AggregationPanelComponents.js (6)
  • ImageElement (79-85)
  • ImageElement (79-85)
  • VideoElement (88-95)
  • VideoElement (88-95)
  • AudioElement (98-105)
  • AudioElement (98-105)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Docker linux/amd64
🔇 Additional comments (1)
src/components/AggregationPanel/AggregationPanel.js (1)

116-120: Excellent fix for preventing stale media content display.

Incorporating the URL into the React key ensures that media components are properly unmounted and remounted when the content changes, preventing the visual artifact of briefly showing the previous cell's media. This is the correct approach for image, video, and audio elements where async loading can cause stale content to flash.

The fix is well-targeted—text, table, and button elements don't require URL-based keys since they update synchronously without visual artifacts.

Please verify that item.url is always defined for media items to avoid keys like 0-undefined. If there's any possibility of missing URLs, consider adding a fallback:

key={`${idx}-${item.url || 'no-url'}`}

Also, as noted in the PR description, remember to:

  • Add tests to verify the fix prevents stale media display during cell transitions
  • Update documentation to reflect this key generation pattern for media elements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mtrezza mtrezza changed the title fix: Info panel briefly shows media content from previous selected cell when using pre-fetch fix: Info panel briefly shows cached media content from previous selected cell when using pre-fetch Oct 29, 2025
@mtrezza mtrezza changed the title fix: Info panel briefly shows cached media content from previous selected cell when using pre-fetch fix: Info panel briefly shows cached media content from previously selected cell when using pre-fetch Oct 29, 2025
@mtrezza mtrezza merged commit dd6a85e into parse-community:alpha Oct 29, 2025
11 checks passed
@mtrezza mtrezza deleted the fix/aggegation-panel-show-old-content branch October 29, 2025 10:36
parseplatformorg pushed a commit that referenced this pull request Oct 29, 2025
# [8.0.0-alpha.3](8.0.0-alpha.2...8.0.0-alpha.3) (2025-10-29)

### Bug Fixes

* Info panel briefly shows cached media content from previously selected cell when using pre-fetch ([#3008](#3008)) ([dd6a85e](dd6a85e))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.0.0-alpha.3

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Oct 29, 2025
parseplatformorg pushed a commit that referenced this pull request Nov 1, 2025
# [8.0.0](7.5.0...8.0.0) (2025-11-01)

### Bug Fixes

* Add missing major version increase of dashboard release ([#3005](#3005)) ([5debb4d](5debb4d))
* Cannot connect to server with error invalid header name ([#3006](#3006)) ([ea4ec07](ea4ec07))
* Currently displayed view reloads when editing and saving a different view ([#3002](#3002)) ([794a35a](794a35a))
* Dashboard config objects stored on server with public read / write access ([#2997](#2997)) ([31a4639](31a4639))
* ESC key does not cancel editing in data browser cell ([#3001](#3001)) ([d1d7241](d1d7241))
* Filter text field in data browser partly looses focus when hitting enter key to apply filter ([#2992](#2992)) ([e3085b9](e3085b9))
* Filter text field in data browser partly looses focus when selecting in drop-down element by hitting enter key to apply filter ([#2993](#2993)) ([f4c17c7](f4c17c7))
* Info panel briefly shows cached media content from previously selected cell when using pre-fetch ([#3008](#3008)) ([dd6a85e](dd6a85e))
* Missing alert when changing data browser browser data while rows are selected ([#2994](#2994)) ([6cabaa3](6cabaa3))
* Security upgrade parse from 3.5.1 to 7.0.1 ([#3003](#3003)) ([5123fbf](5123fbf))
* Security upgrade passport from 0.5.3 to 0.6.0 ([#3000](#3000)) ([fbb5e6d](fbb5e6d))
* Session management issue that causes malformed redirect URLs ([#3011](#3011)) ([1649dd3](1649dd3))
* Storing view on server creates view key with hashed view name instead of UUID ([#2995](#2995)) ([7cb65f3](7cb65f3))
* Switching between browser tabs can cause illegible text color for config parameter value field ([#3010](#3010)) ([77c5c67](77c5c67))
* View table data may be retained when switching between views ([#2996](#2996)) ([ddc91c9](ddc91c9))

### Features

* Add `matches regex` filter to data browser replacing limited `string contains string` filter ([#2991](#2991)) ([64a9f71](64a9f71))
* Add info panel options `prefetchImage`, `prefetchVideo`, `prefetchAudio` to pre-fetch media content in the info panel ([#3009](#3009)) ([6796c9e](6796c9e))
* Add Parse Server version compatibility detection ([#3004](#3004)) ([9a7a60f](9a7a60f))

### Performance Improvements

* Storing, deleting, modifying view in server storage now only affects the specific view instead of updating all views ([#2998](#2998)) ([48cea3c](48cea3c))

### BREAKING CHANGES

* This increases the required minimum version to Parse Server 7. ([5debb4d](5debb4d))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released Released as stable version state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants