@linxin666/dsh-client-ui-task-board 0.1.3 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +107 -101
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
- package/src/client/sidebar-entry.ts +20 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-client-ui-task-board",
|
|
3
3
|
"description": "Task board for the dsh web GUI: a sidebar entry plus a multi-column kanban view with local persistence, task details, and real execution through dsh sessions (session.prompt). Hot-pluggable — mounted via ~/.dsh/cordis.patch.yml + a profile node_modules symlink, no dsh source changes.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -92,26 +92,37 @@ export function mountSidebarEntry(controller: BoardController): () => void {
|
|
|
92
92
|
let placed = false
|
|
93
93
|
|
|
94
94
|
const tryPlace = (): void => {
|
|
95
|
-
if (placed) return
|
|
96
95
|
if (root !== undefined && !root.isConnected) {
|
|
97
|
-
// The shell
|
|
98
|
-
//
|
|
99
|
-
//
|
|
96
|
+
// The shell rebuilt the sidebar pane (whole-tree teardown); the root
|
|
97
|
+
// observer is gone with the old tree, so detach it and re-query from
|
|
98
|
+
// scratch. The new pane is later noticed by the body-level watcher.
|
|
99
|
+
rootObserver.disconnect()
|
|
100
100
|
root = undefined
|
|
101
|
+
placed = false
|
|
102
|
+
}
|
|
103
|
+
if (placed) {
|
|
104
|
+
// Cheap short-circuit: entry still lives in a mountable subtree.
|
|
105
|
+
if (document.body.contains(entry)) return
|
|
106
|
+
// Entry was torn down together with the old tree; reset and re-place.
|
|
107
|
+
rootObserver.disconnect()
|
|
108
|
+
root = undefined
|
|
109
|
+
placed = false
|
|
101
110
|
}
|
|
102
111
|
root ??= sidebarRoot()
|
|
103
112
|
if (root === undefined) return
|
|
104
113
|
placed = placeEntry(root, entry)
|
|
105
114
|
if (placed) {
|
|
106
115
|
rootObserver.observe(root, { childList: true, subtree: true })
|
|
107
|
-
// Placement done; the root observer alone keeps the entry healed.
|
|
108
|
-
// Disconnect the body-wide watcher so unrelated app mutations (e.g.
|
|
109
|
-
// chat streaming) no longer churn every plugin's self-heal loop.
|
|
110
|
-
waitObserver.disconnect()
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
118
|
|
|
114
|
-
//
|
|
119
|
+
// Body-level watcher retained as the "whole rebuild" fallback: when the shell
|
|
120
|
+
// tears down the whole sidebar pane, the root observer is gone with it and
|
|
121
|
+
// only this body observation can notice the new pane mounting. It is no
|
|
122
|
+
// longer disconnected after placement; the placed-and-still-mounted case
|
|
123
|
+
// short-circuits through the cheap document.body.contains(entry) check, so
|
|
124
|
+
// unrelated app mutations (e.g. chat streaming) cost one contains check
|
|
125
|
+
// instead of churning the full re-query.
|
|
115
126
|
const waitObserver = new MutationObserver(() => { tryPlace() })
|
|
116
127
|
waitObserver.observe(document.body, { childList: true, subtree: true })
|
|
117
128
|
|