@aspen138/dsh-btw 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +6 -1
  2. package/client.js +47 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -29,9 +29,14 @@
29
29
  |---|---|
30
30
  | `/btw <问题>` | 起一个子 agent 去查,右侧「侧问」页签自动打开并列出问答 |
31
31
  | `/btw` | 返回用法提示 |
32
- | 点击对话流里的 `◈ 侧问 …` | 重新打开「侧问」页签 |
32
+ | **右上角 `◈ 侧问 N` 按钮** | 重新打开「侧问」页签——页签关掉/右栏收起后都能靠它找回来 |
33
+ | 点击对话流里的 `◈ 侧问 …` | 打开这条侧问的子会话页签(工具调用都在这) |
33
34
  | 「开始」页里的「侧问」卡片 | 打开「侧问」页签 |
34
35
 
36
+ 右上角按钮只在**本会话有过侧问**时出现,数量就是条目数;没问过就不占地方。截图里它长这样:
37
+
38
+ ![右上角的侧问按钮](docs/screenshot-button.png)
39
+
35
40
  页签里每条记录有状态(正在跑 / 已答 / 失败)和「复制问答」。记录来自当前会话的命令生命周期,换会话就是另一份列表。
36
41
 
37
42
  ## 上下文边界
package/client.js CHANGED
@@ -1,4 +1,4 @@
1
- // dsh-btw — Client half: the right-Sidebar "Side question" page and the
1
+ // dsh-btw — Client half: the right-Sidebar "Side question" page and the
2
2
  // compact transcript chip.
3
3
  //
4
4
  // Data source: the Chat layer's own command nodes. `/btw` is a Host command, so
@@ -130,6 +130,12 @@ window.__ModuleLoader__.load({
130
130
  '.dshbtw-chip-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
131
131
  '.dshbtw-chip-state{flex:none;color:var(--dsw-alias-state-idle-primary)}',
132
132
  '.dshbtw-chip-state.is-error{color:var(--dsw-alias-state-error-primary)}',
133
+ '.dshbtw-hbtn{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 7px;',
134
+ 'border:0.5px solid var(--dsw-alias-border-l1);border-radius:999px;background:transparent;',
135
+ 'color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;line-height:1;cursor:pointer}',
136
+ '.dshbtw-hbtn:hover{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}',
137
+ '.dshbtw-hbtn-mark{color:var(--dsw-alias-brand-primary)}',
138
+ '.dshbtw-hbtn-count{min-width:10px;text-align:center;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums}',
133
139
  ].join('')
134
140
 
135
141
  // ------------------------------------------------------------------ error
@@ -308,6 +314,37 @@ window.__ModuleLoader__.load({
308
314
  )
309
315
  }
310
316
 
317
+ // ---------------------------------------------------------------- header
318
+
319
+ /**
320
+ * Persistent "side question" button in the Session header utilities.
321
+ *
322
+ * Closing the right-Sidebar tab must never strand the history: this button
323
+ * stays in the header whenever the session has side questions and reopens
324
+ * the page. It renders nothing for a session that never used `/btw`.
325
+ */
326
+ function BtwHeaderButton(props) {
327
+ const t = props.__btwStrings
328
+ const records = useBtwRecords(props.useChat)
329
+ if (records.length === 0) return null
330
+ return h(
331
+ 'button',
332
+ {
333
+ type: 'button',
334
+ className: 'dshbtw-hbtn',
335
+ title: t.chipOpen,
336
+ 'aria-label': `${t.badge}(${records.length})`,
337
+ onClick: () => {
338
+ if (typeof navigation.open === 'function') navigation.open()
339
+ },
340
+ },
341
+ h('style', { key: 'style' }, CSS),
342
+ h('span', { key: 'mark', className: 'dshbtw-hbtn-mark', 'aria-hidden': true }, '◈'),
343
+ h('span', { key: 'label' }, t.badge),
344
+ h('span', { key: 'count', className: 'dshbtw-hbtn-count' }, String(records.length)),
345
+ )
346
+ }
347
+
311
348
  // ------------------------------------------------------------------ page
312
349
 
313
350
  /** One side question: question, answer, and its copy / sub-session actions. */
@@ -577,6 +614,15 @@ window.__ModuleLoader__.load({
577
614
  (props) => h(Boundary, { fallback: null }, h(BtwChip, { ...props, __btwStrings: strings })),
578
615
  ),
579
616
  )
617
+
618
+ // Always-present way back in: the header button reopens the page after
619
+ // the user closes its tab.
620
+ ctx.slots.inject('conversation.session.header.utilities', () =>
621
+ ctx.slots.register(
622
+ { name: 'conversation.session.header.utilities', id: 'dsh-btw-header', order: 30 },
623
+ (props) => h(Boundary, { fallback: null }, h(BtwHeaderButton, { ...props, __btwStrings: strings })),
624
+ ),
625
+ )
580
626
  },
581
627
  }
582
628
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspen138/dsh-btw",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Antigravity-style /btw side questions for DeepSeek Harness: ask one question mid-task, answered by a disposable forked child agent with the full tool set in its own right-Sidebar tab, without adding anything to the main session's model context.",
5
5
  "keywords": [
6
6
  "deepseek-harness",