From e125e0d71204174755e2dff01b9a997ee5ddbd07 Mon Sep 17 00:00:00 2001 From: MarufHasan-dev <170166811+MarufHasan-dev@users.noreply.github.com> Date: Fri, 5 Jun 2026 19:08:23 +0600 Subject: [PATCH] fix: hide Select buttons in memory/skills tabs when list is empty --- static/js/memory.js | 6 ++++++ static/js/skills.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/static/js/memory.js b/static/js/memory.js index 6f3e57012..59a0e6988 100644 --- a/static/js/memory.js +++ b/static/js/memory.js @@ -608,6 +608,9 @@ export function renderMemoryList() { memoryList.innerHTML = ''; if (filtered.length === 0) { + const selectBtn = document.getElementById('memory-select-btn'); + if (selectBtn) selectBtn.classList.add('hidden'); + if (selectMode) exitSelectMode(); const searchTerm = document.getElementById('memory-search')?.value?.trim() || ''; const _smiley = '' + uiModule.emptyStateIcon('smiley') + ''; if (searchTerm || activeCategory !== 'all') { @@ -627,6 +630,9 @@ export function renderMemoryList() { return; } + const selectBtn = document.getElementById('memory-select-btn'); + if (selectBtn) selectBtn.classList.remove('hidden'); + filtered.forEach(memory => { const item = document.createElement('div'); item.className = 'memory-item'; diff --git a/static/js/skills.js b/static/js/skills.js index f9c522afd..9527dd5e8 100644 --- a/static/js/skills.js +++ b/static/js/skills.js @@ -621,10 +621,16 @@ function renderSkillsList() { const showBuiltin = false; if (!sorted.length && !showBuiltin) { + const selectBtn = document.getElementById('skills-select-btn'); + if (selectBtn) selectBtn.classList.add('hidden'); + if (_selectMode) _exitSelectMode(); container.innerHTML = `
${loaded ? 'No skills yet, use agent for it to auto extract them.' : 'Loading…'}
`; return; } + const selectBtn = document.getElementById('skills-select-btn'); + if (selectBtn) selectBtn.classList.remove('hidden'); + // Library-style cards: a compact bar that expands in-place to show the // SKILL.md, with a footer (Delete left; Edit / Run / Approve right). // Reuses the proven .doclib-card / .doclib-card-preview /