Fix: #3109 load beta tools setting + Helpurl support improvement#3116
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request aims to fix issue #3109 where beta tools did not appear after enabling the "Load Beta Tools" setting until Revit was restarted. The root cause was that the C# loader (version 6.1) cached the load_beta config value in the UIManagerService constructor, preventing it from being updated when users toggled the setting and reloaded pyRevit.
However, this PR contains changes to two files, not one as stated in the description:
Changes:
- Fixed
_loadBetacaching in UIManagerService by re-reading the config at the start of eachBuildUI()call (resolves #3109) - Added unrelated ExtensionParser.cs changes for layout strict allowlist and help file auto-discovery (not mentioned in PR description)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dev/pyRevitLoader/pyRevitAssemblyBuilder/UIManager/UIManagerService.cs | Removed readonly from _loadBeta field and added config re-read logic in BuildUI() method to pick up setting changes on reload |
| dev/pyRevitLoader/pyRevitExtensionParser/ExtensionParser.cs | Unrelated changes: Removed code that appended unlisted children to layout, added help file auto-discovery, template substitution for help URLs, and relative path resolution for help files |
Removed issue reference from comment about Load Beta setting.
|
@OnePowerUser88 Note: |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26052+1321-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26052+1321-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26052+1323-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26052+1323-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26052+1326-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26052+1326-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26052+1330-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26052+1330-wip |
I fugured as much, but was not entierly confortable with how I should commit the dlls correctly. Should have mentioned it in my PR. Will figure that part for next time (or ask for spesific guidance when I'm faced with it 🤪) |
No pb at all @OnePowerUser88 Basically, you can build dlls using pipenv run pyrevit build labs
pipenv run pyrevit build products with or without the |
|
Thanks, no offence/judgement taken, I'm just new and need to some of this workflow, and happy for any guidance! I also had to resolve a pipenv version mismatch when i tested on my end, that also made me unsure if I had done things correctly. So I was more confident in the .cs file changes than my compiling. Does https://docs.pyrevitlabs.io/dev-guide/#debugging-code cover what to do fully for working with the C# code and compiling for PRs? |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2054-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2054-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2111-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2111-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2115-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2115-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2121-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2121-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2123-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2123-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26057+1645-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26057+1645-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26057+2022-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26057+2022-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26058+1619-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26058+1619-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1027-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1027-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1126-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1126-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1139-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1139-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1233-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1233-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1244-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1244-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1357-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1357-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1403-wip |
1 similar comment
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1403-wip |
Fix Load Beta Tools not applied after settings change
Description
Please provide a brief description of the changes introduced in this pull request. Explain the purpose of these changes and their intended effect on the project.
When "Load Beta Tools" is enabled in the settings menu, beta tools did not appear until Revit was restarted. The C# loader (6.1) read the
load_betasetting only once whenUIManagerServicewas created, so the value was cached for the whole session. After toggling the setting and reloading pyRevit, the same service instance was reused and kept using the old value.This change re-reads the Load Beta setting at the start of each
BuildUI()call, so every reload uses the current config and beta tools show or hide correctly after changing the setting.Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Note: This PR only touches C# (.cs) files; PEP 8 and Black do not apply. Beta config parsing is covered by existing tests (e.g.
TestLoadBetaConfigFromIni).Related Issues
If applicable, link the issues resolved by this pull request:
Additional Notes
_loadBetais no longerreadonlyso it can be updated at the start of eachBuildUI(). The constructor still sets it from config for the first load.dev/pyRevitLoader/pyRevitAssemblyBuilder/UIManager/UIManagerService.cs.