-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Navisworks): CNX-1043 Enable shared ribbon for v2 and v3 Navisworks connectors #504
Open
jsdbroughton
wants to merge
11
commits into
dev
Choose a base branch
from
jonathon/cnx-1043-enable-shared-ribbon-for-v2-and-v3-navisworks-connectors
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(Navisworks): CNX-1043 Enable shared ribbon for v2 and v3 Navisworks connectors #504
jsdbroughton
wants to merge
11
commits into
dev
from
jonathon/cnx-1043-enable-shared-ribbon-for-v2-and-v3-navisworks-connectors
+230
−197
Conversation
This file contains 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
- Added `LaunchSpeckleConnector` class with constants for command and plugin names - Updated `NavisworksRibbon.name` file to include display names for Speckle v2 and v3 - Updated `NavisworksRibbon.xaml` file to include ribbon panels and buttons for Speckle v2 and v3 - Updated `NavisworksRibbon.xaml.cs` file to include commands for launching Speckle v2 and v3 connectors - Added resources for the icons of the new buttons
- Delete AppUtils.cs and Commands.cs (Replaced by v2 and v3 Tools) - Add Utilities.cs for plugin utilities functionality
…plugin and developer ID. Also, initialize the services with the correct version of Navisworks.
- Refactor the CanExecuteCommand method to handle different commandIds. - Add a static constructor to subscribe to the PluginRecordsChanged event. - Implement OnPluginRecordsChanged method to reset the cached state of V2 plugin availability. - Modify ExecuteCommand method to load and activate the appropriate plugin based on the commandId. - Add a new IsValidVersion method to check if the current version of Navisworks is compatible with the plugin.
- Find the v2 plugin and update the availability state - Hide the v2 ribbon tab if it exists
Refactor the code in `RibbonHandler` to improve the handling of commands for Speckle v3 and v2 tools. The changes include: - Extracting a new method `HandleCommand` to handle the loading and activation of plugins - Removing duplicated code by calling `HandleCommand` for both Speckle v3 and v2 tools - Adding null checks when finding plugin records - Returning early if plugin loading should be skipped
- Added two summary comments to describe the purpose of the methods `CanExecuteCommand()` and `ExecuteCommand()`.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #504 +/- ##
=====================================
Coverage 9.15% 9.15%
=====================================
Files 228 228
Lines 4306 4306
Branches 542 542
=====================================
Hits 394 394
Misses 3896 3896
Partials 16 16 ☔ View full report in Codecov by Sentry. |
jsdbroughton
requested review from
didimitrie,
oguzhankoral and
bimgeek
and removed request for
bimgeek
January 18, 2025 18:15
- Added `SpeckleV2Tool.cs` file with constants for Speckle V2 tool - Added `SpeckleV3Tool.cs` file with constants for Speckle V3 tool
- Add conditional compilation for DEBUG mode
- Remove debug code that prints available plugins to the Debug output window - Remove unused using statement for System.Text
…ities.cs - Simplify ActivatePluginPane method in Utilities.cs - Remove unused parameter 'command' from ActivatePluginPane method
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.
Speckle Manager now offers installation of both V2 and V3 versions. While both versions are fully functional, having them appear in separate ribbon tabs creates unnecessary UI clutter. This change unifies the experience by bringing both versions into a clean interface.
Technical Details
What Changed
Added:
PluginUtilities.cs
: Adds Common methods for detecting plugins and managing ribbon state.SpeckleV2Tool.cs
: Constants for identifying V2 plugin components.SpeckleV3Tool.cs
: Constants for V3, including version details.Modified:
NavisworksRibbon.xaml
:NavisworksRibbon.xaml.cs
:NavisworksRibbon.name
:All changes maintain V2's original functionality while adding controls to show it cleanly alongside V3. The new utility classes centralize what was previously scattered plugin management code.
Testing
Verified all installation combinations work correctly:
Clean V2 install
Clean V3 install
Both versions
Related