Skip to content

Conversation

@kalunkuo
Copy link
Contributor

Purpose

When users uncheck the "Agreement for Data Collection" checkbox for ML-based node autocomplete, the system now automatically reverts to ObjectType matching mode.

Problem:

Users could uncheck the ML agreement but remain in ML recommendation mode, they had to manually switch back to ObjectType mode

Solution:

Added automatic fallback logic in IsMLAutocompleteTOUApproved setter

Declarations

Check these if you believe they are true

Release Notes

ML autocomplete now automatically reverts to ObjectType matching when users uncheck the data collection agreement.

Reviewers

@DynamoDS/eidos @DynamoDS/synapse

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

@kalunkuo kalunkuo requested review from a team and Copilot October 21, 2025 17:44
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-9679

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 automatic fallback behavior for ML-based node autocomplete when users revoke their data collection agreement. When the ML Terms of Use checkbox is unchecked, the system now automatically switches from ML recommendation mode to ObjectType matching mode, preventing users from remaining in an inconsistent state.

Key Changes:

  • Added automatic mode switching logic in the IsMLAutocompleteTOUApproved property setter
  • System now reverts to ObjectType matching when ML agreement is unchecked

Comment on lines 820 to 829
isMLAutocompleteTOUApproved = value;

// If user unchecks the agreement, automatically revert to ObjectType matching
if (!value && defaultNodeAutocompleteSuggestion == NodeAutocompleteSuggestion.MLRecommendation)
{
defaultNodeAutocompleteSuggestion = NodeAutocompleteSuggestion.ObjectType;
AutocompletePreferencesChanged?.Invoke();
}

RaisePropertyChanged(nameof(IsMLAutocompleteTOUApproved));
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

The property change notification for IsMLAutocompleteTOUApproved should be raised before potentially triggering AutocompletePreferencesChanged. The current order may cause event handlers to observe inconsistent state where the autocomplete mode has changed but IsMLAutocompleteTOUApproved hasn't been signaled yet. Move RaisePropertyChanged(nameof(IsMLAutocompleteTOUApproved)) to line 821, immediately after setting the backing field.

Copilot uses AI. Check for mistakes.
if (!value && defaultNodeAutocompleteSuggestion == NodeAutocompleteSuggestion.MLRecommendation)
{
defaultNodeAutocompleteSuggestion = NodeAutocompleteSuggestion.ObjectType;
AutocompletePreferencesChanged?.Invoke();
Copy link
Contributor

Choose a reason for hiding this comment

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

@kalunkuo Would you remind me what this does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It automatically switches the "the default ranking method" from "Recommended Nodes/ MLRecommendation" to "Node Type Match/ ObjectType" when the user unchecks the agreement, because to use the Recommended Nodes ranking method with Node Autocomplete, user must agree to data collection in Dynamo.

Screenshot 2025-10-21 at 8 47 24 PM Screenshot 2025-10-21 at 8 47 39 PM

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

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

One comment then LGTM

@zeusongit zeusongit added this to the 4.0 milestone Oct 22, 2025
@QilongTang QilongTang merged commit f88de06 into DynamoDS:master Oct 22, 2025
26 of 27 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 22, 2025
… unchecked (#16616)

Co-authored-by: Aaron (Qilong) <173288704@qq.com>
(cherry picked from commit f88de06)
@github-actions
Copy link

Successfully created backport PR for RC4.0.0_master:

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