fix: hide Select buttons in memory/skills tabs when list is empty

This commit is contained in:
MarufHasan-dev
2026-06-05 19:08:23 +06:00
parent 463713c2c6
commit e125e0d712
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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 = '<span style="vertical-align:-3px;margin-left:6px;">' + uiModule.emptyStateIcon('smiley') + '</span>';
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';
+6
View File
@@ -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 = `<div style="text-align:center;opacity:0.4;padding:24px 0;font-size:11px;">${loaded ? 'No skills yet, use agent for it to auto extract them.' : 'Loading…'}</div>`;
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 /