An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Move mind map summary creation back to the node menu https://github.com/siyuan-note/siyuan/issues/20803
Danielb7fabd9a64c9
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.syindex 5ca9d55b2e..adee21ef22 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy@@ -8,7 +8,7 @@"title": "Formatting elements","title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;","type": "doc",- "updated": "20261022190543"+ "updated": "20261022235541"},"Children": [{@@ -1961,7 +1961,7 @@"HeadingLevel": 2,"Properties": {"id": "20210104091509-v1x69oc",- "updated": "20261022181804"+ "updated": "20261022235541"},"Children": [{@@ -3660,12 +3660,12 @@"Type": "NodeParagraph","Properties": {"id": "20260926151827-kkcg79g",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{"Type": "NodeText",- "Data": "Select nodes, then click "+ "Data": "Select at least two nodes, then click "},{"Type": "NodeTextMark",@@ -3674,7 +3674,7 @@},{"Type": "NodeText",- "Data": " beside the preview bracket on the canvas to create summaries immediately, without selecting again or confirming. For several groups, the button shows how many summaries it will create. On desktop, drag on blank canvas or Ctrl/Command-click nodes; on touch screens, enable "+ "Data": " in the bottom node menu to create summaries immediately, without selecting again or confirming. Selecting nodes alone does not preview or create summaries. On desktop, drag on blank canvas or Ctrl/Command-click nodes; on touch screens, enable "},{"Type": "NodeTextMark",@@ -3683,7 +3683,7 @@},{"Type": "NodeText",- "Data": " in the top toolbar, then tap nodes. Consecutive selected siblings form one summary; separate ranges and different parents form separate summaries, without including unselected nodes. Selected ancestors take precedence over their descendants. Single-node and nested summaries are supported. Existing identical summaries are skipped; crossing ranges disable creation and show a warning. The bracket encloses the visible subtree and inner summaries. All groups are created in one undoable operation. Unavailable node actions are disabled. Esc leaves multi-select mode."+ "Data": " in the top toolbar, then tap nodes. Consecutive selected siblings form one summary; separate ranges and different parents form separate summaries, without including unselected nodes. Selected ancestors take precedence over their descendants. Groups may contain a single node, and nested summaries are supported. Existing identical summaries are skipped; crossing ranges disable creation, with the reason available on the button. The bracket encloses the visible subtree and inner summaries. All groups are created in one undoable operation, then the first new summary is revealed and its text is focused for editing. Unavailable node actions are disabled. Esc on the canvas leaves multi-select mode."}]},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 54c557a94f..6f57b51354 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@@ -7,7 +7,7 @@"id": "20200924100950-9op5xi1","title": "Shortcuts","type": "doc",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{@@ -13115,7 +13115,7 @@"Type": "NodeHeading","Properties": {"id": "20260921105011-4zeuyl4",- "updated": "20261022134112"+ "updated": "20261022235541"},"HeadingLevel": 3,"Children": [@@ -13960,12 +13960,12 @@"Type": "NodeParagraph","Properties": {"id": "20260926152753-8trdt10",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{"Type": "NodeText",- "Data": "Select nodes, then activate "+ "Data": "Select at least two nodes, then activate "},{"Type": "NodeTextMark",@@ -13974,7 +13974,7 @@},{"Type": "NodeText",- "Data": " beside the preview bracket on the canvas to create all valid groups in one undoable operation. Esc leaves multi-select mode. While editing summary text, Enter saves and Esc cancels. Delete or Backspace removes the selected summary."+ "Data": " in the bottom node menu to create all valid groups in one undoable operation and edit the first new summary. Esc on the canvas leaves multi-select mode. While editing summary text, Enter saves and Esc cancels the text edit. Delete or Backspace removes the selected summary."}]},diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.syindex 8aeaed5ee1..3525a2de1b 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy@@ -8,7 +8,7 @@"title": "排版元素","title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);","type": "doc",- "updated": "20261022190543"+ "updated": "20261022235541"},"Children": [{@@ -1964,7 +1964,7 @@"HeadingLevel": 2,"Properties": {"id": "20210104091228-wdpx6ev",- "updated": "20261022181804"+ "updated": "20261022235541"},"Children": [{@@ -3663,12 +3663,12 @@"Type": "NodeParagraph","Properties": {"id": "20260926151827-8wl1iml",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{"Type": "NodeText",- "Data": "选中节点后,点击画布预览括号旁的 "+ "Data": "选中至少两个节点后,点击底部节点菜单中的 "},{"Type": "NodeTextMark",@@ -3677,7 +3677,7 @@},{"Type": "NodeText",- "Data": " 即可直接创建,无需再次选择或确认。多组时,按钮显示将创建的概要数量。桌面端可在空白画布框选,或按住 Ctrl/Command 点选节点;触屏上先开启顶部工具栏的 "+ "Data": " 即可直接创建,无需再次选择或确认。仅选择节点时不显示概要预览,也不会创建概要。桌面端可在空白画布框选,或按住 Ctrl/Command 点选节点;触屏上先开启顶部工具栏的 "},{"Type": "NodeTextMark",@@ -3686,7 +3686,7 @@},{"Type": "NodeText",- "Data": ",再逐个点选节点。同一父节点下连续的选中节点生成一个概要,不连续或不同父节点下的选区分别生成多个概要,不会纳入未选节点。父子同时选中时以最外层节点为准。支持单节点概要和范围嵌套,已有相同概要会跳过;范围交叉时禁用创建并显示提示。括号包围可见子树及内层概要。全部分组一次创建,并可一次撤销。节点菜单中不适用的操作置灰,Esc 退出多选模式。"+ "Data": ",再逐个点选节点。同一父节点下连续的选中节点生成一个概要,不连续或不同父节点下的选区分别生成多个概要,不会纳入未选节点。父子同时选中时以最外层节点为准。分组可只含一个节点,支持范围嵌套,已有相同概要会跳过;范围交叉时概要按钮置灰,并提供原因提示。括号包围可见子树及内层概要。全部分组一次创建,并可一次撤销;创建后自动定位到第一个新概要并进入文字编辑。节点菜单中不适用的操作置灰,在画布上按 Esc 退出多选模式。"}]},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 675c1146a7..72d7588666 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@@ -7,7 +7,7 @@"id": "20200813004551-gm0pbn1","title": "快捷键","type": "doc",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{@@ -13097,7 +13097,7 @@"Type": "NodeHeading","Properties": {"id": "20260921105011-hmrchvc",- "updated": "20261022134112"+ "updated": "20261022235541"},"HeadingLevel": 3,"Children": [@@ -14030,12 +14030,12 @@"Type": "NodeParagraph","Properties": {"id": "20260926152753-tamny2o",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{"Type": "NodeText",- "Data": "选中节点后,激活画布预览括号旁的 "+ "Data": "选中至少两个节点后,激活底部节点菜单中的 "},{"Type": "NodeTextMark",@@ -14044,7 +14044,7 @@},{"Type": "NodeText",- "Data": " 可一次创建所有有效分组,并可一次撤销。Esc 退出多选模式。编辑概要文字时,Enter 保存,Esc 取消。选中概要后,Delete 或 Backspace 删除概要。"+ "Data": " 可一次创建所有有效分组,并可一次撤销,随后编辑第一个新概要。在画布上按 Esc 退出多选模式。编辑概要文字时,Enter 保存,Esc 取消文字编辑。选中概要后,Delete 或 Backspace 删除概要。"}]},diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.syindex 0df2d54a07..a15b1e9e9c 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy@@ -8,7 +8,7 @@"title": "排版元素","title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);","type": "doc",- "updated": "20261022190543"+ "updated": "20261022235541"},"Children": [{@@ -1962,7 +1962,7 @@"HeadingLevel": 2,"Properties": {"id": "20211226122008-731sqd6",- "updated": "20261022181804"+ "updated": "20261022235541"},"Children": [{@@ -3661,12 +3661,12 @@"Type": "NodeParagraph","Properties": {"id": "20260926151827-6pycwgr",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{"Type": "NodeText",- "Data": "選取節點後,點選畫布預覽括號旁的 "+ "Data": "選取至少兩個節點後,點選底部節點選單中的 "},{"Type": "NodeTextMark",@@ -3675,7 +3675,7 @@},{"Type": "NodeText",- "Data": " 即可直接建立,無需再次選取或確認。多組時,按鈕顯示將建立的概要數量。桌面端可在空白畫布框選,或按住 Ctrl/Command 點選節點;觸控螢幕上先開啟頂部工具列的 "+ "Data": " 即可直接建立,無需再次選取或確認。僅選取節點時不顯示概要預覽,也不會建立概要。桌面端可在空白畫布框選,或按住 Ctrl/Command 點選節點;觸控螢幕上先開啟頂部工具列的 "},{"Type": "NodeTextMark",@@ -3684,7 +3684,7 @@},{"Type": "NodeText",- "Data": ",再逐一點選節點。同一父節點下連續的選取節點產生一個概要,不連續或不同父節點下的選取範圍分別產生多個概要,不會納入未選節點。同時選取父子節點時以最外層節點為準。支援單節點概要和範圍巢狀包含,既有相同概要會略過;範圍交叉時停用建立並顯示提示。括號包圍可見子樹及內層概要。全部分組一次建立,並可一次復原。節點選單中不適用的操作會停用,Esc 結束多選模式。"+ "Data": ",再逐一點選節點。同一父節點下連續的選取節點產生一個概要,不連續或不同父節點下的選取範圍分別產生多個概要,不會納入未選節點。同時選取父子節點時以最外層節點為準。分組可只含一個節點,支援範圍巢狀包含,既有相同概要會略過;範圍交叉時概要按鈕停用,並提供原因提示。括號包圍可見子樹及內層概要。全部分組一次建立,並可一次復原;建立後自動移至第一個新概要並進入文字編輯。節點選單中不適用的操作會停用,在畫布上按 Esc 結束多選模式。"}]},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 c66cad1444..6684af6814 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@@ -7,7 +7,7 @@"id": "20211226122549-jktxego","title": "快捷鍵","type": "doc",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{@@ -13103,7 +13103,7 @@"Type": "NodeHeading","Properties": {"id": "20260921105011-z0oyw36",- "updated": "20261022134112"+ "updated": "20261022235541"},"HeadingLevel": 3,"Children": [@@ -13948,12 +13948,12 @@"Type": "NodeParagraph","Properties": {"id": "20260926152753-0k1m0f6",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{"Type": "NodeText",- "Data": "選取節點後,啟動畫布預覽括號旁的 "+ "Data": "選取至少兩個節點後,啟動底部節點選單中的 "},{"Type": "NodeTextMark",@@ -13962,7 +13962,7 @@},{"Type": "NodeText",- "Data": " 可一次建立所有有效分組,並可一次復原。Esc 結束多選模式。編輯概要文字時,Enter 儲存,Esc 取消。選取概要後,Delete 或 Backspace 刪除概要。"+ "Data": " 可一次建立所有有效分組,並可一次復原,隨後編輯第一個新概要。在畫布上按 Esc 結束多選模式。編輯概要文字時,Enter 儲存,Esc 取消文字編輯。選取概要後,Delete 或 Backspace 刪除概要。"}]},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 641f9a5b5c..0868eca299 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@@ -9,7 +9,7 @@"id": "20240530101000-xsbxokr","title": "ショートカット","type": "doc",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{@@ -13053,7 +13053,7 @@"Type": "NodeHeading","Properties": {"id": "20260921105011-icqlkb6",- "updated": "20261022134112"+ "updated": "20261022235541"},"HeadingLevel": 3,"Children": [@@ -13880,12 +13880,12 @@"Type": "NodeParagraph","Properties": {"id": "20260926152753-5vwcnw1",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{"Type": "NodeText",- "Data": "ノードを選択してから、キャンバスのプレビュー括弧の横にある "+ "Data": "2 つ以上のノードを選択してから、下部のノードメニューで "},{"Type": "NodeTextMark",@@ -13894,7 +13894,7 @@},{"Type": "NodeText",- "Data": " を実行すると、有効な全グループを一度に作成し、一度の取り消しで元に戻せます。Esc で複数選択モードを終了します。要約テキストの編集中は Enter で保存、Esc でキャンセルします。選択中の要約は Delete または Backspace で削除できます。"+ "Data": " を実行すると、有効な全グループを一度に作成し、最初の新しい要約を編集できます。作成は一度の取り消しで元に戻せます。キャンバス上で Esc を押すと複数選択モードを終了します。要約テキストの編集中は Enter で保存、Esc でテキストの編集をキャンセルします。選択中の要約は Delete または Backspace で削除できます。"}]},diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.syindex 5f5eca0322..f86f654030 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy@@ -9,7 +9,7 @@"title": "書式要素","title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;","type": "doc",- "updated": "20261022190543"+ "updated": "20261022235541"},"Children": [{@@ -2090,7 +2090,7 @@"Properties": {"ID": "20240530101000-ch5e4vh","id": "20240530101000-1ev7xub",- "updated": "20261022181804"+ "updated": "20261022235541"},"Children": [{@@ -3792,12 +3792,12 @@"Type": "NodeParagraph","Properties": {"id": "20260926151827-vknoaqd",- "updated": "20261022134112"+ "updated": "20261022235541"},"Children": [{"Type": "NodeText",- "Data": "ノードを選択してから、キャンバスのプレビュー括弧の横にある "+ "Data": "2 つ以上のノードを選択してから、下部のノードメニューで "},{"Type": "NodeTextMark",@@ -3806,7 +3806,7 @@},{"Type": "NodeText",- "Data": " をクリックすると、再選択や確認なしですぐに作成できます。複数グループの場合、ボタンに作成する要約の数が表示されます。デスクトップでは空白部分をドラッグするか、Ctrl/Command を押しながらノードをクリックします。タッチ画面では上部ツールバーの "+ "Data": " をクリックすると、再選択や確認なしですぐに作成できます。ノードを選択するだけでは要約をプレビューしたり作成したりしません。デスクトップでは空白部分をドラッグするか、Ctrl/Command を押しながらノードをクリックします。タッチ画面では上部ツールバーの "},{"Type": "NodeTextMark",@@ -3815,7 +3815,7 @@},{"Type": "NodeText",- "Data": " を有効にしてからノードをタップします。同じ親を持つ連続した選択ノードは 1 つの要約になり、離れた範囲や異なる親の範囲は別々の要約になります。未選択のノードは含めません。親子を同時に選択した場合は最も外側のノードを優先します。単一ノードと入れ子の要約に対応し、同じ要約は重複して作成しません。範囲が交差する場合は作成を無効にし、メッセージを表示します。括弧は表示中の子ツリーと内側の要約を囲みます。全グループを一度に作成し、一度の取り消しで元に戻せます。使用できないノード操作は無効になります。Esc で複数選択モードを終了します。"+ "Data": " を有効にしてからノードをタップします。同じ親を持つ連続した選択ノードは 1 つの要約になり、離れた範囲や異なる親の範囲は別々の要約になります。未選択のノードは含めません。親子を同時に選択した場合は最も外側のノードを優先します。各グループは 1 つのノードでも作成でき、入れ子にも対応します。同じ要約は重複して作成せず、範囲が交差する場合はボタンを無効にして理由を示します。括弧は表示中の子ツリーと内側の要約を囲みます。全グループを一度に作成し、一度の取り消しで元に戻せます。作成後は最初の新しい要約を表示し、テキストの編集に移ります。使用できないノード操作は無効になります。キャンバス上で Esc を押すと複数選択モードを終了します。"}]},diff --git a/app/src/assets/scss/protyle/_mindmap-view.scss b/app/src/assets/scss/protyle/_mindmap-view.scssindex 4afbb28861..b398e2244f 100644--- a/app/src/assets/scss/protyle/_mindmap-view.scss+++ b/app/src/assets/scss/protyle/_mindmap-view.scss@@ -834,17 +834,6 @@}}- &__summary-action {- position: absolute;- z-index: 6;- min-width: 44px;- min-height: 32px;- max-width: calc(100% - 16px);- box-sizing: border-box;- white-space: normal;- background-color: var(--b3-theme-background);- }-&__route-status {position: absolute;bottom: 72px;@@ -956,10 +945,6 @@}@media (any-pointer: coarse) {- .mindmap-view__summary-action {- min-height: 44px;- }-.mindmap-view__route-endpoint {width: 28px;height: 28px;@@ -981,7 +966,6 @@&__route-handle,&__route-status,&__selection-box,- &__summary-action,&__add-bridge,&__fold,&__add-child {diff --git a/app/src/protyle/render/listMindmap/arrows.test.ts b/app/src/protyle/render/listMindmap/arrows.test.tsindex e36ce1c9a7..85c2067a8c 100644--- a/app/src/protyle/render/listMindmap/arrows.test.ts+++ b/app/src/protyle/render/listMindmap/arrows.test.ts@@ -12,8 +12,8 @@ const source = createSourceFile("view.ts", readFileSync("src/protyle/render/listScriptTarget.ES2021, true);const view = source.statements.find(item => isClassDeclaration(item) && item.name?.text === "ListMindmapView");assert.ok(view && isClassDeclaration(view));-const methods = view.members.filter(item => ["relationPath", "draw", "drawSummaryPreview", "findLine", "renderInspector"].includes(item.name?.getText(source)));-assert.equal(methods.length, 5);+const methods = view.members.filter(item => ["relationPath", "draw", "findLine", "renderInspector"].includes(item.name?.getText(source)));+assert.equal(methods.length, 4);const compiled = transpileModule(`class View {${methods.map(item => item.getText(source)).join("\n")}}@@ -70,7 +70,7 @@ const setup = (arrowDirection?: ListMindmapRelation["arrowDirection"]) => {scale: 1, offsetX: 0, offsetY: 0, world: {style: {}}, zoomLabel: {}, zoomSlider: {},viewport: {clientWidth: 400, clientHeight: 200, getBoundingClientRect: () => ({left: 0, top: 0})},canvas: {getContext: () => context}, options: {host: {}}, colorProbe: {style: {}},- inspector: {hidden: true}, summaryAction: {hidden: true},+ inspector: {hidden: true},model: {root: {id: "a"}, metadata: {nodes: {}, relations: [relation]}}, edges: [],positions: new Map([["a", {id: "a", x: 100, y: 0, width: 20, height: 20}],["b", {id: "b", x: -20, y: 0, width: 20, height: 20}]]),diff --git a/app/src/protyle/render/listMindmap/model.test.ts b/app/src/protyle/render/listMindmap/model.test.tsindex a20f696c61..992c73dc41 100644--- a/app/src/protyle/render/listMindmap/model.test.ts+++ b/app/src/protyle/render/listMindmap/model.test.ts@@ -2178,7 +2178,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,check.ok(palette.scrollWidth > palette.clientWidth, "long palettes scroll independently");palette.scrollLeft = palette.scrollWidth;const bounds = inspector.getBoundingClientRect();- for (const key of ["connect", "delete"]) {+ for (const key of ["connect", "listMindmapSummary", "delete"]) {const action = inspector.querySelector<HTMLElement>(`[aria-label="${key}"]`).getBoundingClientRect();check.ok(action.left >= bounds.left && action.right <= bounds.right,`node action ${key} stays visible at width ${width} while the palette scrolls`);@@ -2461,7 +2461,8 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,const narrowPanelBounds = host.getBoundingClientRect();check.ok(narrowInspectorBounds.left > narrowPanelBounds.left);check.ok(narrowInspectorBounds.right < narrowPanelBounds.right);- check.ok(inspector.scrollWidth > inspector.clientWidth);+ hostParent.style.width = "180px";+ check.ok(inspector.scrollWidth > inspector.clientWidth, "the line menu scrolls when its actual controls no longer fit");inspector.scrollLeft = inspector.scrollWidth;check.ok(inspector.scrollLeft > 0);inspector.scrollLeft = 0;@@ -4681,14 +4682,16 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,}});await settle();summaryView.focusNode(summaryIds[0]);- const summaryButton = summaryHost.querySelector<HTMLButtonElement>(".mindmap-view__summary-action");+ const summaryButton = summaryHost.querySelector<HTMLButtonElement>('.mindmap-view__inspector [aria-label="listMindmapSummary"]');for (const id of [summaryModel.root.id, summaryIds[0]]) {summaryView.focusNode(id);- check.equal(summaryButton.hidden, true, "a single selected node has no summary action");+ check.equal(summaryButton.hidden, false, "the node menu keeps the summary action in a stable position");check.equal(summaryButton.disabled, true, "a single selected node cannot create a summary");summaryButton.click();check.equal(api.readListMindmap(summaryList).metadata.summaries?.length || 0, 0);}+ summaryView.draw();+ const singleSelectionCanvas = summaryHost.querySelector<HTMLCanvasElement>("canvas").toDataURL();for (const id of summaryIds.slice(1)) {summaryView.selectNode(id, true);}@@ -4696,6 +4699,9 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,check.equal(summaryButton.hidden, false);check.equal(summaryButton.disabled, false);const summaryCanvas = summaryHost.querySelector<HTMLCanvasElement>("canvas");+ check.equal(summaryCanvas.toDataURL(), singleSelectionCanvas, "multi-selection does not draw summary brackets");+ check.equal(summaryHost.querySelector(".mindmap-view__summary-action"), null, "selection has no graph creation control");+ check.equal(summaryHost.querySelector(".mindmap-view__summary"), null, "selection alone does not create a summary");const outsideSummary = document.createElement("button");document.body.append(outsideSummary);for (const leave of [@@ -4705,26 +4711,31 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,const preview = summaryCanvas.toDataURL();const selected = summaryView.getSelectedIds();leave();- check.equal(summaryButton.hidden, true, "leaving the mindmap hides the summary action");+ check.equal(summaryButton.closest<HTMLElement>(".mindmap-view__inspector").hidden, true, "leaving the mindmap hides the node menu");check.deepEqual(summaryView.getSelectedIds(), selected, "focus changes preserve the node selection");const inactive = summaryCanvas.toDataURL();- check.ok(inactive !== preview, "leaving the mindmap immediately clears the dashed summary preview");+ check.equal(inactive, preview, "ordinary selection does not add summary graphics that need blur cleanup");summaryView.draw();check.equal(summaryCanvas.toDataURL(), inactive, "no stale preview remains until a later redraw");summaryView.focusNode(summaryIds[0]);for (const id of summaryIds.slice(1)) {summaryView.selectNode(id, true);}- check.equal(summaryButton.hidden, false, "multi-selection restores the summary action");+ check.equal(summaryButton.closest<HTMLElement>(".mindmap-view__inspector").hidden, false, "multi-selection restores the node menu");}outsideSummary.remove();- check.equal(summaryHost.querySelector('.mindmap-view__inspector [aria-label="listMindmapSummary"]'), null);+ await settle();+ await moveMouse(summaryButton);+ check.equal(summaryHost.querySelector('.mindmap-view__inspector [aria-label="listMindmapSummary"]'), summaryButton,+ "the node menu retains the summary button across selection and focus changes");const summaryActionBounds = summaryButton.getBoundingClientRect();check.equal(document.elementFromPoint(summaryActionBounds.left + summaryActionBounds.width / 2,- summaryActionBounds.top + summaryActionBounds.height / 2)?.closest("button"), summaryButton);+ summaryActionBounds.top + summaryActionBounds.height / 2)?.closest("button"), summaryButton,+ "the bottom summary button is reachable at its rendered position");await clickMouse(summaryButton);const summaryInput = summaryHost.querySelector<HTMLInputElement>(".mindmap-view__summary-editor");- check.ok(summaryInput, "new summaries enter text editing on touch selection");+ check.ok(summaryInput, "new summaries enter text editing after the menu action");+ check.equal(document.activeElement, summaryInput, "creation focuses the new summary text");summaryInput.value = "<script>plain text</script> " + "Long summary ".repeat(25);summaryInput.dispatchEvent(new KeyboardEvent("keydown", {key: "Enter", bubbles: true}));await settle();@@ -4887,13 +4898,11 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,summaryView.selectNode(summaryIds[2], true);check.equal(summaryButton.disabled, true, "crossing ranges disable direct creation");check.equal(summaryButton.getAttribute("aria-description"), "listMindmapSummaryConflict");- check.equal(summaryView.summaryStatus.hidden, false, "touch users can see why creation is disabled");await settle();- check.equal(summaryButton.hidden, true, "conflicting selections do not expose a creation control");+ check.equal(summaryButton.hidden, false, "conflicting selections retain the disabled menu action");summaryButton.click();check.deepEqual(api.readListMindmap(summaryList).metadata.summaries[0].nodeIds, summaryIds.slice(0, 2));summaryView.clearSelection();- check.equal(summaryView.summaryStatus.hidden, true);const keyboardModel = api.readListMindmap(summaryList);keyboardModel.metadata.summaries = [];api.writeListMindmapMetadata(summaryList, keyboardModel.metadata);@@ -4926,7 +4935,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,check.ok(printedBounds.bottom <= printViewport.bottom + 1, "PDF previews include tall summary labels");printedLabel.dispatchEvent(new MouseEvent("dblclick", {bubbles: true}));check.equal(summaryHost.querySelector(".mindmap-view__summary-editor"), null);- check.equal(summaryHost.querySelector<HTMLButtonElement>(".mindmap-view__summary-action").hidden, true);+ check.equal(summaryHost.querySelector('.mindmap-view__inspector [aria-label="listMindmapSummary"]'), null);summaryView.destroy();summaryHost.remove();api.deleteListMindmapNode(summaryList, summaryIds[0]);@@ -5052,11 +5061,11 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,const batchInspector = batchHost.querySelector<HTMLElement>(".mindmap-view__inspector");check.equal(batchInspector.hidden, false);check.equal(batchInspector.querySelector('[aria-label="multiSelect"]'), null);- const batchButton = batchHost.querySelector<HTMLButtonElement>(".mindmap-view__summary-action");- check.equal(batchInspector.querySelector('[aria-label="listMindmapSummary"]'), null);+ const batchButton = batchInspector.querySelector<HTMLButtonElement>('[aria-label="listMindmapSummary"]');+ check.equal(batchHost.querySelector(".mindmap-view__summary-action"), null);await settle();check.equal(batchButton.hidden, false);- check.equal(batchButton.textContent, batchLabels.listMindmapSummaryBatch.replace("${count}", "2"));+ check.equal(batchButton.querySelector("use").getAttribute("xlink:href"), "#iconGroups");check.equal(batchButton.disabled, false);check.equal(batchButton.dataset.tooltip, batchLabels.listMindmapSummaryBatch.replace("${count}", "2"));check.equal(batchInspector.querySelector<HTMLButtonElement>('[aria-label="connect"]').disabled, true);@@ -5064,14 +5073,11 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,for (const [background, primary] of [["#ffffff", "#2563eb"], ["#1e1e1e", "#93c5fd"]]) {batchHost.style.setProperty("--b3-theme-background", background);batchHost.style.setProperty("--b3-theme-primary", primary);- const colorProbe = document.createElement("span");- colorProbe.style.color = background;- batchHost.append(colorProbe);- check.equal(getComputedStyle(batchButton).backgroundColor, getComputedStyle(colorProbe).color,- "floating controls retain the theme background in light and dark themes");- colorProbe.style.color = primary;- check.equal(getComputedStyle(batchButton).color, getComputedStyle(colorProbe).color);- colorProbe.remove();+ const sibling = batchInspector.querySelector('[aria-label="delete"]');+ for (const property of ["color", "background-color", "border-radius", "padding"]) {+ check.equal(getComputedStyle(batchButton).getPropertyValue(property), getComputedStyle(sibling).getPropertyValue(property),+ "summary actions use the shared node controls in light and dark themes");+ }}batchHost.style.removeProperty("--b3-theme-background");batchHost.style.removeProperty("--b3-theme-primary");@@ -5092,11 +5098,16 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,const actionBounds = batchButton.getBoundingClientRect();batchButton.dispatchEvent(new PointerEvent("pointerdown", {pointerId: 85, pointerType: "touch", isPrimary: true,button: 0, bubbles: true, clientX: actionBounds.left + 1, clientY: actionBounds.top + 1}));- check.deepEqual(batchView.getSelectedIds(), selectedBeforeAction, "touching the graph action preserves the selection");+ check.deepEqual(batchView.getSelectedIds(), selectedBeforeAction, "touching the menu action preserves the selection");batchButton.click();await settle();check.equal(batchHistory.length, 1, "clicking summary submits all groups once without a confirmation step");check.equal(api.readListMindmap(batchList).metadata.summaries.length, 2);+ const firstBatchSummary = batchHost.querySelector<HTMLInputElement>(".mindmap-view__summary-editor");+ check.ok(firstBatchSummary, "batch creation immediately opens the first new summary for editing");+ check.equal(document.activeElement, firstBatchSummary);+ check.equal(batchView.selectedSummary, api.readListMindmap(batchList).metadata.summaries[0].id);+ firstBatchSummary.dispatchEvent(new KeyboardEvent("keydown", {key: "Escape", bubbles: true}));check.equal(batchButton.disabled, true, "identical groups cannot be created twice");const restoreBatch = (html: string) => {const restored = document.createElement("div");@@ -5210,6 +5221,7 @@ test("list mindmap mutations preserve block data in the real DOM and Lute", {compile(path.join(__dirname, "legacy.ts")) + compile(path.join(__dirname, "migrate.ts")) +compile(path.join(__dirname, "create.ts")) + compile(path.join(__dirname, "render.ts"));const css = require("sass").compile(path.resolve(__dirname, "../../../assets/scss/business/_block.scss")).css ++ require("sass").compile(path.resolve(__dirname, "../../../assets/scss/component/_svg.scss")).css +require("sass").compile(path.resolve(__dirname, "../../../assets/scss/component/_button.scss")).css +require("sass").compile(path.resolve(__dirname, "../../../assets/scss/component/_select.scss")).css +require("sass").compile(path.resolve(__dirname, "../../../assets/scss/business/_color.scss")).css +diff --git a/app/src/protyle/render/listMindmap/summaryView.test.ts b/app/src/protyle/render/listMindmap/summaryView.test.tsindex 6e787044b3..9444d4821e 100644--- a/app/src/protyle/render/listMindmap/summaryView.test.ts+++ b/app/src/protyle/render/listMindmap/summaryView.test.ts@@ -11,8 +11,8 @@ const source = createSourceFile("view.ts", readFileSync("src/protyle/render/listScriptTarget.ES2021, true);const declaration = source.statements.find(item => isClassDeclaration(item) && item.name?.text === "ListMindmapView");assert.ok(declaration && isClassDeclaration(declaration));-const methods = declaration.members.filter(item => ["drawSummaries", "drawSummaryPreview", "positionSummaryAction"].includes(item.name?.getText(source)));-assert.equal(methods.length, 3);+const methods = declaration.members.filter(item => ["drawSummaries"].includes(item.name?.getText(source)));+assert.equal(methods.length, 1);const compiled = transpileModule(`class View { ${methods.map(item => item.getText(source)).join("\n")} }globalThis.View = View;`, {compilerOptions: {target: ScriptTarget.ES2021}}).outputText;@@ -24,92 +24,34 @@ class PathFixture {quadraticCurveTo(...values: number[]) { this.commands.push(["quadratic", ...values]); }}-test("summary previews and committed paths match across styles, zoom levels and the legacy default", () => {+test("committed summary paths retain their shapes and hit testing across styles, zoom levels and the legacy default", () => {for (const connectorStyle of [undefined, ...LIST_MINDMAP_CONNECTOR_STYLES]) {for (const scale of [.5, 1, 2]) {- const sandbox: any = {Path2D: PathFixture, buildListMindmapSummaryConnector, layoutListMindmapSummaries, getListMindmapSummarySelection};+ const sandbox: any = {Path2D: PathFixture, buildListMindmapSummaryConnector};runInNewContext(compiled, sandbox);const view = new sandbox.View();const children = ["a", "b"].map((id): ListMindmapNode =>({id, parentId: "root", children: [], contentBlocks: [], virtual: false, collapsed: false}));const root: ListMindmapNode = {id: "root", children, contentBlocks: [], virtual: true, collapsed: false};- const range = {parentId: "root", nodeIds: ["a", "b"]};const model: ListMindmapModel = {list: undefined, root, nodes: new Map([root, ...children].map(node => [node.id, node])),- metadata: {version: 1, nodes: {}, relations: [], connectorStyle}};+ metadata: {version: 1, nodes: {}, relations: [], connectorStyle,+ summaries: [{parentId: "root", nodeIds: ["a", "b"], id: "summary", label: "Summary"}]}};const positions = new Map(children.map((node, index) =>[node.id, {id: node.id, x: 100, y: 40 + index * 80, width: 120, height: 50}]));- let selected = ["a"];- Object.assign(view, {model, positions, summaryPositions: new Map(), getSelectedIds: () => selected,- inspector: {hidden: false, getBoundingClientRect: () => ({left: 0, right: 0, top: 0, bottom: 0})},- summaryAction: {offsetWidth: 80, offsetHeight: 32, style: {}, setAttribute: () => {}},- label: (key: string) => key, offsetX: 0, offsetY: 0, getToolbarBounds: (): DOMRect[] => [],- viewport: {clientWidth: 600, clientHeight: 400, getBoundingClientRect: () => ({left: 0, top: 0, width: 600, height: 400})},- options: {}, scale, linePaths: [], summaryElements: new Map()});- const strokes: PathFixture[] = [];- const context = {save: () => {}, restore: () => {}, setLineDash: () => {},- stroke: (path: PathFixture) => strokes.push(path)};- view.drawSummaryPreview(context, "blue");- assert.equal(strokes.length, 0, "single selection does not draw a summary preview");- assert.equal(view.summaryAction.hidden, true);- selected = ["a", "b"];- view.drawSummaryPreview(context, "blue");- assert.equal(strokes.length, 1);- assert.equal(view.summaryAction.hidden, false);- const preview = strokes.pop();- Object.assign(model.metadata, {summaries: [{...range, id: "summary", label: "Summary"}]});- view.summaryPositions = layoutListMindmapSummaries(model, positions,- new Map([["summary", {width: 100, height: 40}]]));+ Object.assign(view, {model, options: {}, scale, linePaths: [], summaryElements: new Map(),+ summaryPositions: layoutListMindmapSummaries(model, positions, new Map([["summary", {width: 100, height: 40}]]))});view.summaryElements.set("summary", {style: {}, classList: {toggle: () => {}}, setAttribute: () => {}});+ const strokes: PathFixture[] = [];+ const context = {setLineDash: () => {}, stroke: (path: PathFixture) => strokes.push(path)};view.drawSummaries(context, () => ({color: "blue", width: 1.5}));assert.equal(strokes.length, 1);- assert.deepEqual(strokes[0].commands, preview.commands);assert.equal(view.linePaths[0].path, strokes[0], "hit testing uses the rendered shape");assert.deepEqual(strokes[0].commands, buildListMindmapSummaryConnector(view.summaryPositions.get("summary"), connectorStyle || "bezier", () => new PathFixture()).commands);- strokes.length = 0;- view.options.printLayout = true;- view.drawSummaryPreview(context, "blue");- assert.equal(strokes.length, 0, "creation previews are excluded from exports");- assert.equal(view.summaryAction.hidden, true, "creation controls are excluded from exports");}}});-test("graph summary actions follow canvas transforms, show the batch count and avoid visible controls", () => {- const sandbox: any = {};- runInNewContext(compiled, sandbox);- const view = new sandbox.View();- const attributes = new Map<string, string>();- const action = {hidden: true, offsetWidth: 80, offsetHeight: 32, textContent: "", style: {left: "", top: ""},- setAttribute: (key: string, value: string) => attributes.set(key, value)};- const position = {id: "preview", x: 276, labelX: 300, labelY: 150, top: 100, bottom: 200, width: 0, height: 0};- Object.assign(view, {summaryAction: action, viewport: {clientWidth: 600, clientHeight: 400,- getBoundingClientRect: () => ({left: 20, top: 30, width: 1200, height: 800})},- inspector: {hidden: true}, positions: new Map(), summaryPositions: new Map(), getToolbarBounds: (): DOMRect[] => [],- label: (key: string) => key === "listMindmapSummaryBatch" ? "Create ${count} summaries" : "Summary"});- for (const scale of [.5, 1, 1.5]) {- Object.assign(view, {scale, offsetX: 12, offsetY: 20});- view.positionSummaryAction([position], 1);- assert.equal(action.hidden, false);- assert.equal(action.textContent, "Summary");- assert.equal(parseFloat(action.style.left), 12 + position.labelX * scale);- assert.equal(parseFloat(action.style.top), 20 + (position.top + position.bottom) * scale / 2 - 16);- }- Object.assign(view, {scale: 1, offsetX: 0, offsetY: 0,- getToolbarBounds: () => [{left: 600, right: 900, top: 270, bottom: 410}]});- view.positionSummaryAction([position], 3);- assert.equal(action.textContent, "Create 3 summaries");- assert.equal(attributes.get("aria-label"), action.textContent);- assert.equal(parseFloat(action.style.top), 60, "a scaled toolbar moves the action above the selected range");- view.viewport.clientWidth = 240;- view.positionSummaryAction([position], 3);- assert.ok(parseFloat(action.style.left) >= 8);- assert.ok(parseFloat(action.style.left) + action.offsetWidth <= 232);- view.viewport.clientWidth = 40;- view.positionSummaryAction([position], 3);- assert.equal(action.hidden, true, "an action that cannot fit is not clipped into a misleading hit target");-});-const creation = declaration.members.find(item => item.name?.getText(source) === "createSummary");assert.ok(creation);const creationCode = transpileModule(`class View { ${creation.getText(source)} } globalThis.View = View;`,@@ -131,7 +73,7 @@ const create = () => {calls.push({ranges, expected});return addListMindmapSummaryRanges(model, ranges, () => "new", "Summary");}}, updateSelection: () => {}, selectSummary: (id: string) => { view.selectedSummary = id; },- editSummaryLabel: (id: string) => edited.push(id)});+ revealNode: () => {}, editSummaryLabel: (id: string) => edited.push(id)});return {view, model, calls, frames, edited, select: (ids: string[]) => selected = ids};};@@ -166,7 +108,7 @@ test("single, invalid, crossing, duplicate and read-only summary selections neve});test("pending summaries reject repeated activation and late results preserve a changed selection", async () => {- for (const outcome of ["success", "selection", "readonly", "destroyed", "failed", "rejected"]) {+ for (const outcome of ["success", "multiple", "selection", "readonly", "destroyed", "failed", "rejected"]) {const {view, select, frames, edited} = create();let resolve: (ids?: string[]) => void;let reject: (error: Error) => void;@@ -183,10 +125,10 @@ test("pending summaries reject repeated activation and late results preserve a cif (outcome === "readonly") { view.readOnly = true; }if (outcome === "destroyed") { view.destroyed = true; }if (outcome === "rejected") { reject(new Error("write failed")); }- else { resolve(outcome === "failed" ? undefined : ["new"]); }+ else { resolve(outcome === "failed" ? undefined : outcome === "multiple" ? ["new", "second"] : ["new"]); }await pending;frames.forEach(action => action());assert.equal(view.summaryPending, false);- assert.deepEqual(edited, outcome === "success" ? ["new"] : [], outcome);+ assert.deepEqual(edited, ["success", "multiple"].includes(outcome) ? ["new"] : [], outcome);}});diff --git a/app/src/protyle/render/listMindmap/view.ts b/app/src/protyle/render/listMindmap/view.tsindex 9e24381e97..046f3a7ea2 100644--- a/app/src/protyle/render/listMindmap/view.ts+++ b/app/src/protyle/render/listMindmap/view.ts@@ -137,8 +137,6 @@ export class ListMindmapView {private readonly relationElements = new Map<string, HTMLButtonElement>();private readonly summaryElements = new Map<string, HTMLDivElement>();private summaryPositions = new Map<string, ListMindmapSummaryPosition>();- private readonly summaryStatus = createElement("div", "mindmap-view__route-status");- private readonly summaryAction: HTMLButtonElement;private selectedSummary?: string;private summaryPending = false;private readonly selectionBox = createElement("div", "mindmap-view__selection-box");@@ -221,21 +219,14 @@ export class ListMindmapView {this.inspector = createElement("div", "mindmap-view__inspector");this.inspector.setAttribute("data-prevent-swipe", "true");this.inspector.hidden = true;- this.summaryAction = this.makeButton("listMindmapSummary", "", () => void this.createSummary());- this.summaryAction.className = "b3-button b3-button--outline mindmap-view__summary-action";- this.summaryAction.hidden = true;this.zoomLabel = createElement("span", "mindmap-view__zoom");- this.viewport.append(this.canvas, this.world, this.summaryAction);+ this.viewport.append(this.canvas, this.world);this.tooltip.hidden = true;this.tooltip.setAttribute("role", "tooltip");this.colorProbe.setAttribute("aria-hidden", "true");this.routeStatus.hidden = true;this.routeStatus.setAttribute("role", "status");options.host.append(this.toolbar, this.viewport, this.inspector, this.tooltip, this.colorProbe, this.routeStatus);- this.summaryStatus.hidden = true;- this.summaryStatus.setAttribute("role", "status");- this.summaryStatus.textContent = this.label("listMindmapSummaryConflict");- options.host.append(this.summaryStatus);this.selectionBox.hidden = true;this.viewport.append(this.selectionBox);this.createToolbar();@@ -401,8 +392,6 @@ export class ListMindmapView {private clearSelection() {this.inspector.hidden = true;- this.summaryStatus.hidden = true;- this.summaryAction.hidden = true;if (!this.selectedId && !this.selectedRelation && !this.selectedEdge && !this.relationFrom &&!this.selectedSummary) {return;@@ -487,8 +476,6 @@ export class ListMindmapView {this.interactionActive = value;this.options.host.classList.toggle("mindmap-view--active", value);if (!value) {- this.summaryStatus.hidden = true;- this.summaryAction.hidden = true;const selecting = !!this.relationFrom || this.multiSelect;const inspectorVisible = !this.inspector.hidden;this.multiSelect = false;@@ -525,8 +512,6 @@ export class ListMindmapView {const value = !!this.readOnly;this.finishSummaryEdit?.(false);this.multiSelect = false;- this.summaryStatus.hidden = true;- this.summaryAction.hidden = true;this.cancelPointer();this.relationFrom = undefined;this.inspector.hidden = true;@@ -549,7 +534,6 @@ export class ListMindmapView {}private createToolbar() {- this.buttons.set("summary", this.summaryAction);const controls = createElement("div", "mindmap-view__toolbar-group");const add = (id: string, key: string, icon: string, action: () => void, nodeAction = false) => {const button = this.makeButton(key, icon, action);@@ -596,6 +580,7 @@ export class ListMindmapView {this.updateSelection();});this.buttons.get("multiSelect").setAttribute("aria-pressed", String(this.multiSelect));+ add("summary", "listMindmapSummary", "iconGroups", () => void this.createSummary(), true);add("relation", "connect", "iconRoute", () => {this.setInteractionActive(true);this.setPanning(false);@@ -999,7 +984,7 @@ export class ListMindmapView {}public revealNode(id: string) {- const node = this.nodeElements.get(id);+ const node = this.nodeElements.get(id) || this.summaryElements.get(id);if (!node || node.hidden) {return;}@@ -1339,9 +1324,10 @@ export class ListMindmapView {this.updateSelection();try {const ids = await this.options.onSummaryBatchAdd(ranges, expected);- if (!this.destroyed && !this.readOnly && ids?.length === 1 &&+ if (!this.destroyed && !this.readOnly && ids?.length &&JSON.stringify(this.getSelectedIds()) === JSON.stringify(selected)) {this.selectSummary(ids[0]);+ this.revealNode(ids[0]);requestAnimationFrame(() => {if (!this.destroyed && this.selectedSummary === ids[0]) {this.editSummaryLabel(ids[0]);@@ -1437,92 +1423,6 @@ export class ListMindmapView {});}- private drawSummaryPreview(context: CanvasRenderingContext2D, color: string) {- if (this.readOnly || this.inspector.hidden || this.getSelectedIds().length < 2 ||- this.printTransform || this.options.printLayout) {- this.summaryAction.hidden = true;- return;- }- const {ranges, conflict} = getListMindmapSummarySelection(this.model, new Set(this.getSelectedIds()));- if (conflict || !ranges.length) {- this.summaryAction.hidden = true;- return;- }- const previews = ranges.map((range, index) => ({...range, id: `preview:${index}`, label: ""}));- const sizes = new Map([...this.summaryPositions].map(([id, position]) =>- [id, {width: position.width, height: position.height}]));- previews.forEach(preview => sizes.set(preview.id, {width: 0, height: 0}));- const model = {...this.model, metadata: {...this.model.metadata,- summaries: [...(this.model.metadata.summaries || []), ...previews]}};- const positions = layoutListMindmapSummaries(model, this.positions, sizes);- context.save();- context.strokeStyle = color;- context.lineWidth = 1.5 / this.scale;- context.setLineDash([4 / this.scale, 4 / this.scale]);- previews.forEach(preview => {- const position = positions.get(preview.id);- if (position) {- context.stroke(buildListMindmapSummaryConnector(position,- this.model.metadata.connectorStyle || "bezier", () => new Path2D()));- }- });- context.restore();- const anchor = ranges.findIndex(range => range.nodeIds.includes(this.selectedId));- const ordered = anchor < 1 ? previews : [previews[anchor], ...previews.filter((_preview, index) => index !== anchor)];- this.positionSummaryAction(ordered.map(preview => positions.get(preview.id)).filter(Boolean), ranges.length);- }-- private positionSummaryAction(positions: ListMindmapSummaryPosition[], count: number) {- const action = this.summaryAction;- const width = this.viewport.clientWidth;- const height = this.viewport.clientHeight;- if (!positions.length || width < 32 || height < 32) {- action.hidden = true;- return;- }- const label = count === 1 ? this.label("listMindmapSummary") :- this.label("listMindmapSummaryBatch").replace("${count}", String(count));- if (action.textContent !== label) {- action.textContent = label;- }- action.setAttribute("aria-label", label);- action.hidden = false;- const actionWidth = action.offsetWidth;- const actionHeight = action.offsetHeight;- if (actionWidth > width - 16 || actionHeight > height - 16) {- action.hidden = true;- return;- }- const viewport = this.viewport.getBoundingClientRect();- const scaleX = viewport.width / width || 1;- const scaleY = viewport.height / height || 1;- const controls = [...this.getToolbarBounds(), ...(!this.inspector.hidden ? [this.inspector.getBoundingClientRect()] : [])]- .map(rect => ({left: (rect.left - viewport.left) / scaleX, top: (rect.top - viewport.top) / scaleY,- right: (rect.right - viewport.left) / scaleX, bottom: (rect.bottom - viewport.top) / scaleY}));- const content = [...this.positions.values(), ...[...this.summaryPositions.values()].map(summary =>- ({x: summary.labelX, y: summary.labelY, width: summary.width, height: summary.height}))];- const nodes = content.map(node => ({left: this.offsetX + node.x * this.scale,- top: this.offsetY + node.y * this.scale, right: this.offsetX + (node.x + node.width) * this.scale,- bottom: this.offsetY + (node.y + node.height) * this.scale}));- const overlap = (x: number, y: number, rect: {left: number, top: number, right: number, bottom: number}) =>- Math.max(0, Math.min(x + actionWidth + 4, rect.right) - Math.max(x - 4, rect.left)) *- Math.max(0, Math.min(y + actionHeight + 4, rect.bottom) - Math.max(y - 4, rect.top));- const candidates = positions.flatMap(position => {- const x = this.offsetX + position.labelX * this.scale;- const top = this.offsetY + position.top * this.scale;- const bottom = this.offsetY + position.bottom * this.scale;- return [{x, y: (top + bottom - actionHeight) / 2}, {x, y: top - actionHeight - 8}, {x, y: bottom + 8}];- }).map(point => {- const x = Math.max(8, Math.min(width - actionWidth - 8, point.x));- const y = Math.max(8, Math.min(height - actionHeight - 8, point.y));- return {x, y, score: controls.reduce((sum, rect) => sum + overlap(x, y, rect), 0) * 1000 +- nodes.reduce((sum, rect) => sum + overlap(x, y, rect), 0)};- });- const best = candidates.reduce((best, point) => point.score < best.score ? point : best);- action.style.left = `${best.x}px`;- action.style.top = `${best.y}px`;- }-private updateRelations() {this.relationElements.forEach((element, id) => {if (!this.model.metadata.relations.some(relation => relation.id === id)) {@@ -2040,7 +1940,6 @@ export class ListMindmapView {this.drawRelationPreview(context, resolveColor(relationStyles[0].color, primary), relationStyles[0].width || 1.5);this.drawSummaries(context, (color, selected, hovered) =>resolveLineStyle(summaryStyles, color, undefined, defaultLine, selected, hovered));- this.drawSummaryPreview(context, primary);this.renderRouteControls();}@@ -2175,7 +2074,6 @@ export class ListMindmapView {}this.buttons.get("multiSelect")?.classList.toggle("block__icon--active", this.multiSelect);this.buttons.get("multiSelect")?.setAttribute("aria-pressed", String(this.multiSelect));- this.summaryStatus.hidden = !conflict || this.inspector.hidden;this.draw();}@@ -3534,7 +3432,7 @@ export class ListMindmapView {const remove = squareButton("delete", "iconTrashcan", () => this.deleteSelection());remove.disabled = ids.includes(this.model.root.id) ||this.model.root.virtual && this.model.root.children.every(node => ids.includes(node.id));- this.inspector.append(this.buttons.get("relation"), remove);+ this.inspector.append(this.buttons.get("relation"), this.buttons.get("summary"), remove);const change = (patch: Partial<ListMindmapNodeStyle>) => multiple ? this.options.onNodesStyle?.(ids, patch) :this.options.onNodeStyle?.(id, patch);const nodePalette = createElement("div", "mindmap-view__palette");diff --git a/app/src/protyle/render/listMindmap/viewportFocus.test.ts b/app/src/protyle/render/listMindmap/viewportFocus.test.tsindex 961e605b72..2915c9e6ee 100644--- a/app/src/protyle/render/listMindmap/viewportFocus.test.ts+++ b/app/src/protyle/render/listMindmap/viewportFocus.test.ts@@ -28,7 +28,7 @@ const setup = () => {selectedId: "new", tooltip: {}, inspector: {hidden: true},toolbar: {hidden: false, querySelectorAll: (): unknown[] => []},world: {querySelectorAll: (): HTMLElement[] => []},- nodeElements: new Map(), offsetX: 0, offsetY: 0,+ nodeElements: new Map(), summaryElements: new Map(), offsetX: 0, offsetY: 0,interactionActive: true, setInteractionActive: (value: boolean) => target.interactionActive = value,buttons: new Map(),viewport: {contains: (element: unknown) => !!element, setPointerCapture: () => {},@@ -82,6 +82,16 @@ test("focusing visible, missing or removed nodes does not pan", () => {assert.equal(drawn(), 0);});+test("new summary labels are revealed even though they are not source nodes", () => {+ const {target, drawn} = setup();+ target.summaryElements.set("summary", {getBoundingClientRect: () =>+ ({left: 420, top: 320, right: 500, bottom: 360, width: 80, height: 40})});+ target.revealNode("summary");+ assert.equal(target.offsetX, -116);+ assert.equal(target.offsetY, -76);+ assert.equal(drawn(), 1);+});+test("node focus avoids the actual bottom panel bounds after the pending layout", () => {for (const top of [250, 210]) {const {target, frames, drawn} = setup();