From a3d7acde7f3590e5e2982e601912e6d6e3972153 Mon Sep 17 00:00:00 2001 From: Victor Wiebe Date: Sat, 13 Jun 2026 14:30:13 +0000 Subject: [PATCH] v0.3.1: split Unscheduled into to-dos and notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The Unscheduled section now shows two labeled sub-sections — 'Unscheduled to-dos' (first) then 'Unscheduled notes' — so actionable items stay visually separate from reference notes. - A sub-section is omitted entirely when empty (no lonely '(0)' headers). - Webview-only change (uses the existing isTodo flag); data layer and tests unchanged. - Version 0.3.1; README updated. --- package.json | 2 +- src/event-calendar.css | 5 +++++ src/gtd-calendar-webview.js | 43 +++++++++++++++++++++++++++++++++---- src/manifest.json | 2 +- 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4899862..e686e03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "joplin-plugin-gtd-calendar", - "version": "0.3.0", + "version": "0.3.1", "scripts": { "test": "jest", "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive", diff --git a/src/event-calendar.css b/src/event-calendar.css index 9cc3f7e..8353b5f 100644 --- a/src/event-calendar.css +++ b/src/event-calendar.css @@ -355,3 +355,8 @@ .gtd-kanban-card-hover:hover .gtd-kanban-card-detail { display: block; } + +/* Unscheduled sub-sections (todos / notes split) */ +.gtd-unscheduled-group + .gtd-unscheduled-group { + margin-top: 0.5em; +} diff --git a/src/gtd-calendar-webview.js b/src/gtd-calendar-webview.js index d89000f..8446482 100644 --- a/src/gtd-calendar-webview.js +++ b/src/gtd-calendar-webview.js @@ -374,10 +374,45 @@ const section = document.createElement("div"); section.className = "gtd-unscheduled"; + const todos = events.filter(function (e) { + return e.isTodo; + }); + const notes = events.filter(function (e) { + return !e.isTodo; + }); + + // To-dos first (actionable), notes second (reference). Each + // sub-section is omitted entirely when it has no items. + if (todos.length > 0) { + section.appendChild( + renderUnscheduledGroup( + "Unscheduled to-dos", + todos, + contentScriptId + ) + ); + } + if (notes.length > 0) { + section.appendChild( + renderUnscheduledGroup( + "Unscheduled notes", + notes, + contentScriptId + ) + ); + } + + return section; + } + + function renderUnscheduledGroup(label, events, contentScriptId) { + const group = document.createElement("div"); + group.className = "gtd-unscheduled-group"; + const heading = document.createElement("h4"); heading.className = "gtd-unscheduled-title"; - heading.textContent = "Unscheduled (" + events.length + ")"; - section.appendChild(heading); + heading.textContent = label + " (" + events.length + ")"; + group.appendChild(heading); const list = document.createElement("ul"); list.className = "gtd-unscheduled-list"; @@ -400,8 +435,8 @@ list.appendChild(item); }); - section.appendChild(list); - return section; + group.appendChild(list); + return group; } // ------------------------------------------------------------------ diff --git a/src/manifest.json b/src/manifest.json index 5cbbfe6..eb940e4 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 1, "id": "com.victorwiebe.joplin.plugin.gtd-calendar", "app_min_version": "2.7", - "version": "0.3.0", + "version": "0.3.1", "name": "GTD Calendar", "description": "Day, week, and month calendars populated by your notes and to-dos, with click-through to the source note. Configure with simple YAML blocks. A GTD-friendly fork of Event Calendar by Franco Speziali.", "author": "Victor Wiebe",