fix(ui): replace delete with demote on card peek, scope d-key by view

Card peek action bar now shows demote instead of delete. Double-tap
d demotes in cards view, deletes in stream view.
This commit is contained in:
2026-05-16 12:10:55 -04:00
parent a8ea8f099f
commit 464ff5a8be
+5 -2
View File
@@ -817,7 +817,7 @@
if (hasSteps) actions += `<button class="action-btn" onclick="nibApp.enterMode('run')">run <kbd>r</kbd></button>`; if (hasSteps) actions += `<button class="action-btn" onclick="nibApp.enterMode('run')">run <kbd>r</kbd></button>`;
actions += `<button class="action-btn" onclick="nibApp.enterMode('edit')">edit <kbd>e</kbd></button>`; actions += `<button class="action-btn" onclick="nibApp.enterMode('edit')">edit <kbd>e</kbd></button>`;
actions += `<button class="action-btn" onclick="nibApp.togglePin('${e.id}')">${e.pinned ? 'unpin' : 'pin'} <kbd>p</kbd></button>`; actions += `<button class="action-btn" onclick="nibApp.togglePin('${e.id}')">${e.pinned ? 'unpin' : 'pin'} <kbd>p</kbd></button>`;
actions += `<button class="action-btn danger" onclick="nibApp.deleteEntity('${e.id}')">delete</button>`; actions += `<button class="action-btn danger" onclick="nibApp.demoteEntity('${e.id}')">demote</button>`;
return `<div class="peek-scroll"> return `<div class="peek-scroll">
<div class="peek-card"> <div class="peek-card">
@@ -1459,7 +1459,10 @@
case 'd': { case 'd': {
const now = Date.now(); const now = Date.now();
if (now - lastDTime < 400) { if (now - lastDTime < 400) {
if (sel) nibApp.deleteEntity(sel.id); if (sel) {
if (sel.card_type && state.view === 'cards') nibApp.demoteEntity(sel.id);
else nibApp.deleteEntity(sel.id);
}
lastDTime = 0; lastDTime = 0;
} else { } else {
lastDTime = now; lastDTime = now;