Skip to content

Improve Custom Properties pane - #3603

Open
Wurschdhaud wants to merge 11 commits into
pyrevitlabs:developfrom
Wurschdhaud:improve-props-pane
Open

Improve Custom Properties pane#3603
Wurschdhaud wants to merge 11 commits into
pyrevitlabs:developfrom
Wurschdhaud:improve-props-pane

Conversation

@Wurschdhaud

@Wurschdhaud Wurschdhaud commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

This PR improves the pyRevit Tools dockable panels and related property-matching behavior. It refines the custom properties experience, adds clearer worksharing information, and cleans up the pane organization so the UI is easier to maintain.

What changed

  • Refactored the pane implementation into a dedicated library layout for clearer separation and easier maintenance.
  • Updated startup registration so the panes load consistently and as intended.

  • Improved the Custom Properties panel behavior for invalid or missing parameter values.
  • Added separator lines to better structure the UI.
  • Added worksharing-related entries with options to hide or unhide.
  • Collapsed empty or missing sections so the panel is cleaner and less cluttered.
  • Caching for parameters
grafik

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

If applicable, link the issues resolved by this pull request:

@Wurschdhaud Wurschdhaud added Enhancement Enhancement request [class->Improved #{number}: {title}] Tools Issues related to pyRevit commands [subsystem] labels Sep 1, 2026
@Wurschdhaud Wurschdhaud changed the title Improve Custom Properties pane and worksharing UX Improve Custom Properties pane Sep 1, 2026

@devloai devloai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary:

This PR refactors the Custom Properties and Match History Clipboard panes into a dedicated lib/panes/ layout, adds worksharing tooltip info (Creator/Last Changed By/Owner) with a config toggle, hides empty design-option/workset sections, supports #-prefixed section headers in the parameter list, and improves ElementId parameter handling for invalid values. Localization updated across 7 languages.

Review Summary:

Reviewed against pyRevit's IronPython/CPython coding guidelines, modeless pane safety patterns, and the Custom Properties pane architecture. Found one high-severity state-management bug (workset undo button visibility not reset on selection change), one medium-severity logic issue (ElementId rows with mixed valid/invalid values lose their combo entirely), and a Black formatting violation on several new lines exceeding the 88-char limit. The refactor is otherwise clean — header rows are correctly excluded from copy/paste/apply/filter scans, config keys are consistent, and imports are shadow-free.

Suggestions

  • Cache pane config entries instead of reloading user_config on every SelectionChanged event to reduce file I/O. Apply
  • Add a '(none)' option to ElementId parameter combos so users can assign values to unset ElementId parameters. Apply

Comment thread extensions/pyRevitTools.extension/lib/panes/customprops/pane.py
Comment thread extensions/pyRevitTools.extension/lib/panes/customprops/pane.py Outdated
Comment thread extensions/pyRevitTools.extension/lib/panes/customprops/pane.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It is a large multi-file refactor of Revit-only dockable-pane UI with new caching and worksharing behavior that cannot be built or exercised in this environment, so it needs human verification inside Revit.

Pull request overview

This PR reorganizes the pyRevitTools dockable panes into a dedicated lib/panes/ package (panes.customprops, panes.clipboard) and enhances the Custom Properties pane. It adds a worksharing tooltip-info group (Creator / Last Changed By / Owner) with a config toggle, supports #-prefixed section headers/separators in the parameter list, collapses empty Workset/Design Option/Worksharing sections, improves handling of invalid/missing ElementId parameter values, and introduces envvar-based caching of the pane configuration so changes apply without a Revit restart.

Changes:

  • Moved the clipboard and custom-properties pane implementations and their XAML/locale resources under lib/panes/, updating all imports in startup.py and the smartbutton/pushbutton scripts.
  • Added worksharing info rows plus a show_worksharing_info config option (with new localized strings in all locales) and section-header/separator parsing for additional parameters.
  • Refactored value-summarization into _summarize_values, added section collapsing, invalid-ElementId handling, and cached config via script.get/set_envvar.
File summaries
File Description
startup.py Updated pane imports to the new panes.* package layout.
.../Match Properties.pushbutton/script.py Import RecallWindow from the moved clipboard pane.
.../Match History Clipboard.smartbutton/script.py Reference MatchHistoryClipboard from the moved pane module.
.../Custom Properties.smartbutton/script.py Import the pane from panes.customprops.pane.
.../Custom Properties.smartbutton/config.py Persist show_worksharing_info and mirror config into envvars.
.../Custom Properties.smartbutton/config_ui.xaml Add worksharing checkbox and adjust grid rows/height.
.../config_ui.ResourceDictionary.*.xaml (7 locales) Add worksharing strings; update param hint/examples for # headers.
lib/panes/customprops/pane.py Add worksharing rows, header parsing, section collapsing, config caching, invalid-id handling.
lib/panes/customprops/pane_ui.xaml Add worksharing labels/values, separators, named controls.
lib/panes/customprops/pane_ui.ResourceDictionary.*.xaml (7 locales) Add worksharing label/tooltip strings.
lib/panes/customprops/__init__.py Add package encoding header.
lib/panes/clipboard/* (pane.py, XAML, 8 locales, __init__.py) Relocated clipboard pane implementation and resources.
lib/panes/__init__.py New package init.
Review details

Suppressed comments (1)

extensions/pyRevitTools.extension/lib/panes/customprops/pane.py:561

  • Optional performance: the worksharing rows call _get_ws_info once per attribute, and each call re-invokes DB.WorksharingUtils.GetWorksharingTooltipInfo(doc, e.Id). That means three GetWorksharingTooltipInfo calls per element (3×N for an N-element selection) even though a single call already returns Creator, LastChangedBy and Owner. Consider fetching the tooltip info once per element and reading all three properties from it to avoid the redundant API calls on large selections.
  • Files reviewed: 22/38 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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}] Tools Issues related to pyRevit commands [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Properties - WorkSharingTooltipInfo + separators for easy grouping

2 participants