-
-
Notifications
You must be signed in to change notification settings - Fork 51
Add expression support across properties #1431
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
…rious view models and editors
…ons in property editor
…tter expression handling
…roperty editor menu
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.
💡 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".
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 implements comprehensive expression support across properties in the Beutl application. It introduces a new expression evaluation system using C# scripting (Roslyn), enables circular reference detection, and provides UI components for editing expressions. The change also systematically replaces Observable.Return with a new Observable.ReturnThenNever pattern throughout the codebase to prevent observables from completing prematurely.
Key Changes
- Adds expression infrastructure with
IExpression<T>,ExpressionContext,PropertyLookup, andExpressionGlobalsfor evaluating mathematical expressions on properties - Implements circular reference detection during expression evaluation to prevent infinite loops
- Introduces new UI components (
ExpressionEditorFlyout, updatedPropertyEditorMenu) with visual indicators for expression status - Replaces
Observable.ReturnwithObservable.ReturnThenNeverpattern across 30+ files to maintain observable streams
Reviewed changes
Copilot reviewed 51 out of 53 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Beutl.Core/Reactive/ObservableExtensions.cs | Defines new ReturnThenNever extension method (has syntax error) |
| src/Beutl.Core/CoreObjectExtensions.cs | Modifies FindById logic with potential infinite recursion issue |
| src/Beutl.Engine/Engine/Expressions/* | New expression evaluation infrastructure with scripting support |
| src/Beutl.Engine/Engine/AnimatableProperty.cs | Adds expression support with evaluation priority over animations |
| src/Beutl.Engine/Engine/IProperty.cs | Extends property interface with expression support |
| src/Beutl.Engine/Engine/SimpleProperty.cs | Stubs out expression support with validation |
| src/Beutl.Engine/Engine/ListProperty.cs | Stubs out expression support (incomplete validation) |
| src/Beutl.Engine/Beutl.Engine.csproj | Adds Microsoft.CodeAnalysis.CSharp.Scripting dependency |
| src/Beutl.Extensibility/IPropertyAdapter.cs | Adds IExpressionPropertyAdapter interfaces |
| src/Beutl.ProjectSystem/Operation/AnimatablePropertyAdapter.cs | Implements expression property adapter |
| src/Beutl.ProjectSystem/NodeTree/NodePropertyAdapter.cs | Stubs expression support for node tree (incomplete) |
| src/Beutl/Views/Editors/ExpressionEditorFlyout.cs | New flyout UI for expression editing with keyboard shortcuts |
| src/Beutl/Views/Editors/PropertyEditorMenu.axaml* | Updated menu with expression edit/remove options and visual indicators |
| src/Beutl/ViewModels/Editors/BaseEditorViewModel.cs | Adds expression methods and disables editing when expression is set |
| src/Beutl/ViewModels/Editors/ValueEditorViewModel.cs | Updates value display to show evaluated expression result |
| src/Beutl.Language/* | Adds localized strings for expression features (English and Japanese) |
| Directory.Packages.props | Adds Microsoft.CodeAnalysis.CSharp.Scripting version |
| Various Views/ViewModels | Systematic replacement of Observable.Return with ReturnThenNever |
Files not reviewed (2)
- src/Beutl.Language/Message.Designer.cs: Language not supported
- src/Beutl.Language/Strings.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…lar reference detection
Co-authored-by: Copilot <[email protected]>
|
|
@copilot Expressionに問題がある場合、エラーを表示してください。 |
Co-authored-by: yuto-trd <[email protected]>
… error Co-authored-by: yuto-trd <[email protected]>
Co-authored-by: yuto-trd <[email protected]>
Co-authored-by: yuto-trd <[email protected]>
Add expression support across properties
…on editing experience
|
The following TODO comments were found:
|
Minimum allowed line rate is |
Description
Implement expression support across various properties. Introduce new functionality for expression editing, circular reference detection, and status indication in the property editor menu. Replace certain observable patterns for improved handling of expressions.
Breaking changes
The changes to observable patterns may affect existing implementations relying on the previous
Observable.Returnbehavior.Fixed issues