Sitelet https://github.com/PixiEditor/PixiEditor/pull/1673
Skip to content

Refresh property socket preview constantly - #1673

Open
Ghoti-tpt wants to merge 4 commits into
PixiEditor:masterfrom
Ghoti-tpt:constant-socket-preview
Open

Refresh property socket preview constantly#1673
Ghoti-tpt wants to merge 4 commits into
PixiEditor:masterfrom
Ghoti-tpt:constant-socket-preview

Conversation

@Ghoti-tpt

Copy link
Copy Markdown
Contributor

Clearly describe changes, as detailed as possible

The property socket currently previewed will refresh every node graph update instead of on first mouse over.

If possible, show examples of usage

20260728-2059-07.6453452.mp4

SELECT BELOW TO CONTINUE

    • I wrote tests for my changes (if possible)
    • I've included XML docs inside the code in relevant places

@flabbet flabbet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. I'll run clanker to see if there any obvious issues I've missed

Copilot AI left a comment

Copy link
Copy Markdown

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 changes node-property socket previews so the currently hovered property’s computed value is kept up-to-date on every node graph update (instead of only refreshing once on initial hover), improving the accuracy of socket preview tooltips.

Changes:

  • Add “watch” semantics for computed property values (start on pointer enter, stop on pointer exit / visual detach).
  • Refresh watched computed values after each node graph update/render cycle.
  • Improve computed-value string formatting by resolving ShaderExpressionVariable constants.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/PixiEditor/Views/Nodes/Properties/NodeSocket.cs Starts/stops watching a property’s computed value based on pointer hover and visual-tree detach.
src/PixiEditor/ViewModels/SubViewModels/NodeGraphManagerViewModel.cs Adds internal commands to start/stop watching computed values via the active document’s node graph.
src/PixiEditor/ViewModels/Nodes/NodePropertyViewModel.cs Exposes Start/StopWatchingComputedValue methods on the property view model.
src/PixiEditor/ViewModels/Document/NodeGraphViewModel.cs Stores watched properties and updates their computed values during graph updates.
src/PixiEditor/Models/Handlers/INodePropertyHandler.cs Extends the property handler contract with start/stop watching methods.
src/PixiEditor/Models/Handlers/INodeGraphHandler.cs Extends the graph handler contract with UpdateWatchedComputedValues().
src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs Calls UpdateWatchedComputedValues() after renders/updates complete.
src/PixiEditor/Helpers/Converters/ComputedValueToStringConverter.cs Resolves ShaderExpressionVariable to constants before formatting.
Suppressed comments (1)

src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs:318

  • Same as above: this finally block can run after rendering throws ObjectDisposedException and the document/tracker may already be disposed. Guard UpdateWatchedComputedValues to avoid unexpected exceptions during teardown.
                finally
                {
                    NotifyUpdatedPreviews(updatePreviewActions);
                    document.NodeGraphHandler.UpdateWatchedComputedValues();
                }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +408 to +420
public void UpdateWatchedComputedValues()
{
if (watchedProperties.Count == 0)
return;

DrawingBackendApi.Current.RenderingDispatcher.Invoke(() =>
{
foreach (var property in watchedProperties)
{
property.InternalSetComputedValue(GetComputedPropertyValue<object>(property));
}
});
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yep, you should snapshot watchedProperties before enumerating

Comment on lines 208 to 212
finally
{
NotifyUpdatedPreviews(updatePreviewActions);
document.NodeGraphHandler.UpdateWatchedComputedValues();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that makes sense

@Ghoti-tpt
Ghoti-tpt requested a review from flabbet August 21, 2026 23:33
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.

3 participants