Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(Builder): Add Video and Image Rendering to Block outputs #8167

Merged
merged 9 commits into from
Sep 27, 2024

Conversation

Torantulino
Copy link
Member

@Torantulino Torantulino commented Sep 25, 2024

Background

We want to be able to previous images and videos in the Builder.

Changes 🏗️

This change checks if an output url points to an image or a video, and renders it in the output table rather than displaying the url.
This works for raw video urls and YouTube urls.

Testing 🔍

image

Recording.2024-09-25.155309.mp4

@Torantulino Torantulino requested a review from a team as a code owner September 25, 2024 14:56
@Torantulino Torantulino requested review from Swiftyos and Bentlybro and removed request for a team September 25, 2024 14:56
@github-actions github-actions bot added the platform/frontend AutoGPT Platform - Front end label Sep 25, 2024
Copy link

PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 Security concerns

Cross-Site Scripting (XSS):
The code directly renders URLs as image sources and video sources without sanitization. This could potentially lead to XSS attacks if the URLs are user-provided or come from an untrusted source. Consider implementing URL validation or sanitization before rendering.

⚡ Key issues to review

Performance Concern
The isValidVideoUrl and isValidImageUrl functions are called for every cell, which could be inefficient for large datasets.

Accessibility Issue
The VideoRenderer component doesn't provide captions or transcripts for videos, which may affect accessibility.

Error Handling
There's no error handling for cases where the video or image fails to load.

Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 1a0b594
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/66f5ef357b3ff5000890250d

Copy link
Member

@ntindle ntindle left a comment

Choose a reason for hiding this comment

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

Extract all this rendering to a reusable component isolated from this concern. We may want to do this across the app and also polluting the datatable is not the place for this code

autogpt_platform/frontend/src/components/DataTable.tsx Outdated Show resolved Hide resolved
autogpt_platform/frontend/src/components/DataTable.tsx Outdated Show resolved Hide resolved
autogpt_platform/frontend/src/components/DataTable.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Sep 26, 2024
@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Sep 26, 2024
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@github-actions github-actions bot added size/l and removed size/m labels Sep 26, 2024
@majdyz majdyz requested review from ntindle and majdyz September 26, 2024 14:57
@majdyz majdyz enabled auto-merge (squash) September 26, 2024 14:58
@majdyz majdyz removed their request for review September 26, 2024 15:08
@majdyz
Copy link
Contributor

majdyz commented Sep 26, 2024

Removing myself from the reviewer list to remove bias

@majdyz majdyz merged commit dc6c1bb into master Sep 27, 2024
13 checks passed
@majdyz majdyz deleted the toran/open-1757-media-displaypreview-on-blocks branch September 27, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants