From ece066caf86b2d6ff63994470b602dcc1a69a98b Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 7 Sep 2026 20:22:29 -0400 Subject: [PATCH] fix: pointer cursor on clickables, 'No icon' is a real button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit styles.css used cursor: var(--cursor) in 10 places and the icon modal in 2 more. Obsidian defines --cursor as 'default', so nothing in the plugin ever showed a pointer — the old 'correct cursor on hover' todo never actually worked. Use var(--cursor-link, pointer): themeable, pointer by default. cursor: grab on separators/spacers is left alone. 'No icon' was a bare accent-coloured span in the status row. It commits a value and closes, exactly like Save, so it is now a real button in the modal button container, left-aligned via margin-right: auto to read as a secondary action. Also adds the missing trailing newline to styles.css. --- src/views/waypoint-view.ts | 20 ++++++++++---------- styles.css | 28 ++++++++++++++++++---------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/views/waypoint-view.ts b/src/views/waypoint-view.ts index 10b3159..eb4540c 100644 --- a/src/views/waypoint-view.ts +++ b/src/views/waypoint-view.ts @@ -1228,15 +1228,6 @@ class IconSuggestModal extends Modal { const statusEl = statusRow.createSpan(); statusEl.setText('Loading\u2026'); - const clearEl = statusRow.createSpan(); - clearEl.style.cursor = 'var(--cursor)'; - clearEl.style.color = 'var(--text-accent)'; - clearEl.setText('No icon'); - clearEl.addEventListener('click', () => { - this.onSubmit(''); - this.close(); - }); - // ── Load icons ── this.loadIcons().then(() => { this.loaded = true; @@ -1279,7 +1270,7 @@ class IconSuggestModal extends Modal { tile.style.justifyContent = 'center'; tile.style.aspectRatio = '1'; tile.style.borderRadius = '6px'; - tile.style.cursor = 'var(--cursor)'; + tile.style.cursor = 'var(--cursor-link, pointer)'; tile.style.transition = 'background 80ms'; tile.setAttr('title', name); @@ -1334,6 +1325,15 @@ class IconSuggestModal extends Modal { // ── Buttons ── const btns = modal.createDiv({ cls: 'modal-button-container' }); + + // Clearing the icon commits a value and closes, exactly like Save, so it + // belongs with the buttons rather than as a bare span in the status row. + const clearBtn = btns.createEl('button', { text: 'No icon', cls: 'waypoint-icon-clear' }); + clearBtn.addEventListener('click', () => { + this.onSubmit(''); + this.close(); + }); + const cancel = btns.createEl('button', { text: 'Cancel' }); cancel.addEventListener('click', () => this.close()); const saveBtn = btns.createEl('button', { text: 'Save', cls: 'mod-cta' }); diff --git a/styles.css b/styles.css index dbd33b6..8f3ba0c 100644 --- a/styles.css +++ b/styles.css @@ -36,7 +36,7 @@ margin-left: auto; background: none; border: none; - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); color: var(--text-faint); padding: 2px 4px; border-radius: 4px; @@ -78,7 +78,7 @@ .waypoint-calendar-breadcrumb .waypoint-clickable { color: var(--text-muted); - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); padding: 1px 4px; border-radius: 4px; } @@ -102,7 +102,7 @@ .waypoint-calendar-today-group button { background: none; border: none; - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); padding: 2px 6px; border-radius: 4px; color: var(--text-muted); @@ -142,7 +142,7 @@ font-size: calc(var(--font-ui-small) * 0.75); color: var(--text-faint); font-weight: var(--font-light); - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); padding: 2px 0; border-radius: 4px; } @@ -153,7 +153,7 @@ } .waypoint-calendar .waypoint-day { - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); min-height: var(--wp-cal-cell-size, 32px); padding: 2px 0; border-radius: 6px; @@ -205,7 +205,7 @@ background: var(--background-modifier-hover); padding: 1px 6px; border-radius: 10px; - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); transition: color 80ms, background 80ms; user-select: none; } @@ -236,7 +236,7 @@ top: 50%; transform: translateY(-50%); opacity: 0; - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); color: var(--text-faint); display: flex; align-items: center; @@ -263,7 +263,7 @@ padding: 2px 8px 2px 4px; font-size: var(--wp-font-size, 13px); min-height: var(--wp-row-size, 26px); - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); border-radius: 4px; user-select: none; position: relative; @@ -392,7 +392,7 @@ button.waypoint-calendar-today-btn { .waypoint-settings-tab { background: none; border: none; - cursor: var(--cursor); + cursor: var(--cursor-link, pointer); color: var(--text-muted); padding: 6px 14px; border-radius: 6px 6px 0 0; @@ -411,4 +411,12 @@ button.waypoint-calendar-today-btn { background: var(--background-modifier-active-hover); border-bottom: 2px solid var(--text-accent); margin-bottom: -9px; -} \ No newline at end of file +} + +/* ── Icon picker ── */ + +/* Sits left of Cancel/Save so clearing reads as a separate, secondary action. */ +.waypoint-icon-clear { + margin-right: auto; + cursor: var(--cursor-link, pointer); +}