From 97df0fb5ed49e37d1c8e0e62057bb72ba5c9eb6a Mon Sep 17 00:00:00 2001
From: chunhualin1 <chunhualin1@lenovo.com>
Date: 星期三, 12 八月 2026 17:24:49 +0800
Subject: [PATCH] 优化透明样式

---
 samples/plugins/sample.llm-command-palette/index.html |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/samples/plugins/sample.llm-command-palette/index.html b/samples/plugins/sample.llm-command-palette/index.html
index 569f80b..6057f32 100644
--- a/samples/plugins/sample.llm-command-palette/index.html
+++ b/samples/plugins/sample.llm-command-palette/index.html
@@ -529,6 +529,8 @@
       config: {}
     };
 
+    let _resizeTimer;
+
     const els = {
       statusMark: document.getElementById("statusMark"),
       projectSelect: document.getElementById("projectSelect"),
@@ -653,7 +655,15 @@
       const screenHeight = window.screen && window.screen.availHeight ? window.screen.availHeight : 900;
       const heightLimit = Math.floor(screenHeight * 0.5) + 88;
       const height = explicitHeight || Math.min(Math.ceil(document.body.scrollHeight + 2), heightLimit);
-      bridge.requestResize({ width: Math.ceil(document.body.scrollWidth), height }).catch(() => {});
+      if (explicitHeight != null) {
+        clearTimeout(_resizeTimer);
+        bridge.requestResize({ width: Math.ceil(document.body.scrollWidth), height }).catch(() => {});
+        return;
+      }
+      clearTimeout(_resizeTimer);
+      _resizeTimer = setTimeout(function() {
+        bridge.requestResize({ width: Math.ceil(document.body.scrollWidth), height }).catch(() => {});
+      }, 50);
     }
 
     function updatePanelLimits() {

--
Gitblit v1.9.1