@yolk_vat-y/dsh-project-memory 0.6.1 → 0.6.3
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/CHANGELOG.md +128 -3
- package/README.md +10 -10
- package/README.zh-CN.md +10 -10
- package/client/client.js +340 -50
- package/client/client.js.map +1 -1
- package/package.json +11 -8
- package/src/auto-inject.js +25 -1
- package/src/client/MemoryView.tsx +157 -44
- package/src/client/TaskCommandNode.tsx +1 -0
- package/src/client/TaskPanel.module.css +23 -0
- package/src/client/TaskPanel.tsx +13 -7
- package/src/client/locales.ts +10 -0
- package/src/client/paging.js +165 -0
- package/src/client/task-data-store.ts +33 -14
- package/src/client/task-scope.js +32 -0
- package/src/commands/insight-actions.js +90 -12
- package/src/commands/invocation.js +4 -1
- package/src/commands/task-actions.js +3 -2
- package/src/commands/tasks.js +5 -2
- package/src/index.js +10 -0
- package/src/insight-store.js +441 -35
- package/src/lazy.js +5 -3
- package/src/ops.js +13 -2
- package/src/recall.js +13 -8
- package/src/setup/taskbridge.js +9 -4
- package/src/store.js +86 -121
- package/src/tools/forget.js +46 -6
- package/src/tools/lesson-tools.js +21 -8
- package/src/tools/query-memory.js +16 -5
- package/src/tools/remember.js +30 -14
- package/src/tools/stats.js +5 -1
- package/src/types.js +8 -1
- package/src/util/fs.js +3 -1
- package/src/util/session-dir.js +48 -0
- package/src/vector-index.js +3 -2
package/client/client.js
CHANGED
|
@@ -144,6 +144,11 @@ window.__ModuleLoader__.load({
|
|
|
144
144
|
"mem.draft": "草稿",
|
|
145
145
|
"mem.archived": "已归档",
|
|
146
146
|
"mem.loading": "加载中…",
|
|
147
|
+
"mem.loadingMore": "加载中…",
|
|
148
|
+
"mem.loadMore": "加载更多",
|
|
149
|
+
"mem.progress": "已显示 {loaded} / {total}",
|
|
150
|
+
"mem.allLoaded": "已全部加载({total} 条)",
|
|
151
|
+
"mem.retry": "重试",
|
|
147
152
|
"mem.error": "同步失败",
|
|
148
153
|
"mem.kind.lesson": "坑",
|
|
149
154
|
"mem.kind.decision": "权衡",
|
|
@@ -224,6 +229,11 @@ window.__ModuleLoader__.load({
|
|
|
224
229
|
"mem.draft": "draft",
|
|
225
230
|
"mem.archived": "archived",
|
|
226
231
|
"mem.loading": "Loading…",
|
|
232
|
+
"mem.loadingMore": "Loading…",
|
|
233
|
+
"mem.loadMore": "Load more",
|
|
234
|
+
"mem.progress": "Showing {loaded} of {total}",
|
|
235
|
+
"mem.allLoaded": "All {total} loaded",
|
|
236
|
+
"mem.retry": "Retry",
|
|
227
237
|
"mem.error": "Sync failed",
|
|
228
238
|
"mem.kind.lesson": "lesson",
|
|
229
239
|
"mem.kind.decision": "decision",
|
|
@@ -369,6 +379,39 @@ window.__ModuleLoader__.load({
|
|
|
369
379
|
} catch {}
|
|
370
380
|
}
|
|
371
381
|
//#endregion
|
|
382
|
+
//#region src/client/task-scope.js
|
|
383
|
+
/**
|
|
384
|
+
* 跨标签页任务广播的**项目作用域**判定(纯函数,无 React / 无 BroadcastChannel 依赖)。
|
|
385
|
+
*
|
|
386
|
+
* 为什么需要它:同步频道名是固定的(同一浏览器同源的所有 dsh 页面共用一个
|
|
387
|
+
* `dsh-pm-tasks-data`),而消息体只带任务数组。没有作用域判定时,在 A 项目点一下刷新,
|
|
388
|
+
* B 项目的标签页面板就会被贴上 A 的任务列表——它自己保留着 B 的 `boundTaskId`,
|
|
389
|
+
* 于是表现为"绑定莫名丢了"。频道名不能按项目拆:项目根是数据到达后才知道的,
|
|
390
|
+
* 而 `new BroadcastChannel` 在模块加载期就要定名。
|
|
391
|
+
*
|
|
392
|
+
* 判据刻意**严格**:消息里没有根、或本页还没确定根,都不接受。
|
|
393
|
+
* - 无根:老宿主/老 bundle 的载荷,宁可不同步也不猜;
|
|
394
|
+
* - 本页未知根:它自己那一次 `/tasks` 会决定归属,不先借别人的数据(避免短暂显示错项目)。
|
|
395
|
+
* 两侧都已知且相等时才接受——这正是"同一项目的两个标签页"。
|
|
396
|
+
*
|
|
397
|
+
* @param {string|null|undefined} localRoot - 本页当前数据的项目根(未同步过为 null)
|
|
398
|
+
* @param {unknown} incomingRoot - 广播消息里的项目根
|
|
399
|
+
* @returns {boolean} true = 这条广播属于同一个项目,可以套用
|
|
400
|
+
*/
|
|
401
|
+
function broadcastAppliesTo(localRoot, incomingRoot) {
|
|
402
|
+
if (typeof incomingRoot !== "string" || incomingRoot === "") return false;
|
|
403
|
+
if (typeof localRoot !== "string" || localRoot === "") return false;
|
|
404
|
+
return localRoot === incomingRoot;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* 从 `/tasks` 载荷里取项目根(旧宿主没有该键)。
|
|
408
|
+
* @param {unknown} value - `payload.root`
|
|
409
|
+
* @returns {string|null} 非空字符串才算根
|
|
410
|
+
*/
|
|
411
|
+
function payloadRoot(value) {
|
|
412
|
+
return typeof value === "string" && value !== "" ? value : null;
|
|
413
|
+
}
|
|
414
|
+
//#endregion
|
|
372
415
|
//#region src/client/task-data-store.ts
|
|
373
416
|
/**
|
|
374
417
|
* Task Data Store — 仅管服务端同步的数据(tasks、boundTaskId、archivedCount)
|
|
@@ -391,7 +434,8 @@ window.__ModuleLoader__.load({
|
|
|
391
434
|
return {
|
|
392
435
|
tasks: data.tasks,
|
|
393
436
|
boundId: data.boundId ?? null,
|
|
394
|
-
archived: data.archived ?? 0
|
|
437
|
+
archived: data.archived ?? 0,
|
|
438
|
+
root: payloadRoot(data.root)
|
|
395
439
|
};
|
|
396
440
|
} catch {
|
|
397
441
|
return null;
|
|
@@ -402,6 +446,7 @@ window.__ModuleLoader__.load({
|
|
|
402
446
|
tasks: [],
|
|
403
447
|
boundTaskId: null,
|
|
404
448
|
archivedCount: 0,
|
|
449
|
+
root: null,
|
|
405
450
|
lastUpdate: 0
|
|
406
451
|
};
|
|
407
452
|
const dataListeners = /* @__PURE__ */ new Set();
|
|
@@ -411,31 +456,33 @@ window.__ModuleLoader__.load({
|
|
|
411
456
|
tasks: Array.isArray(patch?.tasks) ? patch.tasks : [],
|
|
412
457
|
boundTaskId: patch?.boundTaskId ?? null,
|
|
413
458
|
archivedCount: typeof patch?.archivedCount === "number" ? patch.archivedCount : 0,
|
|
459
|
+
root: payloadRoot(patch?.root),
|
|
414
460
|
lastUpdate: typeof patch?.lastUpdate === "number" ? patch.lastUpdate : 0
|
|
415
461
|
};
|
|
416
462
|
for (const listener of dataListeners) listener();
|
|
417
463
|
}
|
|
418
|
-
function broadcastDataUpdate(tasks, archivedCount) {
|
|
464
|
+
function broadcastDataUpdate(tasks, archivedCount, root) {
|
|
419
465
|
if (!SYNC_CHANNEL) return;
|
|
420
466
|
SYNC_CHANNEL.postMessage({
|
|
421
467
|
type: "PROJECT_TASKS_UPDATED",
|
|
422
468
|
payload: {
|
|
423
469
|
tasks: Array.isArray(tasks) ? tasks : [],
|
|
424
|
-
archivedCount
|
|
470
|
+
archivedCount,
|
|
471
|
+
root
|
|
425
472
|
}
|
|
426
473
|
});
|
|
427
474
|
}
|
|
428
475
|
if (SYNC_CHANNEL) SYNC_CHANNEL.onmessage = (event) => {
|
|
429
476
|
const msg = event.data;
|
|
430
|
-
if (msg?.type
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}
|
|
477
|
+
if (msg?.type !== "PROJECT_TASKS_UPDATED" || !msg.payload) return;
|
|
478
|
+
const { tasks, archivedCount, root } = msg.payload;
|
|
479
|
+
if (!broadcastAppliesTo(dataState.root, root)) return;
|
|
480
|
+
setDataState((prev) => ({
|
|
481
|
+
...prev,
|
|
482
|
+
tasks: Array.isArray(tasks) ? tasks : [],
|
|
483
|
+
archivedCount: typeof archivedCount === "number" ? archivedCount : prev.archivedCount,
|
|
484
|
+
lastUpdate: Date.now()
|
|
485
|
+
}));
|
|
439
486
|
};
|
|
440
487
|
const taskDataStore = {
|
|
441
488
|
subscribe(listener) {
|
|
@@ -451,19 +498,22 @@ window.__ModuleLoader__.load({
|
|
|
451
498
|
setTasks(payload) {
|
|
452
499
|
const nextTasks = payload.tasks || [];
|
|
453
500
|
const nextArchived = payload.archivedCount ?? 0;
|
|
501
|
+
const nextRoot = payloadRoot(payload.root);
|
|
454
502
|
setDataState({
|
|
455
503
|
tasks: nextTasks,
|
|
456
504
|
boundTaskId: payload.boundTaskId ?? null,
|
|
457
505
|
archivedCount: nextArchived,
|
|
506
|
+
root: nextRoot,
|
|
458
507
|
lastUpdate: Date.now()
|
|
459
508
|
});
|
|
460
|
-
broadcastDataUpdate(nextTasks, nextArchived);
|
|
509
|
+
broadcastDataUpdate(nextTasks, nextArchived, nextRoot);
|
|
461
510
|
},
|
|
462
511
|
reset() {
|
|
463
512
|
setDataState({
|
|
464
513
|
tasks: [],
|
|
465
514
|
boundTaskId: null,
|
|
466
515
|
archivedCount: 0,
|
|
516
|
+
root: null,
|
|
467
517
|
lastUpdate: 0
|
|
468
518
|
});
|
|
469
519
|
}
|
|
@@ -823,7 +873,7 @@ window.__ModuleLoader__.load({
|
|
|
823
873
|
}
|
|
824
874
|
//#endregion
|
|
825
875
|
//#region \0dsh-css:src/client/TaskPanel.module.css.mjs
|
|
826
|
-
const css$1 = ".vZSZnG_panel{pointer-events:auto;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l2,#7f7f7f4d);border-radius:14px;flex-direction:column;width:380px;max-width:calc(100vw - 24px);max-height:min(70vh,640px);font-family:inherit;animation:.18s ease-out vZSZnG_panelIn;display:flex;position:fixed;overflow:hidden;box-shadow:0 12px 32px #00000029,0 2px 8px #00000014}@keyframes vZSZnG_panelIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}.vZSZnG_dragHandle{cursor:grab;z-index:1;justify-content:center;align-items:center;height:12px;display:flex;position:absolute;top:0;left:0;right:0}.vZSZnG_dragHandle:active{cursor:grabbing}.vZSZnG_handleGrip{background:var(--dsw-alias-separator-primary,#7f7f7f59);opacity:.8;border-radius:2px;width:32px;height:3px}.vZSZnG_header{border-bottom:1px solid var(--dsw-alias-border-l1,#7f7f7f2e);-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 10px 8px 14px;display:flex}.vZSZnG_headerLeft{align-items:center;gap:6px;min-width:0;display:flex}.vZSZnG_headerIcon{color:var(--dsw-alias-label-secondary);flex:none}.vZSZnG_headerTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:13px;font-weight:600;line-height:20px}.vZSZnG_headerRight{align-items:center;gap:2px;margin-left:auto;display:flex}.vZSZnG_hintsOff{opacity:.45}.vZSZnG_hintsOff:hover{opacity:.75}.vZSZnG_counts{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:4px;font-size:11px;line-height:16px}.vZSZnG_boundBadge{color:var(--dsw-alias-label-primary-foreground,#fff);background:var(--dsw-alias-button-primary-fill,#3a6ef5);white-space:nowrap;border-radius:7px;flex:none;padding:0 6px;font-size:10px;line-height:14px}.vZSZnG_notice{color:var(--dsw-alias-state-warn-label,#b7791f);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);word-break:break-all;border-radius:8px;margin:8px 12px 0;padding:6px 10px;font-size:12px;line-height:18px}.vZSZnG_taskList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2,transparent) transparent;flex-direction:column;gap:6px;padding:8px;display:flex;overflow-y:auto}.vZSZnG_emptyState{text-align:center;color:var(--dsw-alias-label-secondary);padding:36px 24px 30px}.vZSZnG_emptyTitle{color:var(--dsw-alias-label-primary);margin:0 0 6px;font-size:13px;font-weight:600}.vZSZnG_emptyDesc{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:20px}.vZSZnG_syncHint{color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;gap:6px;margin:10px 0 0;font-size:11px;display:flex}.vZSZnG_card{border:1px solid var(--dsw-alias-border-l1,#7f7f7f29);background:var(--dsw-alias-bg-base,transparent);border-radius:10px;transition:border-color .15s;overflow:hidden}.vZSZnG_cardBound{border-color:var(--dsw-alias-border-l3,#7f7f7f59);box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l3,transparent)}.vZSZnG_cardHead{cursor:pointer;text-align:left;background:0 0;border:none;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:8px 10px 7px;display:flex}.vZSZnG_cardHead:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_cardTitleRow{align-items:center;gap:6px;min-width:0;display:flex}.vZSZnG_cardTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.vZSZnG_cardMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;display:flex}.vZSZnG_progressText{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.vZSZnG_updated{color:var(--dsw-alias-label-dimmed);font-size:10px;line-height:14px}.vZSZnG_chevron{color:var(--dsw-alias-label-tertiary);display:inline-flex}.vZSZnG_track{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f);border-radius:1px;height:2px;margin:0 10px 6px;overflow:hidden}.vZSZnG_trackFill{background:var(--dsw-alias-label-primary-bluish,var(--dsw-alias-button-primary-fill,#3a6ef5));border-radius:1px;height:100%;transition:width .2s}.vZSZnG_cardBody{border-top:1px solid var(--dsw-alias-border-l1,#7f7f7f24);overscroll-behavior:contain;max-height:300px;padding:8px 10px 10px;overflow-y:auto}.vZSZnG_section{margin-bottom:8px}.vZSZnG_section:last-child{margin-bottom:0}.vZSZnG_sectionLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;line-height:16px;display:flex}.vZSZnG_sectionCount{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);color:var(--dsw-alias-label-tertiary);border-radius:6px;padding:0 5px;font-size:10px;line-height:14px}.vZSZnG_stepsList{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.vZSZnG_stepRow{align-items:flex-start;gap:7px;padding:3px 2px;display:flex}.vZSZnG_stepRow>svg{flex:none;margin-top:2px}.vZSZnG_stepDone{color:var(--dsw-alias-label-dimmed)}.vZSZnG_stepRun{color:var(--dsw-alias-label-primary-bluish,#3a6ef5)}.vZSZnG_stepPending{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:8px;height:8px;margin:5px 3px}.vZSZnG_stepContent{color:var(--dsw-alias-label-secondary);word-break:break-word;white-space:pre-wrap;font-size:12px;line-height:20px}.vZSZnG_stepContentDone{color:var(--dsw-alias-label-dimmed);text-decoration:line-through}.vZSZnG_stepContentRun{color:var(--dsw-alias-label-primary)}.vZSZnG_muted{color:var(--dsw-alias-label-dimmed);font-size:11px;line-height:18px}.vZSZnG_filesList{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.vZSZnG_fileRow{cursor:pointer;text-align:left;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;width:100%;padding:3px 4px;display:flex}.vZSZnG_fileRow:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_fileDot{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:5px;height:5px}.vZSZnG_filePath{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;text-align:left;direction:rtl;font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-size:11px;line-height:18px;overflow:hidden}.vZSZnG_fileLine{color:var(--dsw-alias-label-dimmed);flex:none;font-size:10px;line-height:18px}.vZSZnG_cardFooter{gap:6px;margin-top:8px;display:flex}@media (prefers-reduced-motion:reduce){.vZSZnG_panel{animation:none}.vZSZnG_trackFill,.vZSZnG_card{transition:none}}.vZSZnG_miniBar{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));max-width:min(46vw,340px);height:34px;color:var(--dsw-alias-label-primary);cursor:grab;-webkit-user-select:none;user-select:none;pointer-events:auto;border-radius:999px;align-items:center;gap:7px;padding:0 12px;font-size:12px;line-height:18px;transition:background .15s,border-color .15s;display:inline-flex;position:fixed;box-shadow:0 6px 20px #00000024,0 1px 4px #00000014}.vZSZnG_miniBar:active{cursor:grabbing}.vZSZnG_miniBar:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_miniIcon{color:var(--dsw-alias-label-secondary);flex:none}.vZSZnG_miniText{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.vZSZnG_miniChevron{color:var(--dsw-alias-label-tertiary);flex:none}.vZSZnG_taskList{flex:auto;min-height:0}.vZSZnG_card{flex-direction:column;display:flex}.vZSZnG_boundaryFallback{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,#fff);color:var(--dsw-alias-label-secondary);cursor:pointer;pointer-events:auto;border-radius:999px;padding:4px 10px;font-size:12px;line-height:18px;position:fixed;top:64px;right:16px}.vZSZnG_stepToggle{cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;align-items:center;margin-top:2px;padding:0;display:inline-flex}.vZSZnG_stepToggle:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.vZSZnG_stepToggle:disabled{cursor:default;opacity:.5}.vZSZnG_stepEditable{cursor:text;border-radius:3px}.vZSZnG_stepEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.vZSZnG_stepInput{box-sizing:border-box;width:auto;min-width:0;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);border-radius:5px;flex:auto;padding:0 5px;font-size:12px;line-height:20px}.vZSZnG_editorArea{box-sizing:border-box;min-width:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);resize:none;vertical-align:middle;cursor:text;white-space:pre-wrap;word-break:break-word;border-radius:5px;flex:1;margin:0;padding:2px 5px;font-family:inherit;font-size:12px;line-height:20px;overflow:hidden}.vZSZnG_editorArea:focus{border-color:var(--dsw-alias-border-l3,#7f7f7f99);outline:none}.vZSZnG_stepDragging{opacity:.3;background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_cardTitleEditable{cursor:text;border-radius:3px}.vZSZnG_cardTitleEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2,#fff) 90%, transparent);-webkit-backdrop-filter:blur(18px)saturate(1.2);border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2,#7f7f7f4d) 80%, transparent)}.vZSZnG_panel[data-theme=glass] .vZSZnG_card{background:color-mix(in srgb, var(--dsw-alias-bg-base,transparent) 84%, transparent);border-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f29) 60%, transparent)}.vZSZnG_panel[data-theme=glass] .vZSZnG_cardBody{border-top-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f24) 60%, transparent)}@media (prefers-reduced-transparency:reduce){.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff);-webkit-backdrop-filter:none;backdrop-filter:none}.vZSZnG_panel[data-theme=glass] .vZSZnG_card{background:var(--dsw-alias-bg-base,transparent)}}@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff)}}.vZSZnG_panel[data-theme=brutal]{box-shadow:none;border-width:1px;border-radius:6px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_card{border:1px solid var(--dsw-alias-border-l3,#7f7f7f6b);background:var(--dsw-alias-bg-base,transparent);box-shadow:none;border-radius:3px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardHead{padding:7px 10px 6px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardTitle{letter-spacing:.01em;font-weight:650}.vZSZnG_panel[data-theme=brutal] .vZSZnG_headerTitle{letter-spacing:.03em}.vZSZnG_panel[data-theme=brutal] .vZSZnG_boundBadge{border-radius:2px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_track{border-radius:0;height:3px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_trackFill{border-radius:0}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardBody{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f3d)}.vZSZnG_panel[data-theme=mono] .vZSZnG_headerTitle,.vZSZnG_panel[data-theme=mono] .vZSZnG_counts,.vZSZnG_panel[data-theme=mono] .vZSZnG_cardTitle,.vZSZnG_panel[data-theme=mono] .vZSZnG_progressText,.vZSZnG_panel[data-theme=mono] .vZSZnG_stepContent,.vZSZnG_panel[data-theme=mono] .vZSZnG_filePath{font-family:ui-monospace,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.vZSZnG_panel[data-theme=mono] .vZSZnG_cardTitle{font-size:12px}.vZSZnG_panel[data-theme=mono] .vZSZnG_stepContent{font-size:11.5px}.vZSZnG_panel[data-theme=mono] .vZSZnG_card{border-radius:5px}.vZSZnG_panel[data-theme=mono] .vZSZnG_trackFill{border-radius:0}.vZSZnG_panel[data-theme=mono] .vZSZnG_stepPending{border-radius:1px}.vZSZnG_panel[data-theme=mono] .vZSZnG_updated{letter-spacing:.02em}.vZSZnG_headerIconBtn{color:inherit;cursor:pointer;background:0 0;border:none;border-radius:0;flex:none;justify-content:center;align-items:center;margin:0;padding:0;display:inline-flex}.vZSZnG_headerIcon{color:var(--dsw-alias-label-secondary);flex:none;display:block}.vZSZnG_headerLeft{min-width:0}.vZSZnG_headerTitle{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.vZSZnG_headerRight{min-width:0}.vZSZnG_counts{text-overflow:ellipsis;flex:none;max-width:45%;margin-left:auto;overflow:hidden}.vZSZnG_dragGhost{pointer-events:none;z-index:9999;transition:left 50ms,top 50ms;position:fixed;transform:translate(-50%,-50%)}.vZSZnG_dragGhostCard{background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l3,#7f7f7f59);color:var(--dsw-alias-label-primary);white-space:nowrap;border-radius:8px;align-items:center;gap:8px;max-width:280px;padding:8px 12px;font-size:12px;line-height:20px;display:inline-flex;transform:scale(.9);box-shadow:0 8px 24px #0000002e,0 2px 8px #0000001a}.vZSZnG_dragGhostContent{text-overflow:ellipsis;word-break:break-word;flex:1;min-width:0;overflow:hidden}.vZSZnG_dragGhostClose{width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;opacity:.6;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:8px;font-size:16px;line-height:1;transition:opacity .15s,background .15s,color .15s;display:inline-flex}.vZSZnG_dragGhostClose:hover{opacity:1;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.vZSZnG_dropTargetBefore{position:relative}.vZSZnG_dropTargetBefore:before{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite vZSZnG_dropPulse;position:absolute;top:-1px;left:0;right:0}.vZSZnG_dropTargetAfter{position:relative}.vZSZnG_dropTargetAfter:after{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite vZSZnG_dropPulse;position:absolute;bottom:-1px;left:0;right:0}@keyframes vZSZnG_dropPulse{0%,to{opacity:.6}50%{opacity:1}}.vZSZnG_memoryPane{flex-direction:column;gap:6px;max-height:480px;padding:8px 10px 10px;display:flex;overflow:auto}.vZSZnG_memToolbar{justify-content:space-between;align-items:center;gap:8px;display:flex}.vZSZnG_memCount{opacity:.75;font-size:12px;font-weight:600}.vZSZnG_memList{flex-direction:column;gap:6px;display:flex}.vZSZnG_memRow{border:1px solid var(--dsw-border-weak,#80808040);background:color-mix(in srgb, var(--dsw-bg-secondary,#f5f5f5) 45%, transparent);border-radius:6px;flex-direction:column;gap:4px;padding:6px 8px;display:flex}.vZSZnG_memRowArchived{opacity:.55}.vZSZnG_memRowMain{flex-direction:column;gap:2px;display:flex}.vZSZnG_memTitle{word-break:break-word;align-items:flex-start;gap:6px;font-size:13px;line-height:1.35;display:flex}.vZSZnG_kindBadge{background:var(--dsw-accent-soft,#5078ff26);color:var(--dsw-accent,#4d6bfe);border-radius:4px;flex:none;padding:0 5px;font-size:11px;line-height:1.5}.vZSZnG_memMeta{flex-wrap:wrap;align-items:center;gap:4px;display:flex}.vZSZnG_badge{background:color-mix(in srgb, var(--dsw-fg,#222) 8%, transparent);border-radius:4px;padding:0 5px;font-size:11px;line-height:1.5}.vZSZnG_badgeDraft{color:#b26a00;background:#ffb40029}.vZSZnG_badgeArchived{opacity:.8}.vZSZnG_memBody{opacity:.8;word-break:break-word;font-size:12px}.vZSZnG_memActs{flex-wrap:wrap;gap:4px;display:flex}.vZSZnG_memToolbarActs{align-items:center;gap:6px;display:flex}.vZSZnG_memNew{border:1px solid var(--dsw-border-weak,#80808040);border-radius:6px;flex-direction:column;gap:6px;padding:8px;display:flex}.vZSZnG_memNewRow{align-items:center;gap:8px;display:flex}.vZSZnG_memLabel{opacity:.8;align-items:center;gap:6px;font-size:12px;display:inline-flex}.vZSZnG_memNew select,.vZSZnG_memNew textarea{box-sizing:border-box;width:100%}";
|
|
876
|
+
const css$1 = ".vZSZnG_panel{pointer-events:auto;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l2,#7f7f7f4d);border-radius:14px;flex-direction:column;width:380px;max-width:calc(100vw - 24px);max-height:min(70vh,640px);font-family:inherit;animation:.18s ease-out vZSZnG_panelIn;display:flex;position:fixed;overflow:hidden;box-shadow:0 12px 32px #00000029,0 2px 8px #00000014}@keyframes vZSZnG_panelIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}.vZSZnG_dragHandle{cursor:grab;z-index:1;justify-content:center;align-items:center;height:12px;display:flex;position:absolute;top:0;left:0;right:0}.vZSZnG_dragHandle:active{cursor:grabbing}.vZSZnG_handleGrip{background:var(--dsw-alias-separator-primary,#7f7f7f59);opacity:.8;border-radius:2px;width:32px;height:3px}.vZSZnG_header{border-bottom:1px solid var(--dsw-alias-border-l1,#7f7f7f2e);-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 10px 8px 14px;display:flex}.vZSZnG_headerLeft{align-items:center;gap:6px;min-width:0;display:flex}.vZSZnG_headerIcon{color:var(--dsw-alias-label-secondary);flex:none}.vZSZnG_headerTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:13px;font-weight:600;line-height:20px}.vZSZnG_headerRight{align-items:center;gap:2px;margin-left:auto;display:flex}.vZSZnG_hintsOff{opacity:.45}.vZSZnG_hintsOff:hover{opacity:.75}.vZSZnG_counts{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:4px;font-size:11px;line-height:16px}.vZSZnG_boundBadge{color:var(--dsw-alias-label-primary-foreground,#fff);background:var(--dsw-alias-button-primary-fill,#3a6ef5);white-space:nowrap;border-radius:7px;flex:none;padding:0 6px;font-size:10px;line-height:14px}.vZSZnG_notice{color:var(--dsw-alias-state-warn-label,#b7791f);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);word-break:break-all;border-radius:8px;margin:8px 12px 0;padding:6px 10px;font-size:12px;line-height:18px}.vZSZnG_taskList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2,transparent) transparent;flex-direction:column;gap:6px;padding:8px;display:flex;overflow-y:auto}.vZSZnG_emptyState{text-align:center;color:var(--dsw-alias-label-secondary);padding:36px 24px 30px}.vZSZnG_emptyTitle{color:var(--dsw-alias-label-primary);margin:0 0 6px;font-size:13px;font-weight:600}.vZSZnG_emptyDesc{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:20px}.vZSZnG_syncHint{color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;gap:6px;margin:10px 0 0;font-size:11px;display:flex}.vZSZnG_card{border:1px solid var(--dsw-alias-border-l1,#7f7f7f29);background:var(--dsw-alias-bg-base,transparent);content-visibility:auto;contain-intrinsic-size:auto 140px;border-radius:10px;transition:border-color .15s;overflow:hidden}.vZSZnG_cardBound{border-color:var(--dsw-alias-border-l3,#7f7f7f59);box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l3,transparent)}.vZSZnG_cardHead{cursor:pointer;text-align:left;background:0 0;border:none;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:8px 10px 7px;display:flex}.vZSZnG_cardHead:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_cardTitleRow{align-items:center;gap:6px;min-width:0;display:flex}.vZSZnG_cardTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.vZSZnG_cardMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;display:flex}.vZSZnG_progressText{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.vZSZnG_updated{color:var(--dsw-alias-label-dimmed);font-size:10px;line-height:14px}.vZSZnG_chevron{color:var(--dsw-alias-label-tertiary);display:inline-flex}.vZSZnG_track{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f);border-radius:1px;height:2px;margin:0 10px 6px;overflow:hidden}.vZSZnG_trackFill{background:var(--dsw-alias-label-primary-bluish,var(--dsw-alias-button-primary-fill,#3a6ef5));border-radius:1px;height:100%;transition:width .2s}.vZSZnG_cardBody{border-top:1px solid var(--dsw-alias-border-l1,#7f7f7f24);overscroll-behavior:contain;max-height:300px;padding:8px 10px 10px;overflow-y:auto}.vZSZnG_section{margin-bottom:8px}.vZSZnG_section:last-child{margin-bottom:0}.vZSZnG_sectionLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;line-height:16px;display:flex}.vZSZnG_sectionCount{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);color:var(--dsw-alias-label-tertiary);border-radius:6px;padding:0 5px;font-size:10px;line-height:14px}.vZSZnG_stepsList{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.vZSZnG_stepRow{align-items:flex-start;gap:7px;padding:3px 2px;display:flex}.vZSZnG_stepRow>svg{flex:none;margin-top:2px}.vZSZnG_stepDone{color:var(--dsw-alias-label-dimmed)}.vZSZnG_stepRun{color:var(--dsw-alias-label-primary-bluish,#3a6ef5)}.vZSZnG_stepPending{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:8px;height:8px;margin:5px 3px}.vZSZnG_stepContent{color:var(--dsw-alias-label-secondary);word-break:break-word;white-space:pre-wrap;font-size:12px;line-height:20px}.vZSZnG_stepContentDone{color:var(--dsw-alias-label-dimmed);text-decoration:line-through}.vZSZnG_stepContentRun{color:var(--dsw-alias-label-primary)}.vZSZnG_muted{color:var(--dsw-alias-label-dimmed);font-size:11px;line-height:18px}.vZSZnG_filesList{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.vZSZnG_fileRow{cursor:pointer;text-align:left;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;width:100%;padding:3px 4px;display:flex}.vZSZnG_fileRow:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_fileDot{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:5px;height:5px}.vZSZnG_filePath{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;text-align:left;direction:rtl;font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-size:11px;line-height:18px;overflow:hidden}.vZSZnG_fileLine{color:var(--dsw-alias-label-dimmed);flex:none;font-size:10px;line-height:18px}.vZSZnG_cardFooter{gap:6px;margin-top:8px;display:flex}@media (prefers-reduced-motion:reduce){.vZSZnG_panel{animation:none}.vZSZnG_trackFill,.vZSZnG_card{transition:none}}.vZSZnG_miniBar{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));max-width:min(46vw,340px);height:34px;color:var(--dsw-alias-label-primary);cursor:grab;-webkit-user-select:none;user-select:none;pointer-events:auto;border-radius:999px;align-items:center;gap:7px;padding:0 12px;font-size:12px;line-height:18px;transition:background .15s,border-color .15s;display:inline-flex;position:fixed;box-shadow:0 6px 20px #00000024,0 1px 4px #00000014}.vZSZnG_miniBar:active{cursor:grabbing}.vZSZnG_miniBar:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_miniIcon{color:var(--dsw-alias-label-secondary);flex:none}.vZSZnG_miniText{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.vZSZnG_miniChevron{color:var(--dsw-alias-label-tertiary);flex:none}.vZSZnG_taskList{flex:auto;min-height:0}.vZSZnG_card{flex-direction:column;display:flex}.vZSZnG_boundaryFallback{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,#fff);color:var(--dsw-alias-label-secondary);cursor:pointer;pointer-events:auto;border-radius:999px;padding:4px 10px;font-size:12px;line-height:18px;position:fixed;top:64px;right:16px}.vZSZnG_stepToggle{cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;align-items:center;margin-top:2px;padding:0;display:inline-flex}.vZSZnG_stepToggle:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.vZSZnG_stepToggle:disabled{cursor:default;opacity:.5}.vZSZnG_stepEditable{cursor:text;border-radius:3px}.vZSZnG_stepEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.vZSZnG_stepInput{box-sizing:border-box;width:auto;min-width:0;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);border-radius:5px;flex:auto;padding:0 5px;font-size:12px;line-height:20px}.vZSZnG_editorArea{box-sizing:border-box;min-width:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);resize:none;vertical-align:middle;cursor:text;white-space:pre-wrap;word-break:break-word;border-radius:5px;flex:1;margin:0;padding:2px 5px;font-family:inherit;font-size:12px;line-height:20px;overflow:hidden}.vZSZnG_editorArea:focus{border-color:var(--dsw-alias-border-l3,#7f7f7f99);outline:none}.vZSZnG_stepDragging{opacity:.3;background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_cardTitleEditable{cursor:text;border-radius:3px}.vZSZnG_cardTitleEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2,#fff) 90%, transparent);-webkit-backdrop-filter:blur(18px)saturate(1.2);border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2,#7f7f7f4d) 80%, transparent)}.vZSZnG_panel[data-theme=glass] .vZSZnG_card{background:color-mix(in srgb, var(--dsw-alias-bg-base,transparent) 84%, transparent);border-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f29) 60%, transparent)}.vZSZnG_panel[data-theme=glass] .vZSZnG_cardBody{border-top-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f24) 60%, transparent)}@media (prefers-reduced-transparency:reduce){.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff);-webkit-backdrop-filter:none;backdrop-filter:none}.vZSZnG_panel[data-theme=glass] .vZSZnG_card{background:var(--dsw-alias-bg-base,transparent)}}@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff)}}.vZSZnG_panel[data-theme=brutal]{box-shadow:none;border-width:1px;border-radius:6px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_card{border:1px solid var(--dsw-alias-border-l3,#7f7f7f6b);background:var(--dsw-alias-bg-base,transparent);box-shadow:none;border-radius:3px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardHead{padding:7px 10px 6px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardTitle{letter-spacing:.01em;font-weight:650}.vZSZnG_panel[data-theme=brutal] .vZSZnG_headerTitle{letter-spacing:.03em}.vZSZnG_panel[data-theme=brutal] .vZSZnG_boundBadge{border-radius:2px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_track{border-radius:0;height:3px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_trackFill{border-radius:0}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardBody{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f3d)}.vZSZnG_panel[data-theme=mono] .vZSZnG_headerTitle,.vZSZnG_panel[data-theme=mono] .vZSZnG_counts,.vZSZnG_panel[data-theme=mono] .vZSZnG_cardTitle,.vZSZnG_panel[data-theme=mono] .vZSZnG_progressText,.vZSZnG_panel[data-theme=mono] .vZSZnG_stepContent,.vZSZnG_panel[data-theme=mono] .vZSZnG_filePath{font-family:ui-monospace,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.vZSZnG_panel[data-theme=mono] .vZSZnG_cardTitle{font-size:12px}.vZSZnG_panel[data-theme=mono] .vZSZnG_stepContent{font-size:11.5px}.vZSZnG_panel[data-theme=mono] .vZSZnG_card{border-radius:5px}.vZSZnG_panel[data-theme=mono] .vZSZnG_trackFill{border-radius:0}.vZSZnG_panel[data-theme=mono] .vZSZnG_stepPending{border-radius:1px}.vZSZnG_panel[data-theme=mono] .vZSZnG_updated{letter-spacing:.02em}.vZSZnG_headerIconBtn{color:inherit;cursor:pointer;background:0 0;border:none;border-radius:0;flex:none;justify-content:center;align-items:center;margin:0;padding:0;display:inline-flex}.vZSZnG_headerIcon{color:var(--dsw-alias-label-secondary);flex:none;display:block}.vZSZnG_headerLeft{min-width:0}.vZSZnG_headerTitle{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.vZSZnG_headerRight{min-width:0}.vZSZnG_counts{text-overflow:ellipsis;flex:none;max-width:45%;margin-left:auto;overflow:hidden}.vZSZnG_dragGhost{pointer-events:none;z-index:9999;transition:left 50ms,top 50ms;position:fixed;transform:translate(-50%,-50%)}.vZSZnG_dragGhostCard{background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l3,#7f7f7f59);color:var(--dsw-alias-label-primary);white-space:nowrap;border-radius:8px;align-items:center;gap:8px;max-width:280px;padding:8px 12px;font-size:12px;line-height:20px;display:inline-flex;transform:scale(.9);box-shadow:0 8px 24px #0000002e,0 2px 8px #0000001a}.vZSZnG_dragGhostContent{text-overflow:ellipsis;word-break:break-word;flex:1;min-width:0;overflow:hidden}.vZSZnG_dragGhostClose{width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;opacity:.6;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:8px;font-size:16px;line-height:1;transition:opacity .15s,background .15s,color .15s;display:inline-flex}.vZSZnG_dragGhostClose:hover{opacity:1;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.vZSZnG_dropTargetBefore{position:relative}.vZSZnG_dropTargetBefore:before{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite vZSZnG_dropPulse;position:absolute;top:-1px;left:0;right:0}.vZSZnG_dropTargetAfter{position:relative}.vZSZnG_dropTargetAfter:after{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite vZSZnG_dropPulse;position:absolute;bottom:-1px;left:0;right:0}@keyframes vZSZnG_dropPulse{0%,to{opacity:.6}50%{opacity:1}}.vZSZnG_memoryPane{flex-direction:column;gap:6px;max-height:480px;padding:8px 10px 10px;display:flex;overflow:auto}.vZSZnG_memToolbar{justify-content:space-between;align-items:center;gap:8px;display:flex}.vZSZnG_memCount{opacity:.75;font-size:12px;font-weight:600}.vZSZnG_memList{flex-direction:column;gap:6px;display:flex}.vZSZnG_memSentinel{flex:none;height:1px}.vZSZnG_memFooter{flex-direction:column;align-items:center;gap:4px;padding:6px 0 2px;font-size:12px;display:flex}.vZSZnG_memRow{border:1px solid var(--dsw-border-weak,#80808040);background:color-mix(in srgb, var(--dsw-bg-secondary,#f5f5f5) 45%, transparent);content-visibility:auto;contain-intrinsic-size:auto 76px;border-radius:6px;flex-direction:column;gap:4px;padding:6px 8px;display:flex}.vZSZnG_memRowArchived{opacity:.55}.vZSZnG_memRowMain{flex-direction:column;gap:2px;display:flex}.vZSZnG_memTitle{word-break:break-word;align-items:flex-start;gap:6px;font-size:13px;line-height:1.35;display:flex}.vZSZnG_kindBadge{background:var(--dsw-accent-soft,#5078ff26);color:var(--dsw-accent,#4d6bfe);border-radius:4px;flex:none;padding:0 5px;font-size:11px;line-height:1.5}.vZSZnG_memMeta{flex-wrap:wrap;align-items:center;gap:4px;display:flex}.vZSZnG_badge{background:color-mix(in srgb, var(--dsw-fg,#222) 8%, transparent);border-radius:4px;padding:0 5px;font-size:11px;line-height:1.5}.vZSZnG_badgeDraft{color:#b26a00;background:#ffb40029}.vZSZnG_badgeArchived{opacity:.8}.vZSZnG_memBody{opacity:.8;word-break:break-word;font-size:12px}.vZSZnG_memActs{flex-wrap:wrap;gap:4px;display:flex}.vZSZnG_memToolbarActs{align-items:center;gap:6px;display:flex}.vZSZnG_memNew{border:1px solid var(--dsw-border-weak,#80808040);border-radius:6px;flex-direction:column;gap:6px;padding:8px;display:flex}.vZSZnG_memNewRow{align-items:center;gap:8px;display:flex}.vZSZnG_memLabel{opacity:.8;align-items:center;gap:6px;font-size:12px;display:inline-flex}.vZSZnG_memNew select,.vZSZnG_memNew textarea{box-sizing:border-box;width:100%}";
|
|
827
877
|
const tagId$1 = "@yolk_vat-y/dsh-project-memory/TaskPanel.module.css";
|
|
828
878
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
829
879
|
const tag = document.createElement("style");
|
|
@@ -878,6 +928,7 @@ window.__ModuleLoader__.load({
|
|
|
878
928
|
"memActs": "vZSZnG_memActs",
|
|
879
929
|
"memBody": "vZSZnG_memBody",
|
|
880
930
|
"memCount": "vZSZnG_memCount",
|
|
931
|
+
"memFooter": "vZSZnG_memFooter",
|
|
881
932
|
"memLabel": "vZSZnG_memLabel",
|
|
882
933
|
"memList": "vZSZnG_memList",
|
|
883
934
|
"memMeta": "vZSZnG_memMeta",
|
|
@@ -886,6 +937,7 @@ window.__ModuleLoader__.load({
|
|
|
886
937
|
"memRow": "vZSZnG_memRow",
|
|
887
938
|
"memRowArchived": "vZSZnG_memRowArchived",
|
|
888
939
|
"memRowMain": "vZSZnG_memRowMain",
|
|
940
|
+
"memSentinel": "vZSZnG_memSentinel",
|
|
889
941
|
"memTitle": "vZSZnG_memTitle",
|
|
890
942
|
"memToolbar": "vZSZnG_memToolbar",
|
|
891
943
|
"memToolbarActs": "vZSZnG_memToolbarActs",
|
|
@@ -1373,12 +1425,147 @@ window.__ModuleLoader__.load({
|
|
|
1373
1425
|
]
|
|
1374
1426
|
});
|
|
1375
1427
|
}
|
|
1428
|
+
/**
|
|
1429
|
+
* 预取提前量:哨兵进入视口**下方 600px** 就开始取下一页,
|
|
1430
|
+
* 让用户在真正滚到底之前数据已经到位——这是"无感"的来源,不是滚到底再转圈。
|
|
1431
|
+
*/
|
|
1432
|
+
const PREFETCH_MARGIN = "600px 0px";
|
|
1433
|
+
/**
|
|
1434
|
+
* 拼一页的请求命令行。数据通道是命令文本,协议只在这里拼一次。
|
|
1435
|
+
* @param {string} scope - `task` | `project` | `global`。
|
|
1436
|
+
* @param {number} offset - 起始下标。
|
|
1437
|
+
* @param {number} limit - 本页条数。
|
|
1438
|
+
* @returns {string} 可直接交给 remote.commands.execute 的命令行。
|
|
1439
|
+
*/
|
|
1440
|
+
function insightListLine(scope, offset, limit) {
|
|
1441
|
+
return `/tasks insight list ${scope} ${offset} ${limit}`;
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* 追加一页并**按 id 去重**。去重是必需的不是防御性的:前缀重放(见
|
|
1445
|
+
* {@link reloadWindowRequest})与并发刷新都可能让同一 id 出现两次,重复行会带上
|
|
1446
|
+
* 重复的按钮,点错一个就是误删。
|
|
1447
|
+
* @param {ReadonlyArray<{id?: string}>} prev - 已渲染条目。
|
|
1448
|
+
* @param {ReadonlyArray<{id?: string}>} page - 新到的一页。
|
|
1449
|
+
* @returns {Array} 追加后的数组;无新增时**原样返回** prev(避免无意义的重渲染)。
|
|
1450
|
+
*/
|
|
1451
|
+
function appendUnique(prev, page) {
|
|
1452
|
+
if (!Array.isArray(page) || page.length === 0) return prev;
|
|
1453
|
+
const seen = new Set(prev.map((row) => row && row.id));
|
|
1454
|
+
const fresh = page.filter((row) => row && !seen.has(row.id));
|
|
1455
|
+
if (fresh.length === 0) return prev;
|
|
1456
|
+
return [...prev, ...fresh];
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* 动作(archive/delete/promote…)之后的重载窗口:刷新**已加载的整个前缀**,
|
|
1460
|
+
* 而不是重置成第一页——后者会把正在看第 5 页的用户直接弹回顶部。
|
|
1461
|
+
*
|
|
1462
|
+
* 用 offset 分页而不是 keyset 游标,正是为了让这条路可行:游标只能"往后翻",
|
|
1463
|
+
* 表达不了"把 0..N 重取一遍"。删除/归档导致的窗口收缩下,前缀重取依然不重不漏。
|
|
1464
|
+
*
|
|
1465
|
+
* **上限**:宿主单页最多 {@link HOST_PAGE_MAX} 条,超过就静默截断。所以已加载数超过上限时
|
|
1466
|
+
* 这一窗只重放前 200 条(`limit` 夹住),载荷回报的 `nextOffset` 会让哨兵继续把 200..N
|
|
1467
|
+
* 追加回来——宁可多一轮分页,也不能发一个"请求 500、只回 200"的值把列表打回 200 条。
|
|
1468
|
+
* @param {number} loadedCount - 当前已渲染条数。
|
|
1469
|
+
* @param {number} [pageSize] - 每页条数下界,保证至少取一页。
|
|
1470
|
+
* @returns {{offset: number, limit: number}} 重放请求窗口(limit ≤ HOST_PAGE_MAX)。
|
|
1471
|
+
*/
|
|
1472
|
+
function reloadWindowRequest(loadedCount, pageSize = 30) {
|
|
1473
|
+
return {
|
|
1474
|
+
offset: 0,
|
|
1475
|
+
limit: Math.min(200, Math.max(pageSize, Number.isFinite(loadedCount) && loadedCount > 0 ? Math.floor(loadedCount) : 0))
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* 把宿主载荷归一成窗口状态,兼容三种形态:
|
|
1480
|
+
* - 新宿主分页:有 `total` + `nextOffset`;
|
|
1481
|
+
* - 新宿主不分页(省略 limit):`nextOffset === null`;
|
|
1482
|
+
* - 老宿主/老 bundle:两个字段都没有 → 视为"一次给全,没有下一页"。
|
|
1483
|
+
* @param {any} data - 已解析的 JSON 载荷。
|
|
1484
|
+
* @param {number} fallbackOffset - 请求时的 offset(载荷没给 offset 时用它)。
|
|
1485
|
+
* @returns {{items: any[], total: number, offset: number, nextOffset: number|null}} 归一化窗口。
|
|
1486
|
+
*/
|
|
1487
|
+
function normalizeWindow(data, fallbackOffset = 0) {
|
|
1488
|
+
const items = Array.isArray(data && data.items) ? data.items : [];
|
|
1489
|
+
const rawTotal = data && typeof data.total === "number" ? data.total : data && typeof data.count === "number" ? data.count : items.length;
|
|
1490
|
+
const total = Number.isFinite(rawTotal) && rawTotal >= 0 ? rawTotal : items.length;
|
|
1491
|
+
const offset = data && Number.isFinite(data.offset) ? data.offset : fallbackOffset;
|
|
1492
|
+
const next = data && data.nextOffset;
|
|
1493
|
+
return {
|
|
1494
|
+
items,
|
|
1495
|
+
total,
|
|
1496
|
+
offset,
|
|
1497
|
+
nextOffset: typeof next === "number" && Number.isFinite(next) && next >= 0 ? next : null
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
/**
|
|
1501
|
+
* 页脚文案用的"已显示 N / 总数"。
|
|
1502
|
+
* @param {number} loaded - 已渲染条数。
|
|
1503
|
+
* @param {number} total - 服务端总数。
|
|
1504
|
+
* @returns {{loaded: number, total: number}} 归一化后的计数(total 不会小于 loaded)。
|
|
1505
|
+
*/
|
|
1506
|
+
function progressCounts(loaded, total) {
|
|
1507
|
+
const l = Number.isFinite(loaded) && loaded > 0 ? Math.floor(loaded) : 0;
|
|
1508
|
+
return {
|
|
1509
|
+
loaded: l,
|
|
1510
|
+
total: Math.max(l, Number.isFinite(total) && total > 0 ? Math.floor(total) : 0)
|
|
1511
|
+
};
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* 请求闸门:协调首屏 / 追加 / 动作后重放这几类**会重叠**的请求。
|
|
1515
|
+
*
|
|
1516
|
+
* 这里踩过一个坑,规则就是照着它定的:早期实现用"有在途请求就直接 return"的布尔守卫。
|
|
1517
|
+
* 于是"上一页还在飞的时候切 scope(或点动作)"时,新请求被**直接丢掉**,而过期响应又
|
|
1518
|
+
* 被作用域检查丢掉 → 新列表永远空白,只能手动刷新才出来。正确语义是两件事分开:
|
|
1519
|
+
* - **过期响应丢弃**(靠序号 + 作用域判定);
|
|
1520
|
+
* - **新请求照发**(只有同一个 key 正在飞时才去重,避免哨兵连续触发重复取同一页)。
|
|
1521
|
+
* @returns {{begin: Function, end: Function, isStale: Function}} 闸门。
|
|
1522
|
+
*/
|
|
1523
|
+
function createRequestGate() {
|
|
1524
|
+
let seq = 0;
|
|
1525
|
+
let inflightKey = null;
|
|
1526
|
+
return {
|
|
1527
|
+
/**
|
|
1528
|
+
* 申请发起一次请求。
|
|
1529
|
+
* @param {string} key - 请求身份(scope|offset|limit|append)。
|
|
1530
|
+
* @returns {number|false} 该请求的序号;同一 key 已在飞时返回 false(去重)。
|
|
1531
|
+
*/
|
|
1532
|
+
begin(key) {
|
|
1533
|
+
if (inflightKey === key) return false;
|
|
1534
|
+
inflightKey = key;
|
|
1535
|
+
seq += 1;
|
|
1536
|
+
return seq;
|
|
1537
|
+
},
|
|
1538
|
+
/**
|
|
1539
|
+
* 请求结束。
|
|
1540
|
+
* @param {string} key - 请求身份。
|
|
1541
|
+
* @param {number} ticket - begin 返回的序号。
|
|
1542
|
+
* @returns {boolean} 它是否仍是最后一次请求(决定加载标志该不该回落)。
|
|
1543
|
+
*/
|
|
1544
|
+
end(key, ticket) {
|
|
1545
|
+
if (inflightKey === key) inflightKey = null;
|
|
1546
|
+
return ticket === seq;
|
|
1547
|
+
},
|
|
1548
|
+
/**
|
|
1549
|
+
* 该响应是否已过期。
|
|
1550
|
+
* @param {number} ticket - 发出时的序号。
|
|
1551
|
+
* @param {string} requestedScope - 发出时的作用域。
|
|
1552
|
+
* @param {string} currentScope - 当前作用域。
|
|
1553
|
+
* @returns {boolean} true=必须整份丢弃。
|
|
1554
|
+
*/
|
|
1555
|
+
isStale(ticket, requestedScope, currentScope) {
|
|
1556
|
+
return ticket !== seq || requestedScope !== currentScope;
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1376
1560
|
//#endregion
|
|
1377
1561
|
//#region src/client/MemoryView.tsx
|
|
1378
1562
|
/**
|
|
1379
1563
|
* Memory View — 记忆三作用域列表(Task 草稿 / Project / Global)
|
|
1380
1564
|
* 数据通道与任务面板一致:remote.commands.execute 执行 /insight 命令,取 JSON 载荷。
|
|
1381
1565
|
* 动作:confirm(草稿审核) / promote(向上提升) / demote(向下降级,需绑定任务) / archive / restore / delete
|
|
1566
|
+
*
|
|
1567
|
+
* 列表是**增量加载**的:首屏只取 PAGE_SIZE 条,滚到底前 600px 预取下一页追加。
|
|
1568
|
+
* 分页的决策逻辑在 ./paging.js(纯函数,可单测),本组件只把它接到渲染上。
|
|
1382
1569
|
*/
|
|
1383
1570
|
function parseInsightPayloadText(text) {
|
|
1384
1571
|
if (!text) return null;
|
|
@@ -1393,10 +1580,14 @@ window.__ModuleLoader__.load({
|
|
|
1393
1580
|
try {
|
|
1394
1581
|
const data = JSON.parse(jsonBlock);
|
|
1395
1582
|
if (!Array.isArray(data.items)) return null;
|
|
1583
|
+
const w = normalizeWindow(data, 0);
|
|
1396
1584
|
return {
|
|
1397
1585
|
scope: data.scope ?? "project",
|
|
1398
|
-
count:
|
|
1399
|
-
|
|
1586
|
+
count: w.total,
|
|
1587
|
+
total: w.total,
|
|
1588
|
+
offset: w.offset,
|
|
1589
|
+
nextOffset: w.nextOffset,
|
|
1590
|
+
items: w.items
|
|
1400
1591
|
};
|
|
1401
1592
|
} catch {
|
|
1402
1593
|
return null;
|
|
@@ -1411,9 +1602,13 @@ window.__ModuleLoader__.load({
|
|
|
1411
1602
|
}[kind] ?? kind;
|
|
1412
1603
|
}
|
|
1413
1604
|
function MemoryView({ ctx, sessionId, scope, boundTaskId, showHints, t }) {
|
|
1414
|
-
const [
|
|
1605
|
+
const [rows, setRows] = (0, react.useState)([]);
|
|
1606
|
+
const [total, setTotal] = (0, react.useState)(0);
|
|
1607
|
+
const [nextOffset, setNextOffset] = (0, react.useState)(null);
|
|
1415
1608
|
const [error, setError] = (0, react.useState)(null);
|
|
1416
1609
|
const [loading, setLoading] = (0, react.useState)(false);
|
|
1610
|
+
const [loadingMore, setLoadingMore] = (0, react.useState)(false);
|
|
1611
|
+
const [showSpinner, setShowSpinner] = (0, react.useState)(false);
|
|
1417
1612
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
1418
1613
|
const [showNew, setShowNew] = (0, react.useState)(false);
|
|
1419
1614
|
const [editingId, setEditingId] = (0, react.useState)(null);
|
|
@@ -1425,6 +1620,8 @@ window.__ModuleLoader__.load({
|
|
|
1425
1620
|
trigger: ""
|
|
1426
1621
|
});
|
|
1427
1622
|
const [savedTip, setSavedTip] = (0, react.useState)(null);
|
|
1623
|
+
const scrollRef = (0, react.useRef)(null);
|
|
1624
|
+
const sentinelRef = (0, react.useRef)(null);
|
|
1428
1625
|
const runLine = (0, react.useCallback)(async (line) => {
|
|
1429
1626
|
const commands = service(ctx, "remote.commands");
|
|
1430
1627
|
if (!sessionId || !commands || typeof commands.execute !== "function") return {
|
|
@@ -1450,40 +1647,91 @@ window.__ModuleLoader__.load({
|
|
|
1450
1647
|
};
|
|
1451
1648
|
}
|
|
1452
1649
|
}, [ctx, sessionId]);
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
const
|
|
1650
|
+
const gateRef = (0, react.useRef)(null);
|
|
1651
|
+
if (gateRef.current === null) gateRef.current = createRequestGate();
|
|
1652
|
+
const scopeRef = (0, react.useRef)(scope);
|
|
1653
|
+
(0, react.useEffect)(() => {
|
|
1654
|
+
scopeRef.current = scope;
|
|
1655
|
+
}, [scope]);
|
|
1656
|
+
/**
|
|
1657
|
+
* 取一页并落到状态里。
|
|
1658
|
+
* @param offset 起始下标。
|
|
1659
|
+
* @param limit 本页条数。
|
|
1660
|
+
* @param append true=追加到已渲染列表;false=替换成这一页(首屏或前缀重放)。
|
|
1661
|
+
*/
|
|
1662
|
+
const load = (0, react.useCallback)(async (offset, limit, append) => {
|
|
1456
1663
|
if (!sessionId) {
|
|
1457
|
-
|
|
1664
|
+
setRows([]);
|
|
1665
|
+
setTotal(0);
|
|
1666
|
+
setNextOffset(null);
|
|
1458
1667
|
setError(null);
|
|
1459
1668
|
setLoading(false);
|
|
1460
1669
|
return;
|
|
1461
1670
|
}
|
|
1462
|
-
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1671
|
+
const requestedScope = scopeRef.current;
|
|
1672
|
+
const key = `${requestedScope}|${offset}|${limit}|${append}`;
|
|
1673
|
+
const ticket = gateRef.current.begin(key);
|
|
1674
|
+
if (ticket === false) return;
|
|
1675
|
+
if (!append) setLoading(true);
|
|
1676
|
+
setLoadingMore(append);
|
|
1468
1677
|
setError(null);
|
|
1678
|
+
const spinner = window.setTimeout(() => setShowSpinner(true), 150);
|
|
1469
1679
|
try {
|
|
1470
|
-
const res = await runLine(
|
|
1680
|
+
const res = await runLine(insightListLine(requestedScope, offset, limit));
|
|
1681
|
+
if (gateRef.current.isStale(ticket, requestedScope, scopeRef.current)) return;
|
|
1471
1682
|
if (!res.ok) {
|
|
1472
1683
|
setError(res.text);
|
|
1473
|
-
setPayload(null);
|
|
1474
1684
|
return;
|
|
1475
1685
|
}
|
|
1476
1686
|
const parsed = parseInsightPayloadText(res.text);
|
|
1477
|
-
|
|
1478
|
-
|
|
1687
|
+
if (!parsed) {
|
|
1688
|
+
setError("unparsable payload");
|
|
1689
|
+
return;
|
|
1690
|
+
}
|
|
1691
|
+
setRows((prev) => append ? appendUnique(prev, parsed.items) : parsed.items);
|
|
1692
|
+
setTotal(parsed.total);
|
|
1693
|
+
setNextOffset(parsed.nextOffset);
|
|
1479
1694
|
} finally {
|
|
1480
|
-
|
|
1481
|
-
|
|
1695
|
+
window.clearTimeout(spinner);
|
|
1696
|
+
if (gateRef.current.end(key, ticket)) {
|
|
1697
|
+
setShowSpinner(false);
|
|
1698
|
+
setLoading(false);
|
|
1699
|
+
setLoadingMore(false);
|
|
1700
|
+
}
|
|
1482
1701
|
}
|
|
1483
|
-
}, [runLine,
|
|
1702
|
+
}, [runLine, sessionId]);
|
|
1703
|
+
const loadRef = (0, react.useRef)(load);
|
|
1704
|
+
(0, react.useEffect)(() => {
|
|
1705
|
+
loadRef.current = load;
|
|
1706
|
+
}, [load]);
|
|
1707
|
+
(0, react.useEffect)(() => {
|
|
1708
|
+
setRows([]);
|
|
1709
|
+
setTotal(0);
|
|
1710
|
+
setNextOffset(null);
|
|
1711
|
+
setError(null);
|
|
1712
|
+
if (!sessionId) return;
|
|
1713
|
+
loadRef.current(0, 30, false);
|
|
1714
|
+
}, [scope, sessionId]);
|
|
1484
1715
|
(0, react.useEffect)(() => {
|
|
1485
|
-
|
|
1486
|
-
|
|
1716
|
+
if (nextOffset === null || typeof IntersectionObserver === "undefined") return;
|
|
1717
|
+
const sentinel = sentinelRef.current;
|
|
1718
|
+
if (!sentinel) return;
|
|
1719
|
+
const observer = new IntersectionObserver((entries) => {
|
|
1720
|
+
if (entries.some((e) => e.isIntersecting)) loadRef.current(nextOffset, 30, true);
|
|
1721
|
+
}, {
|
|
1722
|
+
root: scrollRef.current ?? null,
|
|
1723
|
+
rootMargin: PREFETCH_MARGIN
|
|
1724
|
+
});
|
|
1725
|
+
observer.observe(sentinel);
|
|
1726
|
+
return () => observer.disconnect();
|
|
1727
|
+
}, [nextOffset, rows.length]);
|
|
1728
|
+
/**
|
|
1729
|
+
* 重载**已加载的整个前缀**(不是重置成第一页):动作之后用户的位置不该跳回顶部。
|
|
1730
|
+
*/
|
|
1731
|
+
const reloadWindow = (0, react.useCallback)(async () => {
|
|
1732
|
+
const { offset, limit } = reloadWindowRequest(rows.length);
|
|
1733
|
+
await loadRef.current(offset, limit, false);
|
|
1734
|
+
}, [rows.length]);
|
|
1487
1735
|
const act = async (action, id) => {
|
|
1488
1736
|
if (busy) return;
|
|
1489
1737
|
setBusy(true);
|
|
@@ -1492,7 +1740,7 @@ window.__ModuleLoader__.load({
|
|
|
1492
1740
|
const line = `/tasks insight ${action} ${scope} ${id}${action === "demote" && scope === "project" && boundTaskId ? ` ${boundTaskId}` : ""}`;
|
|
1493
1741
|
const res = await runLine(line);
|
|
1494
1742
|
if (!res.ok) setError(res.text);
|
|
1495
|
-
else
|
|
1743
|
+
else await reloadWindow();
|
|
1496
1744
|
} finally {
|
|
1497
1745
|
setBusy(false);
|
|
1498
1746
|
}
|
|
@@ -1572,21 +1820,23 @@ window.__ModuleLoader__.load({
|
|
|
1572
1820
|
setSavedTip(t("mem.saved"));
|
|
1573
1821
|
closeForm();
|
|
1574
1822
|
window.setTimeout(() => setSavedTip(null), 2500);
|
|
1575
|
-
|
|
1823
|
+
await reloadWindow();
|
|
1576
1824
|
}
|
|
1577
1825
|
} finally {
|
|
1578
1826
|
setBusy(false);
|
|
1579
1827
|
}
|
|
1580
1828
|
};
|
|
1581
|
-
const items =
|
|
1829
|
+
const items = rows;
|
|
1830
|
+
const progress = progressCounts(items.length, total);
|
|
1582
1831
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1583
1832
|
className: TaskPanel_module_css_default.memoryPane,
|
|
1833
|
+
ref: scrollRef,
|
|
1584
1834
|
children: [
|
|
1585
1835
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1586
1836
|
className: TaskPanel_module_css_default.memToolbar,
|
|
1587
1837
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1588
1838
|
className: TaskPanel_module_css_default.memCount,
|
|
1589
|
-
children: [scope === "task" ? t("mem.scope.task") : scope === "global" ? t("mem.scope.global") : t("mem.scope.project"),
|
|
1839
|
+
children: [scope === "task" ? t("mem.scope.task") : scope === "global" ? t("mem.scope.global") : t("mem.scope.project"), total > 0 ? ` · ${total}` : ""]
|
|
1590
1840
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1591
1841
|
className: TaskPanel_module_css_default.memToolbarActs,
|
|
1592
1842
|
children: [
|
|
@@ -1608,7 +1858,7 @@ window.__ModuleLoader__.load({
|
|
|
1608
1858
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1609
1859
|
variant: "outline",
|
|
1610
1860
|
size: "sm",
|
|
1611
|
-
onClick: () => void
|
|
1861
|
+
onClick: () => void reloadWindow(),
|
|
1612
1862
|
disabled: loading,
|
|
1613
1863
|
title: showHints ? t("panel.refresh") : void 0,
|
|
1614
1864
|
"aria-label": t("panel.refresh"),
|
|
@@ -1709,7 +1959,14 @@ window.__ModuleLoader__.load({
|
|
|
1709
1959
|
children: [
|
|
1710
1960
|
t("mem.error"),
|
|
1711
1961
|
": ",
|
|
1712
|
-
error
|
|
1962
|
+
error,
|
|
1963
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1964
|
+
variant: "outline",
|
|
1965
|
+
size: "sm",
|
|
1966
|
+
disabled: loading || loadingMore,
|
|
1967
|
+
onClick: () => void reloadWindow(),
|
|
1968
|
+
children: t("mem.retry")
|
|
1969
|
+
})
|
|
1713
1970
|
]
|
|
1714
1971
|
}),
|
|
1715
1972
|
loading && !items.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -1720,9 +1977,9 @@ window.__ModuleLoader__.load({
|
|
|
1720
1977
|
className: TaskPanel_module_css_default.muted,
|
|
1721
1978
|
children: t("mem.empty")
|
|
1722
1979
|
}),
|
|
1723
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1980
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1724
1981
|
className: TaskPanel_module_css_default.memList,
|
|
1725
|
-
children: items.map((row) => {
|
|
1982
|
+
children: [items.map((row) => {
|
|
1726
1983
|
const canDemoteToTask = scope === "project" && !!boundTaskId;
|
|
1727
1984
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1728
1985
|
className: `${TaskPanel_module_css_default.memRow}${row.archived ? ` ${TaskPanel_module_css_default.memRowArchived}` : ""}`,
|
|
@@ -1837,7 +2094,30 @@ window.__ModuleLoader__.load({
|
|
|
1837
2094
|
})
|
|
1838
2095
|
]
|
|
1839
2096
|
}, row.id);
|
|
1840
|
-
})
|
|
2097
|
+
}), items.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2098
|
+
className: TaskPanel_module_css_default.memFooter,
|
|
2099
|
+
children: [
|
|
2100
|
+
nextOffset !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2101
|
+
ref: sentinelRef,
|
|
2102
|
+
className: TaskPanel_module_css_default.memSentinel,
|
|
2103
|
+
"aria-hidden": "true"
|
|
2104
|
+
}),
|
|
2105
|
+
nextOffset !== null && typeof IntersectionObserver === "undefined" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
2106
|
+
variant: "outline",
|
|
2107
|
+
size: "sm",
|
|
2108
|
+
disabled: loadingMore,
|
|
2109
|
+
onClick: () => void loadRef.current(nextOffset, 30, true),
|
|
2110
|
+
children: t("mem.loadMore")
|
|
2111
|
+
}),
|
|
2112
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2113
|
+
className: TaskPanel_module_css_default.muted,
|
|
2114
|
+
children: [progress.loaded < progress.total ? t("mem.progress", {
|
|
2115
|
+
loaded: progress.loaded,
|
|
2116
|
+
total: progress.total
|
|
2117
|
+
}) : t("mem.allLoaded", { total: progress.total }), showSpinner && loadingMore ? ` · ${t("mem.loadingMore")}` : ""]
|
|
2118
|
+
})
|
|
2119
|
+
]
|
|
2120
|
+
})]
|
|
1841
2121
|
})
|
|
1842
2122
|
]
|
|
1843
2123
|
});
|
|
@@ -1995,7 +2275,8 @@ window.__ModuleLoader__.load({
|
|
|
1995
2275
|
dataActions.setTasks({
|
|
1996
2276
|
tasks: parsed.tasks,
|
|
1997
2277
|
boundTaskId: parsed.boundId,
|
|
1998
|
-
archivedCount: parsed.archived
|
|
2278
|
+
archivedCount: parsed.archived,
|
|
2279
|
+
root: parsed.root
|
|
1999
2280
|
});
|
|
2000
2281
|
setSyncedAt(Date.now());
|
|
2001
2282
|
setSyncError(null);
|
|
@@ -2023,14 +2304,22 @@ window.__ModuleLoader__.load({
|
|
|
2023
2304
|
}
|
|
2024
2305
|
return applyPayload(result?.text);
|
|
2025
2306
|
};
|
|
2307
|
+
/**
|
|
2308
|
+
* 只取数据,**不**顺手 switch。
|
|
2309
|
+
*
|
|
2310
|
+
* 旧实现在这里补一次 `/tasks switch <boundId>`(条件是"新 boundId 与内存里的不同"),
|
|
2311
|
+
* 意图是刷新后让宿主 todo 跟随绑定任务。但那是多余的:宿主的 todo 清单是
|
|
2312
|
+
* `sessionProjections` 里的 `todos` 单元(由 `todo/write` 事件折叠而来),重启/换标签页
|
|
2313
|
+
* 都会从会话日志重建,不需要谁再推一次;而 switch 会 `session.append('todo/write')`,
|
|
2314
|
+
* 于是"打开面板/切一次会话"就写一次会话历史(还顺手刷新任务的 lastActiveAt)。
|
|
2315
|
+
* 真正的绑定动作都有明确入口:`select_task`、`/tasks switch`、面板卡片的切换按钮,
|
|
2316
|
+
* 它们各自会推宿主清单(adoptStepsToSession),不需要巡检式补写。
|
|
2317
|
+
*/
|
|
2026
2318
|
const refresh = async () => {
|
|
2027
2319
|
if (syncing) return;
|
|
2028
2320
|
setSyncing(true);
|
|
2029
2321
|
try {
|
|
2030
|
-
const prevBoundId = data.boundTaskId;
|
|
2031
2322
|
await runLine("/tasks");
|
|
2032
|
-
const newBoundId = taskDataStore.getSnapshot().boundTaskId;
|
|
2033
|
-
if (newBoundId && newBoundId !== prevBoundId) await runLine(`/tasks switch ${newBoundId}`);
|
|
2034
2323
|
} finally {
|
|
2035
2324
|
setSyncing(false);
|
|
2036
2325
|
}
|
|
@@ -2391,7 +2680,8 @@ window.__ModuleLoader__.load({
|
|
|
2391
2680
|
taskDataStore.actions.setTasks({
|
|
2392
2681
|
tasks: parsedTasks.tasks,
|
|
2393
2682
|
boundTaskId: parsedTasks.boundId,
|
|
2394
|
-
archivedCount: parsedTasks.archived
|
|
2683
|
+
archivedCount: parsedTasks.archived,
|
|
2684
|
+
root: parsedTasks.root
|
|
2395
2685
|
});
|
|
2396
2686
|
if (isList) taskUIStore.actions.open();
|
|
2397
2687
|
}, [text]);
|