Skip to content

Fix MinifyUI state desync on cross-model view switch#3196

Open
tay0thman wants to merge 4 commits intodevelopfrom
tay0thman-patch-6
Open

Fix MinifyUI state desync on cross-model view switch#3196
tay0thman wants to merge 4 commits intodevelopfrom
tay0thman-patch-6

Conversation

@tay0thman
Copy link
Copy Markdown
Contributor

@tay0thman tay0thman commented Mar 26, 2026

Fix MinifyUI state desync on cross-model view switch

Description

Minify Revit UI desynchronizes from actual ribbon visibility when switching between views in different open models. The button stays active (orange), MINIFYUIACTIVE remains True, but contextual tabs like Steel, Precast, and Massing & Site reappear — because Revit's ribbon manager restores them during view activation with no mechanism to re-enforce the hidden state.
This has been reported four times since 2022 (#1570, #1716, #1744, #3106).


Checklist

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

  • [ OK] 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.

Quick_Elevations V2


Related Issues

Closes #3106
Closes #1716
Closes #1570
Related: #1744


Additional Notes

Guard event subscription with a single env var flag (MINIFYUI_SUBSCRIBED) — subscribe once, skip if already subscribed, same pattern as selfinit function detection

Cleared experimental / debugging code

Thank you for contributing to pyRevit! 🎉

@devloai
Copy link
Copy Markdown
Contributor

devloai bot commented Mar 26, 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
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 MinifyUI getting out of sync with actual Revit ribbon/tab visibility when switching between views across different open models by re-applying the configured hidden-tab state on view activation.

Changes:

  • Initializes the MinifyUI smartbutton icon/state on load based on MINIFYUIACTIVE, and (if active) re-applies the hidden tabs immediately.
  • Adds a guarded ViewActivated event subscription to re-run update_ui() (plus a deferred re-hide) after view switches.
  • Cleans up minor module metadata (encoding headers) and a docstring typo.

Reviewed changes

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

File Description
extensions/pyRevitTools.extension/pyRevit.tab/Toggles.panel/toggles1.stack/MinifyUI.smartbutton/script.py On smartbutton init, syncs icon + (if active) ensures event subscription and re-applies MinifyUI state.
extensions/pyRevitTools.extension/pyRevit.tab/Toggles.panel/toggles1.stack/MinifyUI.smartbutton/minifyui.py Implements guarded ViewActivated subscription and deferred UI update to keep hidden tabs enforced across cross-model view switches.

tay0thman and others added 2 commits March 27, 2026 01:10
…ggles1.stack/MinifyUI.smartbutton/minifyui.py


Adding Debug Exception

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ggles1.stack/MinifyUI.smartbutton/minifyui.py


Addubg debug message on exception

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants