DynamoDS/DYN-8957: Add tooltips describing PM is disabled in no-network mode#17196
Open
eamiri wants to merge 2 commits into
Open
DynamoDS/DYN-8957: Add tooltips describing PM is disabled in no-network mode#17196eamiri wants to merge 2 commits into
eamiri wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8957
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes https://autodesk.atlassian.net/browse/DYN-8957
Package Manager No-Network Mode Tooltips Implementation Plan
Overview
In no-network mode, every Package Manager (PM) entry point in Dynamo's UI must visibly communicate why it is disabled, rather than appearing arbitrarily greyed out. The existing PM-related menu items and the custom-node Publish context-menu entry are already command-disabled but unannotated; the Workspace References extension's Install button is wired to a raw Click handler and is not even disabled. This plan adds two localized tooltip resources, attaches them to the four PM menu items through a re-usable XAML pattern, and adds an explicit IsEnabled=False binding plus tooltip on the Workspace References Install button, mirroring the existing offline Sign-In pattern in ShortcutToolbar.xaml.
Current State Analysis
Key Discoveries
Desired End State
NoNetworkMode|NameInstallButtonResource|Name~NoNetworkModeTooltipResource" passes.What We're NOT Doing
Implementation Approach
Match the existing SignInOfflineButtonContentToolTip pattern: introduce per-feature resource strings, attach ToolTipService.ShowOnDisabled="True" to each affected control, and use a Style.Triggers DataTrigger on PlacementTarget.IsEnabled (or, for the explicitly-controlled Install button, on a code-behind NoNetworkMode property) to swap a default-collapsed tooltip into a visible state when the control is disabled. Land the work in five small, reviewable commits — resources first, then each XAML surface, then the extension code-behind + tests — so each step is independently buildable and reviewable.
TASK 1: Add localized resource strings for the new tooltips [HIGH PRIORITY]
Status: DONE
Milestone: Both Resources.PackageManagerNoNetworkModeToolTip (DynamoCoreWpf) and Resources.InstallButtonNoNetworkModeToolTip (WorkspaceDependencyViewExtension) resolve from C# code and from XAML {x:Static p:Resources.*} bindings.
Validation: msbuild src/Dynamo.All.sln /p:Configuration=Release succeeds and Resources.PackageManagerNoNetworkModeToolTip / Resources.InstallButtonNoNetworkModeToolTip are accessible via IntelliSense in their respective namespaces.
Requirements from spec:
Files to Modify:
Implementation Details:
Keep both strings short and parallel in voice to the existing SignInOfflineButtonContentToolTip (Enable Network Mode to be able to sign in.). Two separate keys (rather than one shared resource) are intentional because the two tooltips live in two different assemblies — duplicating the string keeps each resource bundle self-contained.
TASK 2: Attach no-network tooltips to the Packages menu items [HIGH PRIORITY]
Status: DONE
Milestone: In no-network mode, hovering any of Publish Nodes, Publish Workspace, or Show Package Manager under the Packages menu shows PackageManagerNoNetworkModeToolTip; in normal mode the items show no tooltip.
Validation:
Requirements from spec:
Files to Modify:
Implementation Details:
The collapsed-by-default style is important: WPF will still allocate the ToolTip for an enabled MenuItem, and ToolTipService.ShowOnDisabled only suppresses the show-while-disabled blocker. Hiding the tooltip via Visibility="Collapsed" and revealing it only on IsEnabled=False prevents an empty tooltip from flashing on enabled items.
TASK 3: Attach no-network tooltip to the custom-workspace Publish context-menu item [MEDIUM PRIORITY]
Status: DONE
Milestone: In no-network mode, right-clicking a custom-node workspace and hovering the Publish menu entry shows PackageManagerNoNetworkModeToolTip.
Validation: In no-network mode, open a custom node, right-click anywhere on its workspace canvas -> context menu shows a disabled Publish entry whose tooltip reads the PM no-network message.
Requirements from spec:
Files to Modify:
Implementation Details:
Same XAML pattern as Task 2. Re-using the same resource string is correct: from the user's standpoint these are all "Package Manager publish" actions, regardless of the menu path.
TASK 4: Disable the Workspace References Install button in no-network mode and attach a tooltip [HIGH PRIORITY]
Status: DONE
Milestone: When Dynamo runs with --NoNetworkMode, the Install Specified Version button in the Workspace References extension is visibly disabled and shows InstallButtonNoNetworkModeToolTip on hover. In normal mode it works exactly as before.
Validation:
Requirements from spec:
Files to Modify:
Implementation Details:
The button uses a Click event handler (DownloadPackage) rather than an ICommand, so there is no CanExecute path to hang the disabled state on. Binding to NoNetworkMode on the hosting UserControl via RelativeSource AncestorType=UserControl is the lightest viable touch and avoids introducing a DataContext-swapping change. Marking the setter private is fine — the value never changes after Loaded(...) returns.
TASK 5: Add regression tests for the new strings and the extension wiring [MEDIUM PRIORITY]
Status: DONE
Milestone: NUnit tests cover (a) presence of both new resource strings and (b) propagation of StartupParams.NoNetworkMode into WorkspaceDependencyView.NoNetworkMode.
Validation:
All three new tests pass and no existing WorkspaceDependencyViewExtensionTests tests regress.
Requirements from spec:
Files to Modify:
Implementation Details:
DynamoTestUIBase.CreateStartConfiguration is the established hook for booting Dynamo with a non-default IStartConfiguration from a test fixture (other tests use the same pattern). Asserting the flag on DependencyView.NoNetworkMode is intentionally indirect — directly asserting the Button.IsEnabled state is brittle because WPF triggers do not fire until the visual tree is fully realized, which is not guaranteed in a headless NUnit run.
Testing Strategy
Unit Tests
Integration Tests
Manual Testing Steps
Performance Considerations
The pattern uses WPF data triggers that resolve at tooltip-open time and tooltip-realize time only — no per-frame cost. No additional event subscriptions, timers, or background work are introduced. Resource lookups happen once during XAML parsing.
Migration Notes
No persisted data is affected. The new public NoNetworkMode property on WorkspaceDependencyView is additive (no removal or rename of existing members) and therefore does not require a PublicAPI.Unshipped.txt entry on the public API surface (WorkspaceDependencyView is not part of the public WorkspaceDependencyViewExtension API contract — only the WorkspaceDependencyViewExtension class itself is — but the property is public for XAML binding visibility). If a PublicAPI.Unshipped.txt exists for this assembly during review, add WorkspaceDependencyViewExtension.WorkspaceDependencyView.NoNetworkMode.get -> bool to be safe. The new resource keys are additions to existing .resx bundles and do not change any existing keys, so no breaking change is introduced.