An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Complete in-progress tasks when clicking the status icon https://github.com/siyuan-note/siyuan/issues/19534
Daniel221f6ddd8091
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.syindex 9af33b7813..af41c27970 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy@@ -12248,7 +12248,7 @@"Children": [{"Type": "NodeText",- "Data": "Switch between Done and To Do"+ "Data": "Mark To Do and In Progress as Done; reset other states to To Do"}]},diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.syindex ff72e470a5..f812e26621 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy@@ -12228,7 +12228,7 @@"Children": [{"Type": "NodeText",- "Data": "完成和待办之间切换"+ "Data": "待办和进行中切换为完成,其他状态切换为待办"}]},diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.syindex 973170e637..7c11c1ffea 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy@@ -12240,7 +12240,7 @@"Children": [{"Type": "NodeText",- "Data": "完成和待辦之間切換"+ "Data": "待辦和進行中切換為完成,其他狀態切換為待辦"}]},diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.syindex dd7cfb210a..8facd8cbab 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy@@ -12198,7 +12198,7 @@"Children": [{"Type": "NodeText",- "Data": "完了と未完了を切り替え"+ "Data": "未着手と進行中は完了に、その他の状態は未着手に切り替え"}]},diff --git a/app/src/protyle/wysiwyg/taskListMarker.test.ts b/app/src/protyle/wysiwyg/taskListMarker.test.tsindex 1467a88041..1db912d2a7 100644--- a/app/src/protyle/wysiwyg/taskListMarker.test.ts+++ b/app/src/protyle/wysiwyg/taskListMarker.test.ts@@ -14,10 +14,11 @@ describe("getTaskListMarker", () => {assert.equal(nextTaskListStatus(custom), " ");}});- it("keeps the binary click cycle for preset and custom states", () => {+ it("completes todo and in-progress tasks and resets other states on click", () => {assert.equal(nextTaskListMarker(" "), "X");+ assert.equal(nextTaskListMarker("/"), "X");assert.equal(nextTaskListMarker(null), "X");- for (const marker of ["X", "x", "/", "-", "?"]) {+ for (const marker of ["X", "x", "-", "?"]) {assert.equal(nextTaskListMarker(marker), " ");}});diff --git a/app/src/protyle/wysiwyg/taskListMarker.ts b/app/src/protyle/wysiwyg/taskListMarker.tsindex d67f4825a3..96dde4e25e 100644--- a/app/src/protyle/wysiwyg/taskListMarker.ts+++ b/app/src/protyle/wysiwyg/taskListMarker.ts@@ -3,7 +3,8 @@ interface ITaskListMarker {marker: string;}-export const nextTaskListMarker = (marker: string | null) => marker !== null && marker !== " " ? " " : "X";+export const nextTaskListMarker = (marker: string | null) =>+ marker === null || marker === " " || marker === "/" ? "X" : " ";export const nextTaskListStatus = (marker: string | null): string => {const states = [" ", "/", "X", "-"];diff --git a/app/tests/taskStatus.test.js b/app/tests/taskStatus.test.jsindex 2ac2e9c61f..db6726cc39 100644--- a/app/tests/taskStatus.test.js+++ b/app/tests/taskStatus.test.js@@ -307,7 +307,7 @@ const cases = async source => {marker === "/" ? "none" : "line-through");}api.toggleTaskListItem(protyle, taskItem);- check.equal(taskItem.getAttribute("data-task"), marker === " " ? "X" : " ");+ check.equal(taskItem.getAttribute("data-task"), marker === " " || marker === "/" ? "X" : " ");}const before = taskItem.outerHTML;for (const marker of ["ab", "[", "]"]) {diff --git a/docs/TAB-BLOCK.md b/docs/TAB-BLOCK.mdindex 42202b5912..e6460c3b67 100644--- a/docs/TAB-BLOCK.md+++ b/docs/TAB-BLOCK.md@@ -26,7 +26,7 @@ Setting `tabs-task="true"` on a tab block displays task status for every directTask in the block menu is a group toggle. It is checked if the group has `tabs-task="true"` or any direct item has `tabs-task`. Turning it off removes the attribute from the group and every direct item; turning it on sets the group attribute so all direct items default to incomplete. A new item is an incomplete task whenever the group contains any task item. Moving between groups retains each item's state; ordinary items moved into task groups default to incomplete. Existing documents without the group attribute still support mixed groups, which can be normalized through the group toggle.-Clicking a state icon does not select the tab or start renaming: incomplete becomes `X`, while any other state becomes a space. Right-clicking either the icon or title opens the complete item menu. When editable, it directly offers To do, In progress, Completed, Canceled and Custom task status, separated from other operations without a nested Task status submenu. Read-only items still offer copying a block reference. In progress uses `/`; Canceled uses `-` and dims and strikes through the navigation title. In-progress titles retain their normal appearance. The icon has no separate Task List tooltip.+Clicking a state icon does not select the tab or start renaming: To do and In progress become Completed (`X`), while any other state becomes To do (a space). Right-clicking either the icon or title opens the complete item menu. When editable, it directly offers To do, In progress, Completed, Canceled and Custom task status, separated from other operations without a nested Task status submenu. Read-only items still offer copying a block reference. In progress uses `/`; Canceled uses `-` and dims and strikes through the navigation title. In-progress titles retain their normal appearance. The icon has no separate Task List tooltip.Right-clicking a task list icon opens the complete list item block menu. The block menu - List block directly lists the five states with a single custom-state entry and a separator before list insertion operations. Menu configuration version 6 expands the old status submenu in place, preserving child order and plugin positions. The merged custom-state entry remains visible whenever either former entry was visible. Task icons display the original custom character. In-progress text retains its normal appearance, canceled text is dimmed and struck through, and completed text keeps its existing style. Display follows the original marker; the stored compatibility rule that non-space markers are checked remains unchanged, as does the existing Markdown export normalization. Setting and toggling states support undo and redo. Copying, cutting or dragging an individual tab item materializes its inherited incomplete state in the destination so it remains a task outside its original group; undoing a move restores the original inherited attribute state.diff --git a/docs/TAB-BLOCK.zh-CN.md b/docs/TAB-BLOCK.zh-CN.mdindex 8bc5df665f..50b55362de 100644--- a/docs/TAB-BLOCK.zh-CN.md+++ b/docs/TAB-BLOCK.zh-CN.md@@ -26,7 +26,7 @@块标菜单中的“任务”是整组开关:组级 `tabs-task="true"` 或任一直属项具有 `tabs-task` 时显示选中;关闭时移除组级和所有直属项的任务属性,开启时设置组级属性,所有直属项默认为未完成。组内存在任务项时,新建页签也为未完成任务。跨组移动保留页签自身状态,普通页签移入任务组后默认为未完成。未设置组级属性的旧文档仍支持混合组,整组开关可统一处理。-点击状态图标不会切页或进入重命名:未完成变为 `X`,其他状态变为空格。右键点击图标与右键标题均打开当前页签项的完整菜单,在可写状态下直接列出待办、进行中、完成、放弃和自定义任务状态,通过分隔线与其他操作区分,不再嵌套“任务状态”子菜单。只读时仍可打开菜单复制块引用。进行中使用 `/`,放弃使用 `-`;放弃状态的导航标题淡化并加删除线,进行中保持正常显示。状态图标不显示单独的“任务列表”悬浮提示。+点击状态图标不会切页或进入重命名:待办和进行中变为完成 `X`,其他状态变为待办空格。右键点击图标与右键标题均打开当前页签项的完整菜单,在可写状态下直接列出待办、进行中、完成、放弃和自定义任务状态,通过分隔线与其他操作区分,不再嵌套“任务状态”子菜单。只读时仍可打开菜单复制块引用。进行中使用 `/`,放弃使用 `-`;放弃状态的导航标题淡化并加删除线,进行中保持正常显示。状态图标不显示单独的“任务列表”悬浮提示。右键点击任务列表图标打开完整列表项块菜单。块标菜单 - 列表块直接列出五个状态选项,自定义入口只保留一个,状态组与列表插入操作之间有分隔线。菜单配置版本 6 将旧状态子菜单展开到原位置,保留子项顺序和插件位置;两个自定义入口的可见性合并,只要原来有一个入口可见,新入口就保持可见。任务图标显示原始自定义字符,进行中正文保持正常显示,放弃正文淡化并加删除线,完成保留原有样式。显示依据原始标记,存储中的非空格已勾选兼容规则不变;Markdown 导出仍沿用现有任务标记标准化规则。设置和点击切换均支持撤销、重做。单独复制、剪切或拖动页签项时,继承的未完成状态会写入目标项,避免离开任务组后变成普通页签;移动撤销后恢复原来的继承属性。