Fix WPF Pane implementation#3146
Conversation
…d dockable pane API coverage and panel registry
|
Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔 |
There was a problem hiding this comment.
Pull request overview
Fixes pyrevit.forms dockable panel/WPF panel behavior by correcting broken WPFPanel element helper methods and improving dockable pane registration/configuration, including a registry for retrieving live panel instances.
Changes:
- Fix infinite recursion in
WPFPanelstatic element helper methods by delegating toWPFWindow. - Expand dockable pane provider setup to populate
DockablePaneProviderDatafields from optionalWPFPanelclass attributes. - Add a module-level dockable panel registry plus
get_dockable_panel()to retrieve the live panel instance after registration.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…whitespace in _ipy.py
|
📦 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 |
|
📦 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 |
|
📦 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 |
Description
correct infinite recursion in WPFPanel static methods; add dockable pane API coverage and panel registry
Bug fixes
WPFPanel.hide_element,show_element,toggle_element,disable_element, andenable_elementwere all calling themselves recursively (referencingWPFPanelinstead ofWPFWindow). These would blow the call stack immediately on first use. All five now correctly delegate to theirWPFWindowcounterparts.is_registered_dockable_panelwas callingUI.DockablePane.PaneExistscorrected toPaneIsRegistered, consistent with howtoggle_dockable_panelalready called it.panel_titlewas silently expected byregister_dockable_panelbut never validated in__init__or declared as a class attribute. Added declaration and a guard matching the existing pattern forpanel_idandpanel_source.New features
SetupDockablePanenow populates the previously TODO'd fields onDockablePaneProviderData:InitialState,EditorInteraction, andContextualHelp. These are driven by optional class attributes (initial_state,editor_interaction,contextual_help) onWPFPanel, so existing panels require no changes.A module-level
DOCKABLE_PANEL_REGISTRYdict now stores the live panel instance at registration time.get_dockable_panel(panel_type_or_id)exposes it, allowing any script to retrieve the live instance without re-registering — which was previously impossible without storing the return value ofregister_dockable_panelin a shared location manually.Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}