OpenCut icon indicating copy to clipboard operation
OpenCut copied to clipboard

feature: enhance media management with project details and improved previews

Open anwarulislam opened this issue 1 year ago β€’ 5 comments

Introduce a new ProjectPanel component for managing project details, add a 'project' tab to the media panel, and enhance media item interfaces with additional properties. Improve media previews with tooltips and integrate a MediaInfo component for better media details display.

Summary by CodeRabbit

  • New Features

    • Introduced detailed media info panels displaying enriched metadata such as bitrate, codec, creation/modification dates, tags, and technical properties.
    • Added tooltips to media previews with comprehensive info and error handling for broken thumbnails.
    • Implemented media count and total size summaries in the media library view.
    • Enhanced project properties panel with save functionality, project/timeline/media statistics, and improved layout.
    • Added context menu options for media items: "Add to Timeline" and "Copy Info" with clipboard and toast feedback.
    • Implemented media properties panel with preview, detailed info, element properties, and action buttons.
  • Improvements

    • Expanded media metadata extraction and storage, including support for tags and additional technical details.
    • Improved media type detection for broader file format support.
    • Added new utility methods for querying and updating media items and statistics.
    • Standardized metadata handling across storage, processing, and state management.
    • Enhanced formatting of file sizes, durations, and labels for better readability.
  • Style

    • Refined UI components for clarity, consistency, and responsiveness, including badges, icons, layout adjustments, and monospace fonts for values.

anwarulislam avatar Jul 21 '25 22:07 anwarulislam

@anwarulislam is attempting to deploy a commit to the OpenCut OSS Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jul 21 '25 22:07 vercel[bot]

Deploy request for appcut pending review.

Visit the deploys page to approve it

Name Link
Latest commit 6cafd7fecd0c139377dc7fc37bdb0a9bfa585a75

netlify avatar Jul 21 '25 22:07 netlify

Walkthrough

This update introduces comprehensive enhancements to media metadata handling and display across the application. New fields such as bitrate, codec name, creation/modification dates, and tags are extracted, stored, and surfaced in the UI. Several components are refactored or newly implemented to present enriched media information, statistics, and improved user interaction, with supporting changes to storage, processing, and store logic.

Changes

File(s) Change Summary
apps/web/src/components/editor/media-info/index.tsx Added new MediaInfo React component to display detailed media metadata, including utility functions for formatting and conditional rendering of properties.
apps/web/src/components/editor/media-panel/views/media.tsx Enhanced media preview with tooltips showing detailed info, added file size formatting, error handling for previews, new context menu actions ("Add to Timeline", "Copy Info"), and media summary display.
apps/web/src/components/editor/properties-panel/media-properties.tsx Fully implemented MediaProperties component to show media preview, detailed info (using MediaInfo), element properties, and action buttons. Added helper for timecode formatting and subcomponent for property display.
apps/web/src/components/editor/properties-panel/index.tsx Major enhancement: added project save button, structured project/media/timeline stats, new formatting helpers, improved property display, and conditional empty states.
apps/web/src/lib/ffmpeg-utils.ts Refactored string quoting, argument array formatting, and extended getVideoInfo to extract and return bitrate and codecName from ffmpeg output. No changes to core logic or error handling.
apps/web/src/lib/media-processing.ts Updated processMediaFiles to extract, include, and initialize new metadata fields (bitrate, codecName, lastModified, tags) for video/audio/image files; updated comments and maintained error handling.
apps/web/src/lib/storage/storage-service.ts Extended media metadata to store/retrieve fps, bitrate, codecName, createdAt, and tags in IndexedDB. Dates are converted to/from ISO strings. No signature changes.
apps/web/src/lib/storage/types.ts Extended MediaFileData interface with optional fps, bitrate, codecName, createdAt, and tags fields.
apps/web/src/stores/media-store.ts Extended MediaItem with new metadata fields; improved file type detection; added methods for updating tags, filtering by type, and computing media stats; updated addMediaItem to auto-assign dates.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MediaPanel
  participant MediaStore
  participant MediaProcessing
  participant StorageService
  participant MediaInfoComponent

  User->>MediaPanel: Uploads/selects media file(s)
  MediaPanel->>MediaProcessing: processMediaFiles(files)
  MediaProcessing->>MediaStore: Add processed MediaItem (with bitrate, codecName, tags, etc.)
  MediaStore->>StorageService: saveMediaItem (with extended metadata)
  User->>MediaPanel: Hovers/opens media item
  MediaPanel->>MediaInfoComponent: Render MediaInfo with metadata

Estimated code review effort

4 (~75 minutes)

Possibly related PRs

  • OpenCut-app/OpenCut#20: Introduces the MediaInfo component and relies on the extended getVideoInfo function, directly connected through the enriched media metadata extraction and display.

Poem

A rabbit hops through code so bright,
With tags and codecs in the light.
Bitrates, sizes, dates now show,
In panels where the details flow.
πŸ‡βœ¨ Media knowledge on displayβ€”
Review complete, hip-hip-hooray!


πŸ“œ 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 cd84df058c1772b1c81e076ff2878269223b1a04 and 6cafd7fecd0c139377dc7fc37bdb0a9bfa585a75.

πŸ“’ Files selected for processing (1)
  • apps/web/src/components/editor/properties-panel/index.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/components/editor/properties-panel/index.tsx
⏰ 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: build (windows-latest)
✨ Finishing Touches
  • [ ] πŸ“ Generate Docstrings

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
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jul 21 '25 22:07 coderabbitai[bot]

hey! the properties panel will already show some project settings when no clips are selected. it'd be an idea to just modify that to show any additional project settings?

mazeincoding avatar Jul 22 '25 10:07 mazeincoding

@mazeincoding good feedback. I'll modify that panel instead.

anwarulislam avatar Jul 22 '25 11:07 anwarulislam