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) {