Skip to content

Conversation

@yuto-trd
Copy link
Member

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

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.Return behavior.

Fixed issues

Copilot AI review requested due to automatic review settings December 2, 2025 07:24
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 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, and ExpressionGlobals for evaluating mathematical expressions on properties
  • Implements circular reference detection during expression evaluation to prevent infinite loops
  • Introduces new UI components (ExpressionEditorFlyout, updated PropertyEditorMenu) with visual indicators for expression status
  • Replaces Observable.Return with Observable.ReturnThenNever pattern 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.

@yuto-trd
Copy link
Member Author

yuto-trd commented Dec 3, 2025

  • 使用可能な変数や関数を表示するヘルプを追加
  • 式に問題がある場合、エラーを表示
  • AnimatableProperty.GetValueで例外を握りつぶさないようにする

@b-editor b-editor deleted a comment from claude bot Dec 4, 2025
@yuto-trd
Copy link
Member Author

yuto-trd commented Dec 4, 2025

@copilot Expressionに問題がある場合、エラーを表示してください。

Copy link
Contributor

Copilot AI commented Dec 4, 2025

@yuto-trd I've opened a new pull request, #1432, to work on those changes. Once the pull request is ready, I'll request review from you.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

The following TODO comments were found:

// TODO: CanEditとIsReadOnlyどちらかだけにしたい

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
Beutl.Operators 4% 0% 76
Beutl.Core 34% 31% 3142
Beutl.Engine 27% 24% 9779
Beutl.Threading 100% 94% 118
Beutl.Utilities 73% 67% 358
Beutl.Configuration 38% 19% 282
Beutl.Extensibility 2% 0% 105
Beutl.ProjectSystem 16% 10% 1852
Beutl.Language 0% 0% 656
Summary 27% (10551 / 39072) 25% (2807 / 11033) 16368

Minimum allowed line rate is 0%

@yuto-trd yuto-trd merged commit c8a9240 into main Dec 5, 2025
4 checks passed
@yuto-trd yuto-trd deleted the feat/property-expression branch December 5, 2025 07:34
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.

CoreObject Property Expression Feature

2 participants