Skip to content

Conversation

@yuto-trd
Copy link
Member

@yuto-trd yuto-trd commented Dec 5, 2025

Description

Implement element preview functionality with support for images, videos, and audio waveforms. Enhance video rendering and introduce a mechanism for preview invalidation. Add properties for speed and loop configuration in video sources, and provide a toggle to disable previews.

Breaking changes

None.

Fixed issues

None.

Copilot AI review requested due to automatic review settings December 5, 2025 16:32
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a comprehensive element preview system for the Beutl application, adding visual feedback for video (thumbnails) and audio (waveforms) elements in the timeline. The implementation includes new custom controls for rendering previews,ViewModel integration for managing preview data, serialization support for preview preferences, and operator implementations that provide preview data through a new interface. Additionally, video sources now support speed and loop properties.

Key Changes

  • Added IElementPreviewProvider interface with implementations in SourceVideoOperator and SourceSoundOperator to generate thumbnails and waveform data respectively
  • Introduced WaveformControl and ThumbnailStripControl custom Avalonia controls to render audio waveforms and video thumbnails in the timeline
  • Extended ElementViewModel with preview management logic including cancellation, throttling, and invalidation handling

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/Beutl/Views/WaveformControl.cs New control for rendering audio waveform visualization with thread-safe chunk updates
src/Beutl/Views/ThumbnailStripControl.cs New control for rendering video thumbnail strips with proper bitmap disposal
src/Beutl/Views/ElementView.axaml.cs Wires up preview controls to ElementViewModel events for thumbnail and waveform updates
src/Beutl/Views/ElementView.axaml Adds preview controls to the UI and toggle menu item for disabling previews
src/Beutl/ViewModels/TimelineViewModel.cs Adds persistence of preview-disabled elements state to/from JSON
src/Beutl/ViewModels/ElementViewModel.cs Core preview management logic with async loading, cancellation, and event handling
src/Beutl.ProjectSystem/SceneComposer.cs Adds explicit ClearSounds() call to prevent audio accumulation
src/Beutl.ProjectSystem/Operation/IElementPreviewProvider.cs New interface defining preview generation contract for operators
src/Beutl.Operators/Source/SourceVideoOperator.cs Implements video thumbnail generation and preview invalidation tracking
src/Beutl.Operators/Source/SourceSoundOperator.cs Implements audio waveform chunk generation with proper audio composing
src/Beutl.Operators/Source/SourceImageOperator.cs Minor UTF-8 BOM fix (no functional changes)
src/Beutl.Language/Strings*.resx Adds localized strings for the "Disable Preview" toggle option
src/Beutl.Language/Strings.Designer.cs Generated code for new localization strings
src/Beutl.Engine/Properties/AssemblyInfo.cs Grants InternalsVisibleTo access to Beutl.Operators assembly
src/Beutl.Engine/Graphics/SourceVideo.cs Adds Speed and IsLoop properties, exposes internal DrawInternal method for thumbnail rendering
src/Beutl.Engine/Engine/EngineObject.cs Changes reflection cache to use concurrent collections for thread safety
src/Beutl.Engine/Audio/Composing/Composer.cs Makes AddSound and ClearSounds public, removes automatic clearing
src/Beutl.Engine.SourceGenerators/EngineObjectResourceGenerator.cs Wraps disposal logic in if (disposing) block and fixes indentation
Files not reviewed (1)
  • src/Beutl.Language/Strings.Designer.cs: Language not supported
Comments suppressed due to low confidence (2)

src/Beutl/ViewModels/ElementViewModel.cs:662

  • Poor error handling: empty catch block.
        catch (OperationCanceledException)
        {
        }

src/Beutl/ViewModels/ElementViewModel.cs:665

  • Poor error handling: empty catch block.
        catch
        {
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yuto-trd yuto-trd force-pushed the feat/element-preview branch from a35ecd4 to 0d6d6f1 Compare December 6, 2025 16:00
yuto-trd and others added 16 commits December 7, 2025 01:59
@yuto-trd yuto-trd force-pushed the feat/element-preview branch from 80c77ee to 8748769 Compare December 6, 2025 16:59
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

No TODO comments were found.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
Beutl.Operators 3% 0% 140
Beutl.Core 34% 31% 3144
Beutl.Engine 27% 24% 9892
Beutl.Threading 100% 94% 118
Beutl.Utilities 73% 67% 358
Beutl.Configuration 38% 19% 282
Beutl.Extensibility 2% 0% 105
Beutl.ProjectSystem 17% 10% 1867
Beutl.Language 0% 0% 659
Summary 27% (10575 / 39487) 25% (2815 / 11277) 16565

Minimum allowed line rate is 0%

@yuto-trd yuto-trd merged commit a7c507d into main Dec 6, 2025
4 checks passed
@yuto-trd yuto-trd deleted the feat/element-preview branch December 6, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants