diff --git a/dev/pyRevitLoader/pyRevitAssemblyBuilder/UIManager/SessionManagerService.cs b/dev/pyRevitLoader/pyRevitAssemblyBuilder/UIManager/SessionManagerService.cs index 0debd08c2..4d411b7f0 100644 --- a/dev/pyRevitLoader/pyRevitAssemblyBuilder/UIManager/SessionManagerService.cs +++ b/dev/pyRevitLoader/pyRevitAssemblyBuilder/UIManager/SessionManagerService.cs @@ -107,6 +107,11 @@ public void LoadSession() stepStopwatch.Restart(); _extensionManager?.ClearParserCaches(); _logger.Debug($"[PERF] ClearParserCaches: {stepStopwatch.ElapsedMilliseconds}ms"); + + // Clear the cached theme so icon selection reflects the active theme at reload time. + // Without this, switching between Dark and Light mode requires a full Revit restart + // because the first-load theme detection result is retained for the process lifetime. + RevitThemeDetector.ClearCache(); // Initialize the ScriptExecutor before executing any scripts stepStopwatch.Restart();