diff --git a/docs/features/task-management.md b/docs/features/task-management.md index f217c8ac4..8c0b54dbf 100644 --- a/docs/features/task-management.md +++ b/docs/features/task-management.md @@ -243,6 +243,8 @@ You can record a task's completion — and choose the date it is recorded agains An action is disabled when the date it needs is not set — for example *Completed on schedule* on a task with no scheduled date — rather than silently falling back to another date. Recurring tasks also get a **Skip instance** action alongside these. +On a recurring task, the status control is labelled **Series status**: in the context menu, the status picker, the edit modal and the notice that follows. It sets the status of the whole series and records no occurrence, so choosing a completed status there does not complete today's occurrence. To complete or skip one occurrence, use **Mark complete or skip**. A [materialized occurrence note](recurring-tasks.md#materialized-occurrence-notes) has no rule of its own, so its control stays **Status** and completes that occurrence. + By default the actions are grouped under a single **Mark complete or skip** entry (**Mark complete** for non-recurring tasks). To show them directly in the menu instead — set off by dividers — turn off **Settings → TaskNotes → Appearance & interaction → Task cards → Group complete and skip actions in a submenu**. ![Completion actions grouped under a submenu (default)](../assets/feature-completion-date-actions.png) diff --git a/docs/releases/unreleased.md b/docs/releases/unreleased.md index 9c45ebfb1..003133428 100644 --- a/docs/releases/unreleased.md +++ b/docs/releases/unreleased.md @@ -39,6 +39,11 @@ When a change has user-facing documentation, include a canonical tasknotes.dev l - (#2615) Added **Hide top-level subtasks** to the Calendar view's list (Agenda) layout and the month view's selected day panel, as in Task List and Kanban. When on, a subtask whose parent task is listed on the same day shows only under the parent's expanded subtasks instead of also as its own row. A subtask whose parent isn't listed that day keeps its own row. See [Agenda View](https://tasknotes.dev/views/agenda-view/#customization). - Thanks to @tistieom for the request +## Changed + +- (#2632) Recurring tasks now label their status control **Series status** in the task context menu, the status picker (including the **S** shortcut and the action palette), the edit modal's status button and the notice after a change. It sets the status of the whole series and records no occurrence; to complete one occurrence, use **Mark complete or skip**. Materialized occurrence notes keep **Status**. See [Completing Tasks](https://tasknotes.dev/features/task-management/#completing-tasks). + - Thanks to @martin-forge for the suggestion + ## Fixed - (#2606) Fixed Ctrl/Cmd-click on a task in Task List, Kanban, Calendar and Agenda views selecting the task instead of opening its note in a new tab. Ctrl/Cmd-click and middle-click now open the note in a new tab on every task card, calendar event and task link in a note, as links do in Obsidian; Ctrl/Cmd+Alt-click opens it to the side. To select several tasks, Shift-click a task first; while a selection is active, Ctrl/Cmd-click adds or removes tasks as before. The task menu again has **Open note in new tab** next to **Open note**, instead of only under **Note actions**. See [Task List view](https://tasknotes.dev/views/task-list/#task-actions). diff --git a/e2e/issues/issue-2632-series-status-label.spec.ts b/e2e/issues/issue-2632-series-status-label.spec.ts new file mode 100644 index 000000000..d46526a51 --- /dev/null +++ b/e2e/issues/issue-2632-series-status-label.spec.ts @@ -0,0 +1,99 @@ +import { test, expect, type Page } from '@playwright/test'; +import { launchObsidian, closeObsidian, type ObsidianApp } from '../obsidian'; + +// #2632: on a recurring task, Status sets the series' own status (#2440), but the +// menu, picker and notice said only "Status". They now say "Series status"; +// an occurrence note keeps "Status". +let instance: ObsidianApp; +const stamp = Date.now(); +const prefix = `Issue 2632 ${stamp}`; +const folder = `e2e-2632-${stamp}`; +const parentPath = `${folder}/${prefix} series.md`; +const basePath = `${folder}/Tasks.base`; +const created = [parentPath, basePath]; + +async function openStatusPicker(page: Page, card: ReturnType, label: string) { + await card.click({ button: 'right' }); + const item = page.locator('.menu .menu-item').filter({ + has: page.locator('.menu-item-title', { hasText: new RegExp(`^${label}$`) }), + }); + await expect(item).toBeVisible(); + await item.click(); + const input = page.locator('.tn-picker__input'); + await expect(input).toHaveAttribute('placeholder', label); + return input; +} + +test.beforeAll(async () => { + instance = await launchObsidian(); + await instance.page.evaluate(async ({ folder, prefix, parentPath, basePath }) => { + const app = (window as any).app; + app.plugins.plugins.tasknotes.settings.googleCalendarExport.enabled = false; + await app.vault.createFolder(folder); + await app.vault.create(parentPath, `--- +title: ${prefix} series +status: open +priority: normal +tags: [task] +scheduled: 2027-01-10 +recurrence: DTSTART:20270103;FREQ=WEEKLY;BYDAY=SU +--- +`); + await app.vault.create(basePath, `filters: + and: + - file.name.startsWith("${prefix}") +views: + - type: tasknotesTaskList + name: Tasks +`); + }, { folder, prefix, parentPath, basePath }); +}); + +test.afterAll(async () => { + if (!instance) return; + try { + await instance.page.evaluate(async paths => { + const app = (window as any).app; + for (const path of paths) { + const file = app.vault.getAbstractFileByPath(path); + if (file) await app.vault.delete(file, true); + } + }, [...created, folder]); + } finally { await closeObsidian(instance); } +}); + +test('a recurring task labels its status control "Series status"; an occurrence note keeps "Status"', async () => { + const page = instance.page; + await expect.poll(() => page.evaluate(async path => + Boolean(await (window as any).app.plugins.plugins.tasknotes.cacheManager.getTaskInfo(path)), parentPath)).toBe(true); + await page.evaluate(async basePath => { + const app = (window as any).app; + await app.workspace.getLeaf(false).openFile(app.vault.getAbstractFileByPath(basePath)); + }, basePath); + + const card = (path: string) => page.locator(`.task-card[data-task-path="${path}"]`).first(); + const series = card(parentPath); + await expect(series).toBeVisible(); + const input = await openStatusPicker(page, series, 'Series status'); + await input.fill('Done'); + await input.press('Enter'); + await expect(page.locator('.tn-toast').filter({ hasText: 'Series status → Done' })).toBeVisible(); + // Behaviour is unchanged: the series' own status, with no occurrence recorded. + await expect.poll(() => page.evaluate(path => { + const app = (window as any).app; + return app.metadataCache.getFileCache(app.vault.getAbstractFileByPath(path))?.frontmatter?.status; + }, parentPath)).toBe('done'); + await page.keyboard.press('Escape'); + + const occurrencePath = await page.evaluate(async path => { + const plugin = (window as any).app.plugins.plugins.tasknotes; + const parent = await plugin.cacheManager.getTaskInfo(path); + return (await plugin.taskService.materializeOccurrence(parent, '2027-01-17')).path as string; + }, parentPath); + created.push(occurrencePath); + // Its filename starts with the parent's title, so the view's filter includes it. + const occurrence = card(occurrencePath); + await expect(occurrence).toBeVisible(); + await openStatusPicker(page, occurrence, 'Status'); + await page.keyboard.press('Escape'); +}); diff --git a/src/components/TaskContextMenu.ts b/src/components/TaskContextMenu.ts index c632030c4..caa538256 100644 --- a/src/components/TaskContextMenu.ts +++ b/src/components/TaskContextMenu.ts @@ -122,7 +122,7 @@ export class TaskContextMenu { const propertyPicker = (property: TaskPickerProperty) => (anchor: { x: number; y: number }) => void openTaskPropertyPicker(plugin, property, [task], anchor, this.options.onUpdate); - pickerItem("status", this.t(msg({ message: "Status", context: "contextMenus.task.status" })), "circle", propertyPicker("status")); + pickerItem("status", this.statusTitle(task), "circle", propertyPicker("status")); pickerItem("priority", this.t(msg({ message: "Priority", context: "contextMenus.task.priority" })), null, propertyPicker("priority")); pickerItem("tags", this.t(msg({ message: "Tags", context: "contextMenus.task.tags" })), "tags", propertyPicker("tags")); pickerItem("due", this.t(msg({ message: "Due date", context: "contextMenus.task.dueDate" })), "calendar", propertyPicker("due")); @@ -524,12 +524,19 @@ export class TaskContextMenu { }); } + /** On a recurring task, Status sets the series' own status (#2632). */ + private statusTitle(task: TaskInfo): string { + return task.recurrence + ? this.t(msg({ message: "Series status", context: "contextMenus.task.seriesStatus" })) + : this.t(msg({ message: "Status", context: "contextMenus.task.status" })); + } + private updateMainMenuIconColors(task: TaskInfo, plugin: TaskNotesPlugin): void { const menuEl = this.targetDoc.querySelector(".menu"); if (!menuEl) return; const menuItems = menuEl.querySelectorAll(".menu-item"); - const statusTitle = this.t(msg({ message: "Status", context: "contextMenus.task.status" })); + const statusTitle = this.statusTitle(task); const priorityTitle = this.t( msg({ message: "Priority", context: "contextMenus.task.priority" }) ); diff --git a/src/i18n/locales/de/messages.po b/src/i18n/locales/de/messages.po index b06568f92..28062a27f 100644 --- a/src/i18n/locales/de/messages.po +++ b/src/i18n/locales/de/messages.po @@ -10076,6 +10076,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "Werte durch Kommas trennen." +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "Serienstatus" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "Serienstatus" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "Serienstatus: {value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10140,6 +10156,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "Planungsdatum setzen" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "Serienstatus setzen" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/en/messages.po b/src/i18n/locales/en/messages.po index cfddcd77d..35ba733cf 100644 --- a/src/i18n/locales/en/messages.po +++ b/src/i18n/locales/en/messages.po @@ -10078,6 +10078,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "Separate values with commas." +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "Series status" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "Series status" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "Series status: {value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10142,6 +10158,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "Set scheduled date" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "Set series status" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/es/messages.po b/src/i18n/locales/es/messages.po index 932517d8d..6f7c581ab 100644 --- a/src/i18n/locales/es/messages.po +++ b/src/i18n/locales/es/messages.po @@ -10078,6 +10078,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "Separe los valores con comas." +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "Estado de la serie" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "Estado de la serie" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "Estado de la serie: {value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10142,6 +10158,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "Establecer fecha programada" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "Establecer estado de la serie" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/fr/messages.po b/src/i18n/locales/fr/messages.po index 78a88557a..5944ccd70 100644 --- a/src/i18n/locales/fr/messages.po +++ b/src/i18n/locales/fr/messages.po @@ -10078,6 +10078,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "Séparez les valeurs par des virgules." +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "Statut de la série" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "Statut de la série" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "Statut de la série : {value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10142,6 +10158,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "Définir la date planifiée" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "Définir le statut de la série" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/it/messages.po b/src/i18n/locales/it/messages.po index b37186efc..942af57a5 100644 --- a/src/i18n/locales/it/messages.po +++ b/src/i18n/locales/it/messages.po @@ -10078,6 +10078,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "Separa i valori con virgole." +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "Stato della serie" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "Stato della serie" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "Stato della serie: {value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10142,6 +10158,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "Imposta data pianificata" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "Imposta stato della serie" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/ja/messages.po b/src/i18n/locales/ja/messages.po index ed9bf2069..9339b4150 100644 --- a/src/i18n/locales/ja/messages.po +++ b/src/i18n/locales/ja/messages.po @@ -10077,6 +10077,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "値をカンマで区切ります。" +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "シリーズのステータス" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "シリーズのステータス" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "シリーズのステータス:{value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10141,6 +10157,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "予定日を設定" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "シリーズのステータスを設定" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/ko/messages.po b/src/i18n/locales/ko/messages.po index 4d7f8ae70..b5d168ab6 100644 --- a/src/i18n/locales/ko/messages.po +++ b/src/i18n/locales/ko/messages.po @@ -10077,6 +10077,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "값을 쉼표로 구분하세요." +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "시리즈 상태" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "시리즈 상태" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "시리즈 상태: {value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10141,6 +10157,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "예정일 설정" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "시리즈 상태 설정" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/pt/messages.po b/src/i18n/locales/pt/messages.po index 5de1bc792..ea6c58d5f 100644 --- a/src/i18n/locales/pt/messages.po +++ b/src/i18n/locales/pt/messages.po @@ -10079,6 +10079,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "Separe os valores por vírgulas." +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "Status da série" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "Status da série" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "Status da série: {value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10143,6 +10159,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "Definir data agendada" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "Definir status da série" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/ru/messages.po b/src/i18n/locales/ru/messages.po index 6d6d70dbb..5d0ff1dd3 100644 --- a/src/i18n/locales/ru/messages.po +++ b/src/i18n/locales/ru/messages.po @@ -10078,6 +10078,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "Разделяйте значения запятыми." +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "Статус серии" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "Статус серии" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "Статус серии: {value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10142,6 +10158,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "Установить запланированную дату" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "Установить статус серии" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/i18n/locales/zh/messages.po b/src/i18n/locales/zh/messages.po index 4e5b411d4..9e9f6ac59 100644 --- a/src/i18n/locales/zh/messages.po +++ b/src/i18n/locales/zh/messages.po @@ -10075,6 +10075,22 @@ msgctxt "settings.native.separateValuesWithCommas" msgid "Separate values with commas." msgstr "用逗号分隔值。" +#: src/components/TaskContextMenu.ts +#: src/modals/TaskActionPaletteModal.ts +msgctxt "contextMenus.task.seriesStatus" +msgid "Series status" +msgstr "系列状态" + +#: src/ui/taskPropertyPickers.ts +msgctxt "interaction property" +msgid "Series status" +msgstr "系列状态" + +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.tooltips.seriesStatusValue" +msgid "Series status: {value}" +msgstr "系列状态:{value}" + #: src/settings/native/integrations.ts msgctxt "settings.integrations.calendarSubscriptions.recurringEventRelatedNotesMode.options.series" msgid "Series-wide" @@ -10139,6 +10155,11 @@ msgctxt "modals.task.actions.scheduled" msgid "Set scheduled date" msgstr "设置计划日期" +#: src/modals/taskModalActionIconStates.ts +msgctxt "modals.task.actions.seriesStatus" +msgid "Set series status" +msgstr "设置系列状态" + #: src/modals/TaskModal.ts #: src/modals/taskModalActionIconStates.ts msgctxt "modals.task.actions.status" diff --git a/src/modals/TaskActionPaletteModal.ts b/src/modals/TaskActionPaletteModal.ts index f1b9ba7f1..8a897529c 100644 --- a/src/modals/TaskActionPaletteModal.ts +++ b/src/modals/TaskActionPaletteModal.ts @@ -570,7 +570,9 @@ export class TaskActionPaletteModal { private getCategoryLabel(category: TaskAction["category"]): string { const key = category === "status" - ? msg({ message: "Status", context: "contextMenus.task.status" }) + ? this.task.recurrence + ? msg({ message: "Series status", context: "contextMenus.task.seriesStatus" }) + : msg({ message: "Status", context: "contextMenus.task.status" }) : category === "priority" ? msg({ message: "Priority", context: "contextMenus.task.priority" }) : messageForKey(`modals.actionPalette.categories.${category}`); diff --git a/src/modals/taskModalActionIconStates.ts b/src/modals/taskModalActionIconStates.ts index c317e9029..2ef9c3286 100644 --- a/src/modals/taskModalActionIconStates.ts +++ b/src/modals/taskModalActionIconStates.ts @@ -164,13 +164,16 @@ function updateStatusIcon( renderConfiguredGlyph(icon, statusConfig?.icon, statusGlyph, (host) => renderStatusGlyph(host, statusGlyph) ); + // With a rule, Status sets the series' own status (#2632). + const series = Boolean(state.recurrenceRule); updateConfiguredValueIcon(icon, context, { isActive: Boolean(state.status && state.status !== state.defaultStatus), - activeTooltipKey: msg({ - message: "Status: {value}", - context: "modals.task.tooltips.statusValue", - }), - defaultTooltipKey: msg({ message: "Set status", context: "modals.task.actions.status" }), + activeTooltipKey: series + ? msg({ message: "Series status: {value}", context: "modals.task.tooltips.seriesStatusValue" }) + : msg({ message: "Status: {value}", context: "modals.task.tooltips.statusValue" }), + defaultTooltipKey: series + ? msg({ message: "Set series status", context: "modals.task.actions.seriesStatus" }) + : msg({ message: "Set status", context: "modals.task.actions.status" }), label: statusLabel, color: statusConfig?.color, }); diff --git a/src/modals/taskModalActionMenus.ts b/src/modals/taskModalActionMenus.ts index bfa85c1eb..738483b5b 100644 --- a/src/modals/taskModalActionMenus.ts +++ b/src/modals/taskModalActionMenus.ts @@ -40,7 +40,9 @@ export function showTaskModalPropertyPicker( anchor: HTMLElement ): Promise { const draft = () => createTaskModalReminderDraft(context.getState()); - return openTaskPropertyChoices(context.plugin, property, [draft()], anchor, (choice) => { + // A rule makes Status the series' own status, so the picker says so (#2632). + const recurrence = context.getState().recurrenceRule || undefined; + return openTaskPropertyChoices(context.plugin, property, [{ ...draft(), recurrence }], anchor, (choice) => { const value = typeof choice === "function" ? choice(draft()) : choice; if (typeof value !== "string" && value !== undefined) return; if (property === "status") context.setStatus(value ?? ""); diff --git a/src/ui/taskPropertyPickers.ts b/src/ui/taskPropertyPickers.ts index e7aed080f..c674aebf0 100644 --- a/src/ui/taskPropertyPickers.ts +++ b/src/ui/taskPropertyPickers.ts @@ -52,7 +52,7 @@ export type TaskPickerProperty = | "projects"; type PropertyValue = string | string[] | undefined; -export type TaskPickerValues = Pick; +export type TaskPickerValues = Pick; export type TaskPropertyChoice = PropertyValue | ((task: TaskPickerValues) => PropertyValue); export interface TaskUndoFeedback { @@ -69,10 +69,24 @@ export function updateTaskProjectsWithUndo( (await changeTaskProperty(plugin, [task], "projects", projects))[0] ?? null; } -export function taskPropertyLabel(property: TaskPickerProperty): string { +/** + * Status on a recurring task sets the series' own status; completing one occurrence is + * Mark complete or skip (#2440). Occurrence notes have no rule, so they keep "Status" (#2632). + */ +export function setsSeriesStatus(tasks: readonly Pick[]): boolean { + return tasks.length > 0 && tasks.every((task) => !!task.recurrence); +} + +/** `tasks` names the tasks a status label applies to, so recurring ones read "Series status". */ +export function taskPropertyLabel( + property: TaskPickerProperty, + tasks: readonly Pick[] = [] +): string { switch (property) { case "status": - return uiText(msg({ message: "Status", context: "interaction property" })); + return setsSeriesStatus(tasks) + ? uiText(msg({ message: "Series status", context: "interaction property" })) + : uiText(msg({ message: "Status", context: "interaction property" })); case "priority": return uiText(msg({ message: "Priority", context: "interaction property" })); case "due": @@ -379,8 +393,8 @@ export async function changeTaskProperty( } return config ? configLabel(config) : String(task[property] ?? "—"); }); - const outcome = uiText(msg({ message: "{count, plural, one {# task updated} other {# tasks updated}}: {property} → {value}", context: "interaction property feedback" }), { count: updatedTasks.length, property: taskPropertyLabel(property as TaskPickerProperty), value: [...new Set(values)].join(", ") }); - showTaskUndo(undo, failed, undo.length, plugin.app.vault, failed ? `${taskPropertyLabel(property as TaskPickerProperty)} · ${failedTitles.join(", ")}` : outcome, + const outcome = uiText(msg({ message: "{count, plural, one {# task updated} other {# tasks updated}}: {property} → {value}", context: "interaction property feedback" }), { count: updatedTasks.length, property: taskPropertyLabel(property as TaskPickerProperty, updatedTasks), value: [...new Set(values)].join(", ") }); + showTaskUndo(undo, failed, undo.length, plugin.app.vault, failed ? `${taskPropertyLabel(property as TaskPickerProperty, tasks)} · ${failedTitles.join(", ")}` : outcome, undefined, undefined, failedPaths.length ? { label: uiText(msg({ message: "Open task", context: "interaction shortcut" })), @@ -519,7 +533,7 @@ export async function openTaskPropertyChoices( const blocked = () => !!doc.querySelector(".modal-container") && !("closest" in anchor && anchor.closest(".modal-container")); if (blocked()) return; const clear = uiText(msg({ message: "Clear", context: "interaction clear" })); - const label = taskPropertyLabel(property); + const label = taskPropertyLabel(property, tasks); const title = tasks.length > 1 ? `${label} · ${uiText(msg({ message: "{count, plural, one {# task selected} other {# tasks selected}}", context: "components/BatchContextMenu: BatchContextMenu.buildMenu display" }), { count: tasks.length })}` : undefined; let items: PickerItem[] = []; if (property === "status" || property === "priority") { diff --git a/src/ui/taskViewKeyboard.ts b/src/ui/taskViewKeyboard.ts index 5190dfca1..3aecc9aec 100644 --- a/src/ui/taskViewKeyboard.ts +++ b/src/ui/taskViewKeyboard.ts @@ -480,7 +480,7 @@ export function installTaskViewKeyboard(options: TaskViewKeyboardOptions): () => const property = value as TaskPickerProperty; return { id: `picker-${property}`, - title: taskPropertyLabel(property), + title: taskPropertyLabel(property, [task]), description: "", icon: "list", category: "other", diff --git a/tests/unit/issues/issue-1724-recurring-actions-date-section.test.ts b/tests/unit/issues/issue-1724-recurring-actions-date-section.test.ts index 24ece12c4..0812bb4ec 100644 --- a/tests/unit/issues/issue-1724-recurring-actions-date-section.test.ts +++ b/tests/unit/issues/issue-1724-recurring-actions-date-section.test.ts @@ -141,7 +141,7 @@ describe("Issue #1724: recurring task actions belong with date menu items", () = expect(titles).toEqual( expect.arrayContaining([ - "Status", + "Series status", "Priority", "Due date", "Scheduled date", @@ -155,7 +155,7 @@ describe("Issue #1724: recurring task actions belong with date menu items", () = // "Mark complete or skip" submenu; the completion actions live inside it. expect(titles).not.toContain("Mark complete for this date"); - expect(titles.indexOf("Status")).toBeLessThan(titles.indexOf("Priority")); + expect(titles.indexOf("Series status")).toBeLessThan(titles.indexOf("Priority")); expect(titles.indexOf("Priority")).toBeLessThan(titles.indexOf("Mark complete or skip")); expect(titles.indexOf("Scheduled date")).toBeLessThan( titles.indexOf("Mark complete or skip") @@ -333,7 +333,7 @@ describe("Issue #1724: recurring task actions belong with date menu items", () = 1 ); expect(titles.indexOf("Open or create occurrence note")).toBeLessThan( - titles.indexOf("Status") + titles.indexOf("Series status") ); });