Skip to content

Conversation

@chubakueno
Copy link
Contributor

@chubakueno chubakueno commented May 17, 2025

Purpose

Reconfigure preference settings for node autocomplete

2025-05-16.21-07-29.mp4

Declarations

Check these if you believe they are true

  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB
  • This PR introduces new feature code involve network connecting and is tested with no-network mode.

Release Notes

Reconfigure preference settings for node autocomplete

Reviewers

@BogdanZavu
@johnpierson

FYIs

@QilongTang

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8850

/// <summary>
/// Looks up a localized string similar to Node Type Match.
/// </summary>
public static string NodeTypeMatch {
Copy link
Contributor

@BogdanZavu BogdanZavu May 19, 2025

Choose a reason for hiding this comment

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

Is our control auto-resizable horizontally ? This text will probably be bigger in certain languages.
I see it, it's auto.

Copy link
Contributor Author

@chubakueno chubakueno May 19, 2025

Choose a reason for hiding this comment

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

The whole flyout has a fixed size but the NodeTypeMatch textview is sized as Auto, so it will compress the other views sized as * (the buttons) to make space for itself while possible.

/// <summary>
/// Event that is fired when a node is removed from the workspace.
/// </summary>
public event Action PreferencesChanged;
Copy link
Contributor

@BogdanZavu BogdanZavu May 19, 2025

Choose a reason for hiding this comment

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

I'm not sure about this one.
We are calling this from the onClose but there is no guarantee that the preferences have actually changed.
Plus the underlying object we care about is the PreferenceSettings instance and one can subscribe to that.
This can be modified from the API as well not only from the dialog.
However the Preferences dlg is modal so we should only do the update onClose when the dialog is present.

But I don't think we need to do the real time update so I'm ok with removing this.
So I would say to only consider the options on first occasion like the flyout show.

Copy link
Contributor Author

@chubakueno chubakueno May 19, 2025

Choose a reason for hiding this comment

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

Its weirder if its not realtime as the visual state gets desynchronized with the internal state. Its fine if we reload the view each time the user opens and closes the preferences, which shouldn't happen too often while the flyout is still visible.

We can have the best of both if we introduce an object to represent the latest copy of the preferences settings we're interested in and comparing with it, but it could introduce maintenance bugs when modifying the code and not updating that object.

So, I'd prefer it to load every time instead of get bugged when not refreshing. Plus, this may be useful for other parts of the application that would benefit from dynamically updating.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename it then OnPreferencesClosed or something and maybe make it internal.

Copy link
Contributor Author

@chubakueno chubakueno May 22, 2025

Choose a reason for hiding this comment

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

Can't make it internal as we're using it from another assembly (the autocomplete view extension) but we can rename it

Copy link
Contributor

Choose a reason for hiding this comment

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

We can access internals from our assembly since we have this [assembly: InternalsVisibleTo("NodeAutoCompleteViewExtension")].

But thinking more about it maybe we can avoid it all together and be more inline with the way other settings are handled.
So how about we define out DNA event in preferences for all the DNA settings and subscribe/react to it from the extension as usual.
The preferences is modal so we'll just need to postpone the action on Iddling - we do this in other contexts as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice! Now we also have the api scenario covered and better handling of multiple req that could come from anywhere.

@BogdanZavu
Copy link
Contributor

So in Node Type Match mode we are showing the total number of matches which is big.
I'm not sure about hiding the total number as suggested in the JIRA issue ; perhaps just take into account the maximum number of results for node type match is more suited ?! Tbd

@BogdanZavu
Copy link
Contributor

Oh and I guess we need to deprecate some of previous options like HideNodesBelowSpecificConfidenceLevel ?
If these are new after 3.5 we could actually remove them.

@chubakueno
Copy link
Contributor Author

chubakueno commented May 22, 2025

Oh and I guess we need to deprecate some of previous options like HideNodesBelowSpecificConfidenceLevel ? If these are new after 3.5 we could actually remove them.

Those are not new, but the mockup no longer has that option. If we're sure it will stay this way in the future we can delete nonpublic members and obsolote public ones, but would need to confirm.

@BogdanZavu
Copy link
Contributor

Those are not new, but the mockup no longer has that option. If we're sure it will stay this way in the future we can delete nonpublic members and obsolote public ones, but would need to confirm.

Ok, we'll handle it later before 3.6.

Dynamo.ViewModels.PreferencesViewModel.PackagePathsViewModel.set -> void
Dynamo.ViewModels.PreferencesViewModel.PersistExtensionsIsChecked.get -> bool
Dynamo.ViewModels.PreferencesViewModel.PersistExtensionsIsChecked.set -> void
Dynamo.ViewModels.PreferencesViewModel.PreferencesChanged -> System.Action
Copy link
Contributor

Choose a reason for hiding this comment

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

to be removed

@BogdanZavu
Copy link
Contributor

Let's remove that leftover api and we're good to go.
LGTM! 🎉

@chubakueno
Copy link
Contributor Author

chubakueno commented May 22, 2025

Tests failed on unrelated PressNotificationButtonAndShowPopup which i can't reproduce locally. Merging as I'm assuming it's a transient failure.

@chubakueno chubakueno merged commit 5ad1028 into DynamoDS:master May 22, 2025
25 of 27 checks passed
@johnpierson johnpierson added the ai/ml 🧠 synapse team related PRs label Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/ml 🧠 synapse team related PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants