dsh-bots 0.2.18 → 0.2.20

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 +32 -9
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -284,9 +284,15 @@
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}
287
+ /* Hover actions RESERVE their space (visibility/opacity swap, not
288
+ display:none): a display toggle let the appearing buttons stretch the
289
+ row on hover and shrink it on leave — width/height jitter the user read
290
+ as flicker. Fixed 30px row + always-laid-out actions = zero geometry
291
+ change; the same trick the native headerActions uses (max-width/opacity). */
292
+ .dbs-secHead{position:relative;cursor:pointer;border-radius:8px;height:30px}
293
+ .dbs-secHead:hover{background:var(--dsw-alias-interactive-bg-hover)}
294
+ .dbs-secHead .dbs-rowActions{display:inline-flex;visibility:hidden;opacity:0;pointer-events:none;transition:opacity .12s ease-out}
295
+ .dbs-secHead:hover .dbs-rowActions,.dbs-secHead:focus-within .dbs-rowActions,.dbs-secHead[data-menu="true"] .dbs-rowActions{visibility:visible;opacity:1;pointer-events:auto}
290
296
  .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
297
  .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
298
  .dbs-secMenuItem:hover{background:var(--dsw-alias-interactive-bg-hover)}
@@ -802,6 +808,7 @@
802
808
  manageMembers: null,
803
809
  settingsAgentId: null,
804
810
  sectionMenu: null,
811
+ sectionsOpen: null,
805
812
  /** Bumped on a language switch so module-scope `t` output re-renders. */
806
813
  localeRev: 0,
807
814
  };
@@ -1142,17 +1149,33 @@
1142
1149
  */
1143
1150
  function sectionRows(label, list, addAction, menuKind, menuItems) {
1144
1151
  const menuOpen = s.sectionMenu === menuKind;
1152
+ // Group-header collapse contract, mirrored from 「工作区|Bots」:
1153
+ // chevron + whole-row click toggle, body suppressed when closed.
1154
+ const isOpen = s.sectionsOpen?.[menuKind] !== false;
1155
+ const toggle = () => {
1156
+ patch({ sectionMenu: null, sectionsOpen: { ...(s.sectionsOpen ?? {}), [menuKind]: !isOpen } });
1157
+ };
1145
1158
  return e('div', { key: label }, e('div', {
1146
- className: 'dbs-navBodyErr dbs-secHead',
1159
+ className: 'dbs-navBodyErr dbs-secHead', role: 'button', tabIndex: 0, 'aria-expanded': isOpen,
1160
+ 'data-menu': menuOpen ? 'true' : 'false',
1147
1161
  // Native sectionHeader outdent: label at x=16 (12 sidebar
1148
1162
  // padding + 4), aligned with the group headers. The previous
1149
1163
  // 12px here pushed section labels 8px right of the native
1150
1164
  // baseline, making both sections read horizontally off.
1151
- style: { padding: '4px 8px 2px 4px', display: 'flex', alignItems: 'center' },
1152
- }, e('span', { style: { flex: 1 } }, label),
1165
+ style: { padding: '0 8px 0 4px', display: 'flex', alignItems: 'center', gap: 2 },
1166
+ onClick: toggle,
1167
+ onKeyDown: (ev) => { if (ev.key === 'Enter' || ev.key === ' ') {
1168
+ ev.preventDefault();
1169
+ toggle();
1170
+ } },
1171
+ }, e(Chevron, { open: isOpen }), e('span', { style: { flex: 1 } }, label),
1153
1172
  // 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, {
1173
+ // (.dbs-rowActions is hover-gated in .dbs-secHead CSS); their
1174
+ // clicks must not fold the section with them.
1175
+ e('div', {
1176
+ className: 'dbs-rowActions', style: { alignItems: 'center', gap: 2 },
1177
+ onClick: (ev) => { ev.stopPropagation(); },
1178
+ }, e(Button, {
1156
1179
  variant: 'ghost', size: 'sm', title: addAction.title, 'aria-label': addAction.title,
1157
1180
  icon: Ico('IconPlusOutline16', { size: 14 }),
1158
1181
  onClick: addAction.onClick,
@@ -1165,7 +1188,7 @@
1165
1188
  key: item.label, className: 'dbs-secMenuItem', type: 'button',
1166
1189
  onClick: () => { patch({ sectionMenu: null }); item.onClick(); },
1167
1190
  }, item.label))))
1168
- : null), list.map(row));
1191
+ : null), isOpen ? list.map(row) : null);
1169
1192
  }
1170
1193
  // No footer: the gateway status moved to the Bots group-header dot's
1171
1194
  // hover tooltip (0.2.8) — see SidebarNav's StateDot `title`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-bots",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
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",