dsh-bots 0.2.17 → 0.2.18

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 (2) hide show
  1. package/lib/client.js +36 -6
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -284,6 +284,12 @@
284
284
  .dbs-navBody{display:flex;flex-direction:column;min-height:0;flex:1}
285
285
  .dbs-botsBody{overflow-y:auto;scrollbar-gutter:stable;padding-right:var(--dsh-sidebar-inline-padding,8px)}
286
286
  .dbs-navBodyErr{padding:6px 12px;font-size:12px;line-height:20px;color:var(--dsw-alias-label-tertiary)}
287
+ .dbs-secHead{position:relative}
288
+ .dbs-secHead .dbs-rowActions{display:none}
289
+ .dbs-secHead:hover .dbs-rowActions,.dbs-secHead:focus-within .dbs-rowActions{display:inline-flex}
290
+ .dbs-secMenu{position:absolute;top:100%;right:0;z-index:40;min-width:148px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;padding:4px;box-shadow:0 12px 40px rgba(0,0,0,.22);animation:dbs-modal-in .14s ease-out}
291
+ .dbs-secMenuItem{display:flex;align-items:center;gap:8px;width:100%;padding:6px 10px;border-radius:8px;font-size:13px;line-height:18px;color:var(--dsw-alias-label-primary);cursor:pointer;background:none;border:none;text-align:left}
292
+ .dbs-secMenuItem:hover{background:var(--dsw-alias-interactive-bg-hover)}
287
293
  .dbs-prow,.dbs-srow{cursor:pointer;user-select:none;color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;gap:6px;padding:0 8px;display:flex;box-sizing:border-box}
288
294
  /* Native mirror (dsh-client-ui-sidebar/workspace): header-class rows outdent
289
295
  their label 4px (pl:4 → x=16 from the window edge) while list rows keep
@@ -489,6 +495,8 @@
489
495
  'list.loading': '加载中…',
490
496
  'list.empty': '还没有 Bot,点 + 新建。',
491
497
  'section.groups': '群聊',
498
+ 'list.more': '更多操作',
499
+ 'list.refresh': '刷新列表',
492
500
  'section.singles': '单聊',
493
501
  'chat.group': '群聊 · {n} 名成员',
494
502
  'chat.single': '单聊',
@@ -602,6 +610,8 @@
602
610
  'list.loading': 'Loading…',
603
611
  'list.empty': 'No bots yet — use + to create one.',
604
612
  'section.groups': 'Groups',
613
+ 'list.more': 'More actions',
614
+ 'list.refresh': 'Refresh list',
605
615
  'section.singles': 'Direct',
606
616
  'chat.group': 'Group · {n} members',
607
617
  'chat.single': 'Direct',
@@ -791,6 +801,7 @@
791
801
  /** Manage-members dialog: group agentId | null (system modal). */
792
802
  manageMembers: null,
793
803
  settingsAgentId: null,
804
+ sectionMenu: null,
794
805
  /** Bumped on a language switch so module-scope `t` output re-renders. */
795
806
  localeRev: 0,
796
807
  };
@@ -1129,19 +1140,32 @@
1129
1140
  * are: creating the first bot or group never requires a trip to the
1130
1141
  * footer. `addAction` opens the same system-style modal as before.
1131
1142
  */
1132
- function sectionRows(label, list, addAction) {
1143
+ function sectionRows(label, list, addAction, menuKind, menuItems) {
1144
+ const menuOpen = s.sectionMenu === menuKind;
1133
1145
  return e('div', { key: label }, e('div', {
1134
- className: 'dbs-navBodyErr',
1146
+ className: 'dbs-navBodyErr dbs-secHead',
1135
1147
  // Native sectionHeader outdent: label at x=16 (12 sidebar
1136
1148
  // padding + 4), aligned with the group headers. The previous
1137
1149
  // 12px here pushed section labels 8px right of the native
1138
1150
  // baseline, making both sections read horizontally off.
1139
1151
  style: { padding: '4px 8px 2px 4px', display: 'flex', alignItems: 'center' },
1140
- }, e('span', { style: { flex: 1 } }, label), e(Button, {
1152
+ }, e('span', { style: { flex: 1 } }, label),
1153
+ // Native workspace pattern: header actions appear on hover
1154
+ // (.dbs-rowActions is hover-gated in .dbs-secHead CSS).
1155
+ e('div', { className: 'dbs-rowActions', style: { alignItems: 'center', gap: 2 } }, e(Button, {
1141
1156
  variant: 'ghost', size: 'sm', title: addAction.title, 'aria-label': addAction.title,
1142
1157
  icon: Ico('IconPlusOutline16', { size: 14 }),
1143
1158
  onClick: addAction.onClick,
1144
- })), list.map(row));
1159
+ }), e(Button, {
1160
+ variant: 'ghost', size: 'sm', title: t('list.more'), 'aria-label': t('list.more'),
1161
+ icon: Ico('IconEllipsisOutline16', { size: 14 }),
1162
+ onClick: () => patch({ sectionMenu: menuOpen ? null : menuKind }),
1163
+ })), menuOpen
1164
+ ? e(React.Fragment, null, e('div', { style: { position: 'fixed', inset: 0, zIndex: 39 }, onClick: () => patch({ sectionMenu: null }) }), e('div', { className: 'dbs-secMenu', onClick: (ev) => { ev.stopPropagation(); } }, menuItems.map((item) => e('button', {
1165
+ key: item.label, className: 'dbs-secMenuItem', type: 'button',
1166
+ onClick: () => { patch({ sectionMenu: null }); item.onClick(); },
1167
+ }, item.label))))
1168
+ : null), list.map(row));
1145
1169
  }
1146
1170
  // No footer: the gateway status moved to the Bots group-header dot's
1147
1171
  // hover tooltip (0.2.8) — see SidebarNav's StateDot `title`.
@@ -1155,12 +1179,18 @@
1155
1179
  ? sectionRows(t('section.groups'), groups, {
1156
1180
  title: t('group.new'),
1157
1181
  onClick: () => patch({ create: 'group', createName: '', createMembers: {}, createWorking: false, error: null }),
1158
- })
1182
+ }, 'groups', [
1183
+ { label: t('group.new'), onClick: () => patch({ create: 'group', createName: '', createMembers: {}, createWorking: false, error: null }) },
1184
+ { label: t('list.refresh'), onClick: () => { void refreshAgents(); } },
1185
+ ])
1159
1186
  : null, s.agentsLoaded
1160
1187
  ? sectionRows(t('section.singles'), singles, {
1161
1188
  title: t('bot.new'),
1162
1189
  onClick: () => patch({ create: 'bot', createName: '', createDesc: '', createWorking: false, error: null }),
1163
- })
1190
+ }, 'singles', [
1191
+ { label: t('bot.new'), onClick: () => patch({ create: 'bot', createName: '', createDesc: '', createWorking: false, error: null }) },
1192
+ { label: t('list.refresh'), onClick: () => { void refreshAgents(); } },
1193
+ ])
1164
1194
  : null);
1165
1195
  }
1166
1196
  // =========================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-bots",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
4
4
  "description": "Multi-bot workbench for DeepSeek Harness: bridges the sdk-bots orchestration gateway (group chats, single bots) into the dsh web shell with official-styled UI.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",