From 2f979ad692104b583db66bf115cb6df855f73a59 Mon Sep 17 00:00:00 2001 From: callumalpass Date: Tue, 25 Nov 2025 23:16:00 +1100 Subject: [PATCH] feat: click selection indicator to clear selection --- src/bases/BasesViewBase.ts | 4 ++++ styles/task-card-bem.css | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/bases/BasesViewBase.ts b/src/bases/BasesViewBase.ts index 26a1576f..d96c6eac 100644 --- a/src/bases/BasesViewBase.ts +++ b/src/bases/BasesViewBase.ts @@ -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`; diff --git a/styles/task-card-bem.css b/styles/task-card-bem.css index b969fc4f..ef784fd0 100644 --- a/styles/task-card-bem.css +++ b/styles/task-card-bem.css @@ -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 {