Skip to content

Fix WPF Pane implementation#3146

Merged
jmcouffin merged 4 commits intopyrevitlabs:developfrom
Wurschdhaud:fix-dockable-pane
Mar 2, 2026
Merged

Fix WPF Pane implementation#3146
jmcouffin merged 4 commits intopyrevitlabs:developfrom
Wurschdhaud:fix-dockable-pane

Conversation

@Wurschdhaud
Copy link
Contributor

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, and enable_element were all calling themselves recursively (referencing WPFPanel instead of WPFWindow). These would blow the call stack immediately on first use. All five now correctly delegate to their WPFWindow counterparts.
is_registered_dockable_panel was calling UI.DockablePane.PaneExists corrected to PaneIsRegistered, consistent with how toggle_dockable_panel already called it.
panel_title was silently expected by register_dockable_panel but never validated in __init__ or declared as a class attribute. Added declaration and a guard matching the existing pattern for panel_id and panel_source.

New features

SetupDockablePane now populates the previously TODO'd fields on DockablePaneProviderData: InitialState, EditorInteraction, and ContextualHelp. These are driven by optional class attributes (initial_state, editor_interaction, contextual_help) on WPFPanel, so existing panels require no changes.
A module-level DOCKABLE_PANEL_REGISTRY dict 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 of register_dockable_panel in a shared location manually.


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.

…d dockable pane API coverage and panel registry
@devloai
Copy link
Contributor

devloai bot commented Feb 28, 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.

Copy link
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 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 WPFPanel static element helper methods by delegating to WPFWindow.
  • Expand dockable pane provider setup to populate DockablePaneProviderData fields from optional WPFPanel class attributes.
  • Add a module-level dockable panel registry plus get_dockable_panel() to retrieve the live panel instance after registration.

@jmcouffin jmcouffin merged commit 3aa9d7a into pyrevitlabs:develop Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1126-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1139-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1233-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1244-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1357-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1403-wip

@Wurschdhaud Wurschdhaud deleted the fix-dockable-pane branch March 3, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants