Skip to content

PR: Fix extension install path not changeable (#3193)#3198

Merged
jmcouffin merged 8 commits intodevelopfrom
tay0thman-fix_custom_extensions-1
Mar 31, 2026
Merged

PR: Fix extension install path not changeable (#3193)#3198
jmcouffin merged 8 commits intodevelopfrom
tay0thman-fix_custom_extensions-1

Conversation

@tay0thman
Copy link
Copy Markdown
Contributor

@tay0thman tay0thman commented Mar 27, 2026

Added functions to ensure custom extension paths are registered and to get the default extension directory. Updated the custom section for extension installation to handle new paths and states.

PR: Fix extension install path not changeable (#3193)

  • Fixes [Bug]: Install Extensions Path not changeable #3193
    The Extension Manager's "Pick installation path" button was grayed out when selecting a catalog extension to install, and the auto-selected default path was non-deterministic. Additionally, picking a custom folder that wasn't already in the user's Custom Extension Directories would silently fail after reload because the folder was never registered as a search path.ct.

Checklist

Before submitting your pull request, ensure the following requirements are met:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
    pipenv run black {source_file_or_directory}
  • Changes are tested and verified to work as expected.

Related Issues

Root Cause

The Feb 15 UI refactoring (commit ec2eb76) replaced the old context-menu dropdown install flow with a text field + "Pick" button, but introduced three bugs: _update_add_custom_section_for_selection() unconditionally set path_custom_ext_b.IsEnabled = False, locking out path selection for uninstalled extensions
get_thirdparty_ext_root_dirs() collected paths in a Python set(), making [0] non-deterministic — users got their server path instead of the local default
install_custom_extension() never registered the chosen install directory in pyRevit's config, so extensions installed to new folders weren't discovered after reload

Added functions to ensure custom extension paths are registered and to get the default extension directory. Updated the custom section for extension installation to handle new paths and states.
@devloai
Copy link
Copy Markdown
Contributor

devloai bot commented Mar 27, 2026

Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

Refactor get_thirdparty_ext_root_dirs to use a list for deterministic ordering and to ensure the default path is first when included.
@tay0thman tay0thman requested a review from jmcouffin March 27, 2026 22:55
@jmcouffin jmcouffin requested a review from Copilot March 29, 2026 13:13
@jmcouffin jmcouffin self-assigned this Mar 29, 2026
@jmcouffin jmcouffin added the Enhancement Enhancement request [class->Improved #{number}: {title}] label Mar 29, 2026
Copy link
Copy Markdown
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

Fixes Extension Manager install-path selection/regression from the Feb UI refactor by making the default third‑party extensions path deterministic, re-enabling install path picking for catalog installs, and ensuring newly chosen install directories are persisted so extensions are discoverable after reload.

Changes:

  • Make get_thirdparty_ext_root_dirs() deterministic (default dir first; preserve config order; de-dupe).
  • Enable “Pick installation path” for not-yet-installed catalog extensions and use a helper for default path selection.
  • Register the chosen install directory in user config after installs so reload discovers the extension.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pyrevitlib/pyrevit/userconfig.py Deterministic ordering + order-preserving de-dupe for third-party extension root dirs.
extensions/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/Extensions.smartbutton/script.py UI logic fix for enabling path selection + persist chosen install directory after install.

tay0thman and others added 3 commits March 30, 2026 09:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ensions.smartbutton/script.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ensions.smartbutton/script.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jmcouffin
Copy link
Copy Markdown
Contributor

All of the above is for the legacy loader, right?
And it should be implemented in the new loader in C#? @tay0thman

@tay0thman
Copy link
Copy Markdown
Contributor Author

tay0thman commented Mar 30, 2026

All of the above is for the legacy loader, right? And it should be implemented in the new loader in C#? @tay0thman

@jmcouffin this is for both loaders. I think you refactored the tool back in February, and this PR fixes on the script & config levels not runtime level.

@jmcouffin jmcouffin merged commit 49dd7d3 into develop Mar 31, 2026
@jmcouffin jmcouffin added the Extensions Issues related to pyRevit extensions [subsystem] label Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1540-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1556-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New public release are available for 6.2.0.26090+1754

@jmcouffin jmcouffin deleted the tay0thman-fix_custom_extensions-1 branch April 1, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Enhancement request [class->Improved #{number}: {title}] Extensions Issues related to pyRevit extensions [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Install Extensions Path not changeable

3 participants