跳到內容

Mindmap 排序 anchors 與 layout

move_node 沒有 public index、position 或 sortKey。在 newParentId 下用 anchors 定位:beforeNodeId 表示緊接其後,afterNodeId 表示緊鄰其前。兩者同時提供時 siblings 必須相鄰;錯誤 parent 的 anchor 會 conflict;全省略則 append。Roots 共用 null-parent sibling band,獨立 root 建立或 detach 也 append 於此。

sortKey 是 server 管理的 20 位零填充數字字串,不得傳入。Rank 太密或異常時會 rebalance;response 的 siblingSortKeys 應覆蓋 client cache。get_mindmap 依 parent、sortKey、created time 排序。

每棵樹獨立 layout。Root anchor 是 manualOffset,null 為原點;非 root offset 仍相對且沿 descendants 級聯。layoutSide 僅接受 autoleftright,只適用於該 root 的 direct children;deep create 帶 side 會 invalid,搬到非 root 下會清除。manualOffset 的 finite components 必須介於 -100,000 與 100,000;null 清除。Detach 傳絕對 offset 並清 side;attach 傳 null 回自動 layout。Promote-delete Action 不能提供 child anchors,因此 root children 使用垂直 fallback;只有 v1 REST surface 接受明確 child anchors。Undo 會清除 promoted-root offsets。

Reparent 會先用 per-Mindmap server lock 序列化,再檢查 cycle 與 anchors。Client 不需自行加鎖;遇到 conflict 時,先重讀目前 forest 與 anchors,再判斷是否重試。

arinova.mindmap.get_mindmap, arinova.mindmap.add_node, arinova.mindmap.update_node, arinova.mindmap.move_node, arinova.mindmap.delete_node_promote_children

Also known as

節點重排, sibling anchors, layout side, manual offset, sort key


Machine-readable Markdown · Knowledge index

Build a7f47a5ca54ddcf7806cd48b81ce1b9827042766