-
-
Notifications
You must be signed in to change notification settings - Fork 51
Add Beutl.Editor project with core editor functionality #1440
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
Conversation
- 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.
…istoryTransaction class
…nsaction handling and state management
…vert functionality
…ions using HistoryManager
…nges in addition to Animation
…necessary state changes during operations
…eration interfaces for enhanced change operation handling
…nd update property accessors
This comment was marked as resolved.
This comment was marked as resolved.
…nObserver to handle SplineEasing changes
…EngineObject and retrieve properties
…n and IExpression types
… command constants
… clarity and performance
This comment has been minimized.
This comment has been minimized.
…nections and enhance property handling
…enhanced node item management
… accurate index handling
…ader and related classes
…t modification errors
…ng and enhance property metadata handling
…mplify suppression logic
…JsonSerializationTest
There was a problem hiding this 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.
…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.
|
The following TODO comments were found:
|
Minimum allowed line rate is |
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.