Skip to content

Conversation

@yuto-trd
Copy link
Member

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

Description

Introduce the Beutl.Editor project to the solution, implementing core operations for editing functionality, including change operations and history management. This update supports undo/redo functionality and improves state management through transaction support.

Breaking changes

Refactor existing command recording to utilize the new HistoryManager for committing changes.

Fixed issues

None.

- Added CoreObjectOperationObserver to track changes in core objects and their properties.
- Introduced EnginePropertyOperationObserver for observing engine properties.
- Created IPropertyPathProvider interface for providing property paths.
- Implemented various change operations including InsertCollectionItemOperation, RemoveCollectionItemOperation, and UpdatePropertyValueOperation.
- Added support for moving and inserting collection items with MoveCollectionItemOperation and MoveCollectionRangeOperation.
- Implemented operation applier to handle applying change operations in a controlled manner.
- Introduced PublishingSuppression to prevent echo-back during remote operation applications.
- Added PropertyPathHelper for extracting property names from paths.
- Added CoreObjectOperationObserver to track changes in core objects and their properties.
- Introduced EnginePropertyOperationObserver for observing engine properties.
- Created IOperationObserver interface for consistent operation observation.
- Developed ChangeOperation base class for handling change operations.
- Implemented various operations for manipulating collection items, including Insert, Remove, Move, and Update operations.
- Added support for property path tracking through IPropertyPathProvider interface.
- Enhanced operation applier to handle new operations and ensure proper application of changes.
…eration interfaces for enhanced change operation handling
@yuto-trd

This comment was marked as resolved.

@yuto-trd

This comment has been minimized.

@yuto-trd yuto-trd marked this pull request as ready for review December 27, 2025 22:47
Copilot AI review requested due to automatic review settings December 27, 2025 22:47
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 introduces the Beutl.Editor project to implement a comprehensive undo/redo system using HistoryManager and operation-based change tracking. The refactoring replaces the previous CommandRecorder pattern with a more robust history management system that automatically tracks changes through observers.

Key Changes:

  • Introduces HistoryManager with transaction-based undo/redo functionality
  • Implements CoreObjectOperationObserver for automatic change tracking
  • Adds ChangeOperation hierarchy for representing different types of edits
  • Refactors all editing operations throughout the codebase to use the new HistoryManager.Commit() pattern

Reviewed changes

Copilot reviewed 109 out of 110 changed files in this pull request and generated 24 comments.

Show a summary per file
File Description
tests/Beutl.UnitTests/Editor/HistoryManagerTests.cs Comprehensive unit tests for HistoryManager functionality including transactions, undo/redo, and state management
tests/Beutl.UnitTests/Editor/HistoryManagerIntegrationTests.cs Integration tests verifying HistoryManager works correctly with CoreObject property changes and collections
src/Beutl/ViewModels/EditViewModel.cs Major refactoring to use HistoryManager instead of CommandRecorder with automatic change tracking
src/Beutl/Views/*.cs Multiple view files updated to call HistoryManager.Commit() after operations
src/Beutl/ViewModels/Editors/*.cs Property editor view models refactored to use new Commit() pattern
src/Beutl.ProjectSystem/ProjectSystem/Scene.cs Scene operations (AddChild, DeleteChild, etc.) simplified to directly modify state
src/Beutl.ProjectSystem/NodeTree/*.cs NodeTree classes updated with proper property registration for change tracking
src/Beutl.Editor/Operations/*.cs New operation classes (UpdatePropertyValueOperation, RemoveCollectionItemOperation, etc.)
src/Beutl.Language/CommandNames*.resx New localized command name resources for history display
src/Beutl/Helpers/AddOrSetHelper.cs Simplified helper methods to work with new history system
Files not reviewed (1)
  • src/Beutl.Language/CommandNames.Designer.cs: Language not supported

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

yuto-trd and others added 8 commits December 28, 2025 14:10
…oSaveService and CollectionOperationObserver
…Observer

- Implement tests for PropertyPathHelper to validate property name extraction from paths with various formats.
- Create comprehensive tests for SplineEasingOperationObserver covering constructor behavior, operation tracking, disposal, and change notifications.
- Ensure tests cover edge cases such as empty paths, nested properties, and suppression of change notifications.
…deItemOperation and UpdatePropertyValueOperation
…itor operations

Remove unused OperationApplier class and add extensive unit tests for
HistoryManager's BeginRecordingScope feature, including tests for
state capture, undo/redo, cancellation, and nested scopes. Also add
new test files for AutoSaveService, CollectionChangeOperation,
CustomOperation, UpdateNodeItemOperation, UpdatePropertyValueOperation,
and UpdateSplineEasingOperation.
@github-actions
Copy link
Contributor

The following TODO comments were found:

// TODO: MediaSource.Openがされた状態ではUnmanagedなリソースを作成せず,EngineObject.Resourceが作成,更新されたときにリソースの作成などを行う

// TODO: MediaSource.Openがされた状態ではUnmanagedなリソースを作成せず,EngineObject.Resourceが作成,更新されたときにリソースの作成などを行う

// TODO: MediaSource.Openがされた状態ではUnmanagedなリソースを作成せず,EngineObject.Resourceが作成,更新されたときにリソースの作成などを行う

@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
Beutl.Operators 3% 0% 140
Beutl.Editor 98% 94% 593
Beutl.Core 39% 35% 2929
Beutl.Engine 27% 24% 10170
Beutl.Threading 100% 94% 118
Beutl.Utilities 73% 67% 358
Beutl.Configuration 39% 19% 288
Beutl.Extensibility 14% 15% 105
Beutl.ProjectSystem 19% 11% 1867
Beutl.Language 0% 0% 713
Summary 30% (12401 / 41119) 29% (3396 / 11908) 17281

Minimum allowed line rate is 0%

@yuto-trd yuto-trd merged commit 634e0d2 into main Dec 28, 2025
4 checks passed
@yuto-trd yuto-trd deleted the feat/editor branch December 28, 2025 17:07
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