From 3890cca114967f1061f59f29af36f054f9708b69 Mon Sep 17 00:00:00 2001 From: MT-Mint <798521692@qq.com> Date: Mon, 13 Apr 2026 17:54:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(chatbot):=20=E7=A6=81=E7=94=A8=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E6=8C=87=E4=BB=A4=E5=8C=BA=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/chatbot/ui/chatbot-ui.js | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/js/chatbot/ui/chatbot-ui.js b/js/chatbot/ui/chatbot-ui.js index 4a54ac5..f33ab4c 100644 --- a/js/chatbot/ui/chatbot-ui.js +++ b/js/chatbot/ui/chatbot-ui.js @@ -353,8 +353,6 @@ function updateChatbotUI() { } const chatBody = document.getElementById('chatbot-body'); - const chatbotPresetHeader = document.getElementById('chatbot-preset-header'); - const chatbotPresetBody = document.getElementById('chatbot-preset-body'); let modelSelectorDiv = document.getElementById('chatbot-model-selector'); const existingPresetContainer = document.getElementById('chatbot-preset-container'); @@ -383,42 +381,14 @@ function updateChatbotUI() { console.error("Error getting chatbot config for UI:", e); } - const presetContainer = window.ChatbotPresetQuestionsUI.render( - chatbotWindow, - isCustomModel, - currentDocId, - updateChatbotUI, - window.ChatbotPreset?.handlePresetQuestion || window.handlePresetQuestion - ); - - chatbotWindow.appendChild(presetContainer); - - let userMessageCount = 0; - if (window.ChatbotCore && window.ChatbotCore.chatHistory) { - userMessageCount = window.ChatbotCore.chatHistory.filter(m => m.role === 'user').length; - } - - if (userMessageCount >= 3 && - !window.presetAutoCollapseTriggeredForDoc[currentDocId] && - !window.isPresetQuestionsCollapsed && - !window.isModelSelectorOpen) { - window.isPresetQuestionsCollapsed = true; - window.presetAutoCollapseTriggeredForDoc[currentDocId] = true; - const presetToggleBtn = presetContainer.querySelector('#chatbot-preset-toggle-btn'); - if (presetToggleBtn) { - presetToggleBtn.innerHTML = ''; - presetToggleBtn.title = "展开快捷指令"; - } - } + // 按需禁用:不渲染快捷指令(chatbot-preset-container) + // 仅确保历史遗留 DOM 被移除,避免占用空间或影响布局 // 获取 mainContentArea 元素 const mainContentArea = document.getElementById('chatbot-main-content-area'); if (mainContentArea) { let current_padding_top_for_main_content_area = 12; - if (presetContainer && presetContainer.style.display !== 'none' && presetContainer.offsetHeight) { - current_padding_top_for_main_content_area = presetContainer.offsetHeight; - } mainContentArea.style.paddingTop = current_padding_top_for_main_content_area + 'px'; // 仅在“固定模式”下根据内容自适应高度;浮动/全屏不改动用户设置的尺寸 @@ -451,7 +421,6 @@ function updateChatbotUI() { } else { const existingModelSelectorDiv = document.getElementById('chatbot-model-selector'); if (existingModelSelectorDiv) existingModelSelectorDiv.remove(); - if (presetContainer) presetContainer.style.display = ''; if (chatBody) chatBody.style.display = ''; } if (chatBody) {