Improve Custom Properties pane - #3603
Conversation
There was a problem hiding this comment.
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
There was a problem hiding this comment.
🔵 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 instartup.pyand the smartbutton/pushbutton scripts. - Added worksharing info rows plus a
show_worksharing_infoconfig 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 viascript.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_infoonce per attribute, and each call re-invokesDB.WorksharingUtils.GetWorksharingTooltipInfo(doc, e.Id). That means threeGetWorksharingTooltipInfocalls 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.
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
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
If applicable, link the issues resolved by this pull request: