dsh-plugin-inspiration-workbench 0.5.0 → 0.6.0

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/README.md CHANGED
@@ -38,9 +38,9 @@ DSH 一次只能打开一个会话:想同时看三条线的进展,只能来
38
38
  |---|---|
39
39
  | ![fanout](docs/screenshots/pipeline-fanout.png) | ![note target](docs/screenshots/pipeline-note.png) |
40
40
 
41
- | 便签投递带标题和时间戳 |
42
- |---|
43
- | ![note template](docs/screenshots/pipeline-note-template.png) |
41
+ | 便签投递带标题和时间戳 | 便签可设为「只保留最新」 |
42
+ |---|---|
43
+ | ![note template](docs/screenshots/pipeline-note-template.png) | ![note replace](docs/screenshots/pipeline-note-replace.png) |
44
44
 
45
45
  ---
46
46
 
@@ -50,7 +50,7 @@ DSH 一次只能打开一个会话:想同时看三条线的进展,只能来
50
50
  - 侧栏会话行的 `+` 把会话加成卡片;侧栏点击行为不变
51
51
  - 拖动 / 缩放 / 叠成一摞 / 双击居中 / 点空白平移 / ⌘+滚轮缩放
52
52
  - **命名画布**:保存当前这面墙、切换回之前保存的画布、覆盖 / 删除;数据存 Host,刷新不丢
53
- - **流水线**:从卡片右侧端口拖一条线到另一张卡即建立;**一条卡可连多个下游**(扇出),下游可以是会话卡,也可以是**便签卡**(结果按 `## 来自「卡片名」 · 时间` 的分块追加进去);点连线切换「自动发送 / 只填草稿」或删除
53
+ - **流水线**:从卡片右侧端口拖一条线到另一张卡即建立;**一条卡可连多个下游**(扇出),下游可以是会话卡,也可以是**便签卡**(结果按 `## 来自「卡片名」 · 时间` 分块写入;便签可选「追加」或「只保留最新一段」);点连线切换「自动发送 / 只填草稿」或删除
54
54
  - 卡片头部操作常驻显示(流水线 / 大纲 / 搜索 / ⋯ / 关闭),次要操作用「⋯」收纳,窄卡片也不挤
55
55
  - 便签卡(随手记)、钉住位置、未读圆点、复制为 Markdown、在原生会话打开
56
56
 
package/lib/client.js CHANGED
@@ -3968,12 +3968,13 @@ function createBoard({ host, adapter, approvals, t: t2, onOpenSession }) {
3968
3968
  const area = targetCard.el?.querySelector(".iwb-note-input");
3969
3969
  if (!area) continue;
3970
3970
  const block = t2("pipe.noteBlock").replace("{title}", card.title || t2("untitled")).replace("{time}", canvasStamp()).replace("{text}", text);
3971
- area.value = area.value.trim() ? area.value.replace(/\s*$/, "\n\n") + block : block;
3971
+ const replace = target.write === "replace";
3972
+ area.value = replace ? block : area.value.trim() ? area.value.replace(/\s*$/, "\n\n") + block : block;
3972
3973
  area.dispatchEvent(new Event("input", { bubbles: true }));
3973
3974
  targetCard.pipeDepth = depth;
3974
3975
  card.pipedFingerprints[key] = fingerprint;
3975
3976
  ensureVisible(targetCard);
3976
- toast(t2("pipe.noted").replace("{name}", targetCard.title || t2("untitled")));
3977
+ toast(t2(replace ? "pipe.notedReplaced" : "pipe.noted").replace("{name}", targetCard.title || t2("untitled")));
3977
3978
  continue;
3978
3979
  }
3979
3980
  if (target.mode === "draft") {
@@ -4041,9 +4042,31 @@ function createBoard({ host, adapter, approvals, t: t2, onOpenSession }) {
4041
4042
  pop.appendChild(row);
4042
4043
  }
4043
4044
  } else {
4044
- const statusRow = el("div", "iwb-popover-note");
4045
- statusRow.textContent = t2("pipe.noteHint");
4046
- pop.appendChild(statusRow);
4045
+ const write = target.write === "replace" ? "replace" : "append";
4046
+ const writes = [
4047
+ { id: "append", label: t2("pipe.noteAppend"), hint: t2("pipe.noteAppendHint") },
4048
+ { id: "replace", label: t2("pipe.noteReplace"), hint: t2("pipe.noteReplaceHint") }
4049
+ ];
4050
+ for (const option of writes) {
4051
+ const row = el("button", "iwb-model-row" + (write === option.id ? " current" : ""));
4052
+ row.type = "button";
4053
+ row.innerHTML = '<span class="iwb-model-main"><span class="iwb-model-name"></span><span class="iwb-model-desc"></span></span>' + (write === option.id ? '<span class="iwb-check">\u2713</span>' : "");
4054
+ row.querySelector(".iwb-model-name").textContent = option.label;
4055
+ row.querySelector(".iwb-model-desc").textContent = option.hint;
4056
+ row.addEventListener("click", (event) => {
4057
+ event.stopPropagation();
4058
+ const targets = pipeTargets(card).map(
4059
+ (entry) => entry.kind === target.kind && entry.id === target.id ? { ...entry, write: option.id } : entry
4060
+ );
4061
+ setPipeTargets(card, targets);
4062
+ renderPipeBadge(card);
4063
+ schedulePipelines();
4064
+ saveSoon();
4065
+ closePipeMenu();
4066
+ toast(option.id === "replace" ? t2("pipe.modeReplace") : t2("pipe.modeAppend"));
4067
+ });
4068
+ pop.appendChild(row);
4069
+ }
4047
4070
  }
4048
4071
  const remove = el("button", "iwb-model-row iwb-link-remove");
4049
4072
  remove.type = "button";
@@ -6222,7 +6245,14 @@ var zh = {
6222
6245
  "pipe.noted": "\u7ED3\u679C\u5DF2\u8FFD\u52A0\u5230\u4FBF\u7B7E\u300C{name}\u300D",
6223
6246
  "pipe.noteBlock": "## \u6765\u81EA\u300C{title}\u300D \xB7 {time}\n\n{text}",
6224
6247
  "pipe.noteTarget": "\u6D41\u6C34\u7EBF \u2192 \u4FBF\u7B7E",
6225
- "pipe.noteHint": "\u4E0B\u6E38\u662F\u4FBF\u7B7E\uFF1A\u8DD1\u5B8C\u628A\u7ED3\u679C\u8FFD\u52A0\u8FDB\u53BB\uFF0C\u4E0D\u53D1\u9001",
6248
+ "pipe.noteHint": "\u4E0B\u6E38\u662F\u4FBF\u7B7E\uFF1A\u8DD1\u5B8C\u628A\u7ED3\u679C\u5199\u8FDB\u53BB\uFF0C\u4E0D\u53D1\u9001",
6249
+ "pipe.noteAppend": "\u8FFD\u52A0\u5230\u4FBF\u7B7E",
6250
+ "pipe.noteAppendHint": "\u6BCF\u8F6E\u90FD\u63A5\u5728\u540E\u9762\uFF0C\u50CF\u65E5\u5FD7",
6251
+ "pipe.noteReplace": "\u53EA\u4FDD\u7559\u6700\u65B0\u4E00\u6BB5",
6252
+ "pipe.noteReplaceHint": "\u8986\u76D6\u65E7\u5185\u5BB9\uFF0C\u5F53\u6C47\u603B\u680F\u7528",
6253
+ "pipe.modeAppend": "\u4FBF\u7B7E\uFF1A\u8FFD\u52A0\u6A21\u5F0F",
6254
+ "pipe.modeReplace": "\u4FBF\u7B7E\uFF1A\u53EA\u4FDD\u7559\u6700\u65B0\u4E00\u6BB5",
6255
+ "pipe.notedReplaced": "\u5DF2\u8986\u76D6\u4FBF\u7B7E\u300C{name}\u300D\u4E3A\u6700\u65B0\u7ED3\u679C",
6226
6256
  "pipe.removeNote": "\u5220\u9664\u8FD9\u6761\u4FBF\u7B7E\u6D41\u6C34\u7EBF",
6227
6257
  "pipe.port": "\u62D6\u8FD9\u6761\u7EBF\u5230\u53E6\u4E00\u5F20\u5361\uFF0C\u5EFA\u7ACB\u6D41\u6C34\u7EBF",
6228
6258
  "pipe.created": "\u6D41\u6C34\u7EBF\u5DF2\u8FDE\u5230\u300C{name}\u300D",
@@ -6514,7 +6544,14 @@ var en = {
6514
6544
  "pipe.noted": "Result appended to note \u201C{name}\u201D",
6515
6545
  "pipe.noteBlock": "## From \u201C{title}\u201D \xB7 {time}\n\n{text}",
6516
6546
  "pipe.noteTarget": "Pipeline \u2192 note",
6517
- "pipe.noteHint": "Note downstream: the result is appended, never sent",
6547
+ "pipe.noteHint": "Note downstream: the result is written into the note, never sent",
6548
+ "pipe.noteAppend": "Append to the note",
6549
+ "pipe.noteAppendHint": "Keep every run, like a log",
6550
+ "pipe.noteReplace": "Keep only the latest",
6551
+ "pipe.noteReplaceHint": "Overwrite, for a summary pane",
6552
+ "pipe.modeAppend": "Note: append mode",
6553
+ "pipe.modeReplace": "Note: keep only the latest",
6554
+ "pipe.notedReplaced": "Note \u201C{name}\u201D replaced with the latest result",
6518
6555
  "pipe.removeNote": "Remove this note pipeline",
6519
6556
  "pipe.port": "Drag this line onto another card to wire a pipeline",
6520
6557
  "pipe.created": "Pipeline wired to \u201C{name}\u201D",