Open
Fix icon theme not updating on reload after Dark/Light mode switch#3493
Conversation
Contributor
|
Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔 |
Copilot
AI
changed the title
Fix stale icon theme cache: reload now picks up Dark/Light mode switch
Fix icon theme not updating on reload after Dark/Light mode switch
Jul 20, 2026
Copilot created this pull request from a session on behalf of
jmcouffin
July 20, 2026 18:05
View session
Contributor
|
Fixes #3361 |
jmcouffin
marked this pull request as ready for review
July 20, 2026 20:07
Contributor
|
@romangolev @Wurschdhaud @tay0thman what are you thoughts on this? Shall we leave it as is and document it in the reload button tooltip or adjust the behavior following this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RevitThemeDetectorstores the detected Revit UI theme instaticfields, so after switching themes mid-session the stale value persists for the process lifetime — a full Revit restart was required to see correct icons.Change
Clear the theme cache at the start of each
LoadSession()so the active theme is re-queried on every reload:The cache is repopulated on the first
IsDarkTheme()call within that same load, so there is no performance regression. After this change, a pyRevit reload is sufficient to pick up a Dark ↔ Light mode switch.