From 9b5711d3124622b1f1b18500d442c76492da877a Mon Sep 17 00:00:00 2001
From: chunhualin1 <chunhualin1@lenovo.com>
Date: 星期一, 17 八月 2026 16:52:33 +0800
Subject: [PATCH] 优化llm插件及bug修复

---
 src/Moli.Desktop/Host/DefaultContentInstaller.cs |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/src/Moli.Desktop/Host/DefaultContentInstaller.cs b/src/Moli.Desktop/Host/DefaultContentInstaller.cs
index b0690d1..1248653 100644
--- a/src/Moli.Desktop/Host/DefaultContentInstaller.cs
+++ b/src/Moli.Desktop/Host/DefaultContentInstaller.cs
@@ -155,6 +155,11 @@
                     changed = true;
                 }
 
+                if (RepairManifestClickThrough(manifest, layout.Instances))
+                {
+                    changed = true;
+                }
+
                 continue;
             }
 
@@ -225,6 +230,33 @@
         return changed;
     }
 
+    /// <summary>
+    /// Heal instances whose persisted clickThrough drifted from the plugin default.
+    /// Interactive plugins (e.g. LLM palette) ship with clickThrough=false; "鎭㈠榛樿"
+    /// used to force true for every widget and left them permanently unclickable.
+    /// </summary>
+    private static bool RepairManifestClickThrough(PluginManifest manifest, IList<WidgetLayout> layouts)
+    {
+        if (manifest.DefaultLayout.ClickThrough)
+        {
+            return false;
+        }
+
+        var changed = false;
+        var pluginId = new PluginId(manifest.Id);
+        for (var index = 0; index < layouts.Count; index++)
+        {
+            var layout = layouts[index];
+            if (layout.PluginId == pluginId && layout.ClickThrough)
+            {
+                layouts[index] = layout with { ClickThrough = false };
+                changed = true;
+            }
+        }
+
+        return changed;
+    }
+
     private static bool IsAudioVisualizer(PluginManifest manifest)
         => string.Equals(manifest.Id, "sample.audio-visualizer", StringComparison.OrdinalIgnoreCase);
 

--
Gitblit v1.9.1