Skip to content

Commit 7a91d7a

Browse files
committed
Add calendar note inclusion filtering for PRIORITY and OVERDUE sections.
1 parent e4e5549 commit 7a91d7a

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎jgclark.Dashboard/CHANGELOG.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ For more details see the [plugin's documentation](https://github.com/NotePlan/pl
1313
- New Display setting **Hide sections with nothing left to do?**: when on, enabled sections with no open items are hidden after a refresh (or on first load). Completing the last item in a section still shows the usual "all done" message until the next refresh. (Suggested by @Garba.)
1414
- When there are no sections to display (after load/refresh, settings change, or completing the last item), show an INFO toast: "Your current settings and filters mean there are no items to show."
1515
- fix: Changing Overdue settings now refreshes the Overdue section. dev: Settings save no longer double-fires `dashboardSettingsChanged`; no-op echo skips `setPluginData` so it cannot overwrite an in-flight refresh.
16-
- fix: Overdue / Tag sort order **earliest**, **due date**, and **most recent** now stick. Dev: useSectionSortAndFilter no longer re-sorts those sections by priority after the plugin has ordered them.
16+
- fix: Overdue / Tag sort order `earliest`, `due date`, and `most recent` now stick. Dev: useSectionSortAndFilter no longer re-sorts those sections by priority after the plugin has ordered them.
1717
- fix: The 'Last Week' section wasn't being handled properly when "Hide duplicates" setting was enabled.
18-
- perf: Current Time Block ~1-minute refresh pauses while the Dashboard window is hidden, and restarts when it becomes visible again.
18+
- Fix: Overdue (and Priority) now respect "Calendar note Sections to Include" setting.
19+
- Perf: Current Time Block ~1-minute refresh pauses while the Dashboard window is hidden, and restarts when it becomes visible again.
1920

2021
## [2.4.0.b46] 2026-06-13
2122
- Turning "Show chosen 'Wins' priority marker as a separate section?" off or on now also turns the **Wins** section visibility off or on, so the Wins section is removed or generated immediately.

‎jgclark.Dashboard/src/dataGenerationOverdue.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// @flow
22
//-----------------------------------------------------------------------------
33
// Generate data for OVERDUE Section
4-
// Last updated 2025-12-04 for v2.4.0, @jgclark
4+
// Last updated 2026-07-10 for v2.4.0.b47, @jgclark
55
//-----------------------------------------------------------------------------
66

77
import moment from 'moment/min/moment-with-locales'
88
import pluginJson from '../plugin.json'
9-
import { createSectionItemObject, filterParasByRelevantFolders, filterParasByIgnoreTerms, filterParasByExcludedCalendarSections, filterParasByAllowedTeamspaces, makeDashboardParas, getNotePlanSettings } from './dashboardHelpers'
9+
import { createSectionItemObject, filterParasByRelevantFolders, filterParasByIgnoreTerms, filterParasByIncludedCalendarSections, filterParasByExcludedCalendarSections, filterParasByAllowedTeamspaces, makeDashboardParas, getNotePlanSettings } from './dashboardHelpers'
1010
import { openYesterdayParas, refYesterdayParas } from './demoData'
1111
import type { TDashboardSettings, TParagraphForDashboard, TSection, TSectionItem } from './types'
1212
import { clo, clof, JSP, logDebug, logError, logInfo, logTimer, logWarn, timer } from '@helpers/dev'
@@ -220,9 +220,12 @@ export async function getRelevantOverdueTasks(
220220
// Filter out anything from 'ignoreItemsWithTerms' setting
221221
filteredOverdueParas = filterParasByIgnoreTerms(filteredOverdueParas, dashboardSettings, thisStartTime, 'getRelevantOverdueTasks')
222222

223+
// Filter out anything not matching 'includedCalendarSections' setting, if set
224+
filteredOverdueParas = filterParasByIncludedCalendarSections(filteredOverdueParas, dashboardSettings, thisStartTime, 'getRelevantOverdueTasks')
225+
223226
// Also if wanted, apply to calendar headings in this note
224227
filteredOverdueParas = filterParasByExcludedCalendarSections(filteredOverdueParas, dashboardSettings, thisStartTime, 'getRelevantOverdueTasks')
225-
logTimer('getRelevantOverdueTasks', thisStartTime, `After filtering, ${overdueParas.length} overdue items`)
228+
logTimer('getRelevantOverdueTasks', thisStartTime, `After filtering, ${filteredOverdueParas.length} overdue items`)
226229

227230
// Remove items that appear in this section twice (which can happen if a task is sync'd), based just on their content
228231
// Note: this is a quick operation

‎jgclark.Dashboard/src/dataGenerationPriority.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
createSectionItemObject,
1313
filterParasByExcludedCalendarSections,
1414
filterParasByIgnoreTerms,
15+
filterParasByIncludedCalendarSections,
1516
filterParasByRelevantFolders,
1617
getNotePlanSettings,
1718
isWinItem,
@@ -183,6 +184,9 @@ async function getRelevantPriorityTasks(config: TDashboardSettings): Promise<Arr
183184
// Filter out anything from 'ignoreItemsWithTerms' setting
184185
filteredPriorityParas = filterParasByIgnoreTerms(filteredPriorityParas, config, thisStartTime, 'getRelevantPriorityTasks')
185186

187+
// Filter out anything not matching 'includedCalendarSections' setting, if set
188+
filteredPriorityParas = filterParasByIncludedCalendarSections(filteredPriorityParas, config, thisStartTime, 'getRelevantPriorityTasks')
189+
186190
// Also if wanted, apply to calendar headings in this note
187191
filteredPriorityParas = filterParasByExcludedCalendarSections(filteredPriorityParas, config, thisStartTime, 'getRelevantPriorityTasks')
188192

0 commit comments

Comments
 (0)