fix: disable Select buttons instead of hiding them when list is empty

This commit is contained in:
MarufHasan-dev
2026-06-06 11:17:41 +06:00
parent e125e0d712
commit fbfa8566d3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -609,7 +609,7 @@ export function renderMemoryList() {
if (filtered.length === 0) {
const selectBtn = document.getElementById('memory-select-btn');
if (selectBtn) selectBtn.classList.add('hidden');
if (selectBtn) selectBtn.disabled = true;
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>';
@@ -631,7 +631,7 @@ export function renderMemoryList() {
}
const selectBtn = document.getElementById('memory-select-btn');
if (selectBtn) selectBtn.classList.remove('hidden');
if (selectBtn) selectBtn.disabled = false;
filtered.forEach(memory => {
const item = document.createElement('div');
+2 -2
View File
@@ -622,14 +622,14 @@ function renderSkillsList() {
if (!sorted.length && !showBuiltin) {
const selectBtn = document.getElementById('skills-select-btn');
if (selectBtn) selectBtn.classList.add('hidden');
if (selectBtn) selectBtn.disabled = true;
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');
if (selectBtn) selectBtn.disabled = false;
// Library-style cards: a compact bar that expands in-place to show the
// SKILL.md, with a footer (Delete left; Edit / Run / Approve right).