fix: hide Select buttons in Memory/Skills tabs when list is empty (#2906)
* fix: hide Select buttons in memory/skills tabs when list is empty * fix: disable Select buttons instead of hiding them when list is empty * fix: dim disabled Select button and remove focus outline * fix: reload skills after single deletion so count and toolbar stay in sync * fix: lower minimized-dock z-index from 10020 to 100 so modals stack above it * Revert "fix: lower minimized-dock z-index from 10020 to 100 so modals stack above it" This reverts commit 5b092ee6cd11d2a2bb79f74a9aa2a81b6b3aaa72.
This commit is contained in:
parent
adbcb3763f
commit
3c924b8dee
3 changed files with 15 additions and 3 deletions
|
|
@ -608,6 +608,9 @@ export function renderMemoryList() {
|
||||||
memoryList.innerHTML = '';
|
memoryList.innerHTML = '';
|
||||||
|
|
||||||
if (filtered.length === 0) {
|
if (filtered.length === 0) {
|
||||||
|
const selectBtn = document.getElementById('memory-select-btn');
|
||||||
|
if (selectBtn) selectBtn.disabled = true;
|
||||||
|
if (selectMode) exitSelectMode();
|
||||||
const searchTerm = document.getElementById('memory-search')?.value?.trim() || '';
|
const searchTerm = document.getElementById('memory-search')?.value?.trim() || '';
|
||||||
const _smiley = '<span style="vertical-align:-3px;margin-left:6px;">' + uiModule.emptyStateIcon('smiley') + '</span>';
|
const _smiley = '<span style="vertical-align:-3px;margin-left:6px;">' + uiModule.emptyStateIcon('smiley') + '</span>';
|
||||||
if (searchTerm || activeCategory !== 'all') {
|
if (searchTerm || activeCategory !== 'all') {
|
||||||
|
|
@ -627,6 +630,9 @@ export function renderMemoryList() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const selectBtn = document.getElementById('memory-select-btn');
|
||||||
|
if (selectBtn) selectBtn.disabled = false;
|
||||||
|
|
||||||
filtered.forEach(memory => {
|
filtered.forEach(memory => {
|
||||||
const item = document.createElement('div');
|
const item = document.createElement('div');
|
||||||
item.className = 'memory-item';
|
item.className = 'memory-item';
|
||||||
|
|
|
||||||
|
|
@ -621,10 +621,16 @@ function renderSkillsList() {
|
||||||
const showBuiltin = false;
|
const showBuiltin = false;
|
||||||
|
|
||||||
if (!sorted.length && !showBuiltin) {
|
if (!sorted.length && !showBuiltin) {
|
||||||
|
const selectBtn = document.getElementById('skills-select-btn');
|
||||||
|
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>`;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const selectBtn = document.getElementById('skills-select-btn');
|
||||||
|
if (selectBtn) selectBtn.disabled = false;
|
||||||
|
|
||||||
// Library-style cards: a compact bar that expands in-place to show the
|
// Library-style cards: a compact bar that expands in-place to show the
|
||||||
// SKILL.md, with a footer (Delete left; Edit / Run / Approve right).
|
// SKILL.md, with a footer (Delete left; Edit / Run / Approve right).
|
||||||
// Reuses the proven .doclib-card / .doclib-card-preview /
|
// Reuses the proven .doclib-card / .doclib-card-preview /
|
||||||
|
|
@ -1067,9 +1073,8 @@ async function _deleteSkill(name, card = null) {
|
||||||
card.classList.add('doclib-card-deleting');
|
card.classList.add('doclib-card-deleting');
|
||||||
card.addEventListener('transitionend', () => card.remove(), { once: true });
|
card.addEventListener('transitionend', () => card.remove(), { once: true });
|
||||||
setTimeout(() => { if (card.parentElement) card.remove(); }, 400);
|
setTimeout(() => { if (card.parentElement) card.remove(); }, 400);
|
||||||
} else {
|
|
||||||
await loadSkills();
|
|
||||||
}
|
}
|
||||||
|
await loadSkills();
|
||||||
uiModule.showToast('Skill deleted');
|
uiModule.showToast('Skill deleted');
|
||||||
} catch (e) { uiModule.showError('Delete failed: ' + e.message); }
|
} catch (e) { uiModule.showError('Delete failed: ' + e.message); }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10238,8 +10238,9 @@ textarea.memory-add-input {
|
||||||
}
|
}
|
||||||
|
|
||||||
.memory-toolbar-btn:disabled {
|
.memory-toolbar-btn:disabled {
|
||||||
opacity: 1;
|
opacity: 0.35;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
.memory-toolbar-btn.spinning {
|
.memory-toolbar-btn.spinning {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue