Skip to content

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Dec 10, 2025

Summary by CodeRabbit

  • New Features

    • Added video rendering capability in data views and tables, supporting custom dimensions, playback controls, and scale-to-fit content mode with built-in URL sanitization.
  • Documentation

    • Updated guides with video component documentation, including configuration examples, styling information, and security considerations for video URLs.

✏️ Tip: You can customize this high-level summary in your review settings.

@parse-github-assistant
Copy link

🚀 Thanks for opening this pull request!

@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

📝 Walkthrough

Walkthrough

Adds Video as a new view type to the dashboard. Updates README documentation with Video section detailing rendering with video tags, controls, sizing, and URL sanitization examples. Extends Views component to recognize and render Video-type values with sanitized URLs, optional width/height, object-fit scaling, and error handling.

Changes

Cohort / File(s) Summary
Documentation
README.md
Adds Video entry to table of contents, new Video section for info panels with JSON example payload and warnings about URL sanitization, and standalone Video item section in UI component guides with styling notes.
Video Rendering Support
src/dashboard/Data/Views/Views.react.js
Extends value-type inference across multiple render paths to recognize Video as valid type. Implements video element rendering in table cells with URL sanitization, optional width/height attributes, object-fit containment styling, and error handling to hide on load failure. Updates normalization logic to classify Video values when constructing rows and columns.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas requiring attention:
    • Type inference logic updates across multiple render paths to ensure Video type is consistently recognized
    • URL sanitization implementation for video URLs and how it integrates with existing patterns for other media types
    • Width/height handling and object-fit styling to confirm proper sizing behavior in table cells
    • Error handling for video load failures and edge cases

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided; the template requires Issue Description, Approach, and TODOs sections to be completed. Add a complete description following the template with Issue Description (referencing the related issue), Approach explaining the implementation, and relevant TODOs.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding support for a Video type in the View table to display videos.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/dashboard/Data/Views/Views.react.js (1)

497-533: Consider strengthening URL sanitization.

The current regex-based URL sanitization using url.match(/javascript/i) and url.match(/<script/i) can be bypassed with various encoding techniques (e.g., java\nscript:, HTML entities, URL encoding). While this matches the existing Image implementation, consider using a more robust approach for both.

A safer approach would be to validate the URL scheme explicitly:

-            if (
-              !url ||
-              url.match(/javascript/i) ||
-              url.match(/<script/i)
-            ) {
-              url = '#';
-            }
+            try {
+              const parsedUrl = new URL(url, window.location.origin);
+              if (!['http:', 'https:', 'data:'].includes(parsedUrl.protocol)) {
+                url = '#';
+              }
+            } catch {
+              url = '#';
+            }

This would apply to the Image type as well (lines 464-471) for consistency.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd75c5a and 84633f0.

📒 Files selected for processing (2)
  • README.md (2 hunks)
  • src/dashboard/Data/Views/Views.react.js (3 hunks)
⏰ 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 (4)
src/dashboard/Data/Views/Views.react.js (2)

276-277: LGTM!

The Video type detection during column building follows the established pattern used for other types like Image and Link.


411-412: LGTM!

The Video type detection in row rendering mirrors the column-building logic, maintaining consistency.

README.md (2)

102-102: LGTM!

Table of contents entry correctly added for the new Video section.


1637-1654: LGTM!

Documentation is well-structured, follows the established pattern from the Image section, and includes appropriate security warnings. The JSON example clearly shows the expected structure with __type, url, width, and height properties.

@mtrezza mtrezza merged commit bd4aa4f into parse-community:alpha Dec 10, 2025
12 checks passed
@mtrezza mtrezza deleted the feat/view-video branch December 10, 2025 21:35
parseplatformorg pushed a commit that referenced this pull request Dec 10, 2025
# [8.2.0-alpha.4](8.2.0-alpha.3...8.2.0-alpha.4) (2025-12-10)

### Features

* Add support for `Video` type in View table to display videos ([#3061](#3061)) ([bd4aa4f](bd4aa4f))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.2.0-alpha.4

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

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants