feat: click selection indicator to clear selection

This commit is contained in:
callumalpass 2025-11-25 23:16:00 +11:00
parent a8744f2c82
commit 2f979ad692
2 changed files with 9 additions and 4 deletions

View file

@ -644,6 +644,10 @@ export abstract class BasesViewBase extends Component {
if (!this.selectionIndicatorEl) {
this.selectionIndicatorEl = document.createElement("div");
this.selectionIndicatorEl.className = "tn-selection-indicator";
this.selectionIndicatorEl.addEventListener("click", () => {
this.plugin.taskSelectionService?.clearSelection();
this.plugin.taskSelectionService?.exitSelectionMode();
});
this.rootElement.appendChild(this.selectionIndicatorEl);
}
this.selectionIndicatorEl.textContent = `${count} selected`;

View file

@ -1290,10 +1290,6 @@
background-color: color-mix(in srgb, var(--interactive-accent) 20%, transparent);
}
/* Selection mode cursor change on cards */
.tasknotes-plugin.tn-selection-mode .task-card {
cursor: pointer;
}
/* Selection indicator floating badge */
.tasknotes-plugin .tn-selection-indicator {
@ -1310,6 +1306,11 @@
z-index: 100;
display: none;
animation: tn-selection-indicator-appear 0.2s ease-out;
transition: background-color var(--tn-transition-fast);
}
.tasknotes-plugin .tn-selection-indicator:hover {
background-color: var(--interactive-accent-hover);
}
@keyframes tn-selection-indicator-appear {