@yankeguo/dsh-client-ui-devlead 0.2.2 → 0.2.4

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
@@ -2,22 +2,25 @@
2
2
 
3
3
  Browser half of the DevLead suite, loaded on the DSH **Web** platform.
4
4
 
5
- - **Off state:** a compact ghost icon in the composer toolbar (`conversation.input.left`) sends
6
- `/devlead on`.
7
- - **On state:** a status strip above the composer (`conversation.input.dock`) shows the switch,
8
- watched/running counts, and the latest retained notification; the switch sends `/devlead off`.
5
+ - **Mode switch (both states):** a compact ghost button in the composer toolbar
6
+ (`conversation.input.left`) shows the users icon plus a visible `DevLead` label and sends
7
+ `/devlead on` while the mode is off and `/devlead off` while it is on. The same button stays
8
+ mounted in both states.
9
+ - **On state:** a status strip above the composer (`conversation.input.dock`) shows the brand,
10
+ watched/running counts, and the latest retained notification (or the help hint). The strip is
11
+ display-only and owns no switch.
9
12
  - **Sidebar marks:** enabled Sessions get a shield mark (`sidebar.session.row.trailing`) and a
10
13
  line in the row hover card (`sidebar.session.row.hover`), read from the summary-sized
11
14
  `devLeadMode` projection.
12
15
 
13
- The browser bundle only registers into DSH client slots and sends `/devlead` commands. It has no
14
- custom Remote API, no optimistic state flips, and no direct Host access; all durable state comes
15
- from the `devLead` / `devLeadMode` projections. The locale namespace is `devlead` with `zh` and
16
- `en` dictionaries.
16
+ The browser bundle only registers into DSH client slots and sends `/devlead` commands from the
17
+ toolbar toggle. It has no custom Remote API, no optimistic state flips, and no direct Host access;
18
+ all durable state comes from the `devLead` / `devLeadMode` projections. The locale namespace is
19
+ `devlead` with `zh` and `en` dictionaries.
17
20
 
18
21
  Style injection is reference-counted across **module instances** (`Symbol.for(...)` key on `globalThis`):
19
22
  HMR old/new instances can coexist without an old disposer removing the `<style>` tag a new instance
20
- still uses. The two entry points and `useDevLeadAdmission` have React render tests using
23
+ still uses. The two surfaces and `useDevLeadAdmission` have React render tests using
21
24
  `react-test-renderer` (devDependency only, pure node, no jsdom); the style-tag refcount is covered
22
25
  by a second-module-instance test (`vi.resetModules()` + dynamic import).
23
26
 
@@ -40,8 +43,9 @@ dsh plugin --profile desktop add @yankeguo/dsh-devlead-bundle
40
43
 
41
44
  ## 中文
42
45
 
43
- `@yankeguo/dsh-client-ui-devlead` 是浏览器半边:未开启时的 composer 工具条图标、开启后的
44
- DevLeadBar、侧边栏会话行标记;只读 `devLead`/`devLeadMode` projection 并发送 `/devlead`
45
- 命令。0.2.0 起样式注入用跨模块实例引用计数(HMR 新旧实例交替不误删标签),两个入口与准入
46
- hook 用 `react-test-renderer` 做渲染测试。已知 mark 回填与 blank 行限制见根 README。完整中文文档见
46
+ `@yankeguo/dsh-client-ui-devlead` 是浏览器半边:composer 工具条里两态都存在的 DevLead
47
+ 图标 + 文本开关(关闭态发 `/devlead on`、开启态发 `/devlead off`)、开启后的只读 DevLeadBar 状态条、
48
+ 侧边栏会话行标记;只读 `devLead`/`devLeadMode` projection 并发送 `/devlead` 命令。
49
+ 0.2.0 起样式注入用跨模块实例引用计数(HMR 新旧实例交替不误删标签),组件与准入 hook 用
50
+ `react-test-renderer` 做渲染测试。已知 mark 回填与 blank 行限制见根 README。完整中文文档见
47
51
  [根 README.zh.md](https://github.com/yankeguo/dsh-devlead/blob/main/README.zh.md)与[设计说明](https://github.com/yankeguo/dsh-devlead/blob/main/docs/DESIGN.md)。
package/lib/client.js CHANGED
@@ -134,6 +134,91 @@ window.__ModuleLoader__.load({
134
134
  return { watched: seen.size, running, missing };
135
135
  }
136
136
 
137
+ // packages/client-ui/src/client/DevLeadBar.tsx
138
+ var import_jsx_runtime = require("react/jsx-runtime");
139
+ function DevLeadBar({
140
+ useProjection,
141
+ useSessions,
142
+ useSessionStatus,
143
+ t
144
+ }) {
145
+ const projection = useProjection(DEVLEAD_PROJECTION_KEY);
146
+ const rows = useSessions((state) => state.byId);
147
+ const statuses = useSessionStatus((current) => current);
148
+ const enabled = projection?.enabled ?? false;
149
+ if (projection === void 0 || !enabled) return null;
150
+ const summary = summarizeWatched(projection.sessions, rows, statuses);
151
+ const latest = latestNotification(projection.notifications);
152
+ const notice = latest === null ? null : notificationSummary(latest);
153
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
154
+ "div",
155
+ {
156
+ className: "devlead-dock",
157
+ "data-devlead-bar": "true",
158
+ "data-devlead-enabled": "true",
159
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
160
+ "div",
161
+ {
162
+ className: "devlead-bar",
163
+ role: "group",
164
+ "aria-label": t("bar.aria"),
165
+ children: [
166
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-glyph", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconUsersOutlineRegular, { size: 14 }) }),
167
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-label", children: t("label") }),
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "devlead-meta", children: [
169
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-watched", children: t("count.watched", { count: summary.watched }) }),
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "devlead-running", children: [
171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
172
+ "span",
173
+ {
174
+ className: "devlead-dot",
175
+ "data-active": summary.running > 0 ? "true" : "false",
176
+ "aria-hidden": "true"
177
+ }
178
+ ),
179
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("count.running", { count: summary.running }) })
180
+ ] }),
181
+ summary.missing > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-missing", title: t("count.missing", { count: summary.missing }), children: t("count.missing", { count: summary.missing }) })
182
+ ] }),
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
184
+ "span",
185
+ {
186
+ className: "devlead-notice",
187
+ role: "status",
188
+ "aria-live": "polite",
189
+ "aria-atomic": "true",
190
+ title: notice === null ? t("hint.enabled") : notice.tooltip,
191
+ children: notice === null ? (
192
+ // An enabled Session with no retained notification keeps the help
193
+ // hint visible instead of leaving the row visually empty.
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-hint", children: t("hint.enabled") })
195
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "devlead-notification", children: [
196
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
197
+ "span",
198
+ {
199
+ className: "devlead-notification-dot",
200
+ "data-transition": notice.transition,
201
+ "aria-hidden": "true"
202
+ }
203
+ ),
204
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-who", children: notice.who }),
205
+ notice.turn > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-turn", children: t("notification.turn", { turn: notice.turn }) }),
206
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-label", children: t(notice.labelKey) }),
207
+ notice.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-error", children: notice.error })
208
+ ] })
209
+ }
210
+ )
211
+ ]
212
+ }
213
+ )
214
+ }
215
+ );
216
+ }
217
+
218
+ // packages/client-ui/src/client/DevLeadIconToggle.tsx
219
+ var import_react2 = require("react");
220
+ var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
221
+
137
222
  // packages/client-ui/src/client/results.ts
138
223
  function presentMessage(value) {
139
224
  if (value === void 0) return void 0;
@@ -176,18 +261,6 @@ window.__ModuleLoader__.load({
176
261
  if (failure.kind === "unresolved") return t("error.fallback.unresolved");
177
262
  return failure.message ?? t(FAILURE_FALLBACK_KEYS[failure.kind]);
178
263
  }
179
- function failureCopy(failure) {
180
- switch (failure.kind) {
181
- case "transport":
182
- return failure.message === void 0 ? { key: "error.fallback.transport", params: {} } : { key: "error.command", params: { message: failure.message, code: failure.code } };
183
- case "rejected":
184
- return failure.message === void 0 ? { key: "error.fallback.rejected", params: {} } : { key: "error.rejected", params: { message: failure.message } };
185
- case "unexpected":
186
- return failure.message === void 0 ? { key: "error.fallback.unknown", params: {} } : { key: "error.unknown", params: { message: failure.message } };
187
- case "unresolved":
188
- return { key: "error.unresolved", params: { line: failure.line } };
189
- }
190
- }
191
264
  function createDevLeadAdmissionGate() {
192
265
  let entered = false;
193
266
  return {
@@ -240,139 +313,63 @@ window.__ModuleLoader__.load({
240
313
  return { pending: state.pending, failure: state.failure, run };
241
314
  }
242
315
 
243
- // packages/client-ui/src/client/DevLeadBar.tsx
244
- var import_jsx_runtime = require("react/jsx-runtime");
245
- function DevLeadBar({
246
- useProjection,
247
- useSessions,
248
- useSessionStatus,
249
- executeCommand,
250
- t
251
- }) {
252
- const projection = useProjection(DEVLEAD_PROJECTION_KEY);
253
- const rows = useSessions((state) => state.byId);
254
- const statuses = useSessionStatus((current) => current);
255
- const enabled = projection?.enabled ?? false;
256
- const { pending, failure, run } = useDevLeadAdmission(executeCommand, enabled);
257
- if (projection === void 0 || !enabled) return null;
258
- const summary = summarizeWatched(projection.sessions, rows, statuses);
259
- const latest = latestNotification(projection.notifications);
260
- const notice = latest === null ? null : notificationSummary(latest);
261
- const failureLine = failure === null ? null : failureCopy(failure);
262
- const switchTitle = pending ? t("switch.pending") : t("switch.disable");
263
- const toggle = (next) => {
264
- if (next) return;
265
- run(`/${DEVLEAD_COMMAND_NAME} off`);
266
- };
267
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
268
- "div",
269
- {
270
- className: "devlead-dock",
271
- "data-devlead-bar": "true",
272
- "data-devlead-enabled": "true",
273
- "data-devlead-pending": pending ? "true" : "false",
274
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
275
- "div",
276
- {
277
- className: "devlead-bar",
278
- role: "group",
279
- "aria-label": t("bar.aria"),
280
- "aria-busy": pending,
281
- title: t("hint.enabled"),
282
- children: [
283
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-glyph", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconUsersOutlineRegular, { size: 14 }) }),
284
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-label", children: t("label") }),
285
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
286
- import_dsh_client_ui_primitives.Switch,
287
- {
288
- className: "devlead-switch",
289
- checked: true,
290
- disabled: pending,
291
- label: t("switch.aria"),
292
- title: switchTitle,
293
- onChange: toggle
294
- }
295
- ),
296
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "devlead-meta", children: [
297
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-watched", children: t("count.watched", { count: summary.watched }) }),
298
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "devlead-running", children: [
299
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
300
- "span",
301
- {
302
- className: "devlead-dot",
303
- "data-active": summary.running > 0 ? "true" : "false",
304
- "aria-hidden": "true"
305
- }
306
- ),
307
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("count.running", { count: summary.running }) })
308
- ] }),
309
- summary.missing > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-missing", title: t("count.missing", { count: summary.missing }), children: t("count.missing", { count: summary.missing }) })
310
- ] }),
311
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
312
- "span",
313
- {
314
- className: "devlead-notice",
315
- role: "status",
316
- "aria-live": "polite",
317
- "aria-atomic": "true",
318
- title: notice === null ? t("hint.enabled") : notice.tooltip,
319
- children: notice === null ? (
320
- // An enabled Session with no retained notification keeps the help
321
- // hint visible instead of leaving the row visually empty.
322
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-hint", children: t("hint.enabled") })
323
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "devlead-notification", children: [
324
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
325
- "span",
326
- {
327
- className: "devlead-notification-dot",
328
- "data-transition": notice.transition,
329
- "aria-hidden": "true"
330
- }
331
- ),
332
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-who", children: notice.who }),
333
- notice.turn > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-turn", children: t("notification.turn", { turn: notice.turn }) }),
334
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-label", children: t(notice.labelKey) }),
335
- notice.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-error", children: notice.error })
336
- ] })
337
- }
338
- ),
339
- failureLine !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-error", role: "alert", children: t(failureLine.key, failureLine.params) })
340
- ]
341
- }
342
- )
343
- }
344
- );
345
- }
346
-
347
316
  // packages/client-ui/src/client/DevLeadIconToggle.tsx
348
- var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
349
317
  var import_jsx_runtime2 = require("react/jsx-runtime");
350
318
  function DevLeadIconToggle({ useProjection, executeCommand, t }) {
351
319
  const projection = useProjection(DEVLEAD_PROJECTION_KEY);
352
320
  const enabled = projection?.enabled ?? false;
353
321
  const { pending, failure, run } = useDevLeadAdmission(executeCommand, enabled);
354
- if (projection === void 0 || enabled) return null;
355
- const label = failure === null ? t("toggle.enable") : t("toggle.failed", { message: failureMessage(failure, t) });
322
+ const [attempt, setAttempt] = (0, import_react2.useState)("on");
323
+ if (projection === void 0) return null;
324
+ const direction = enabled ? "off" : "on";
325
+ const failureText = failure === null ? null : failureMessage(failure, t);
326
+ const actionLabel = enabled ? t("toggle.disable") : t("toggle.enable");
327
+ const failureLabel = failureText === null ? null : t(
328
+ attempt === "off" ? "toggle.failed.disable" : "toggle.failed",
329
+ { message: failureText }
330
+ );
331
+ const label = failureLabel ?? (pending ? t("toggle.pending") : actionLabel);
332
+ const status = failureText === null ? null : t(
333
+ attempt === "off" ? "toggle.failed.status.disable" : "toggle.failed.status",
334
+ { message: failureText }
335
+ );
356
336
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
357
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tooltip, { label, side: "top", delayMs: 300, maxWidth: 300, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
358
- import_dsh_client_ui_primitives2.Button,
337
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
338
+ import_dsh_client_ui_primitives2.Tooltip,
359
339
  {
360
- variant: "ghost",
361
- size: "sm",
362
- className: "devlead-toggle",
363
- "aria-label": label,
364
- "aria-busy": pending,
365
- disabled: pending,
366
- "data-devlead-toggle": "true",
367
- "data-devlead-pending": pending ? "true" : "false",
368
- "data-devlead-failed": failure === null ? "false" : "true",
369
- onClick: () => {
370
- run(`/${DEVLEAD_COMMAND_NAME} on`);
371
- },
372
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconUsersOutlineRegular, { size: 16 })
340
+ label,
341
+ side: "top",
342
+ delayMs: 300,
343
+ maxWidth: 300,
344
+ portal: true,
345
+ openOnClick: failure !== null,
346
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
347
+ import_dsh_client_ui_primitives2.Button,
348
+ {
349
+ variant: "ghost",
350
+ size: "sm",
351
+ className: "devlead-toggle",
352
+ "aria-label": label,
353
+ "aria-busy": pending,
354
+ "aria-pressed": enabled,
355
+ disabled: pending,
356
+ "data-devlead-toggle": "true",
357
+ "data-devlead-enabled": enabled ? "true" : "false",
358
+ "data-devlead-pending": pending ? "true" : "false",
359
+ "data-devlead-failed": failure === null ? "false" : "true",
360
+ onClick: () => {
361
+ setAttempt(direction);
362
+ run(`/${DEVLEAD_COMMAND_NAME} ${direction}`);
363
+ },
364
+ children: [
365
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconUsersOutlineRegular, { size: 16 }),
366
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "devlead-toggle-label", children: t("toggle.label") })
367
+ ]
368
+ }
369
+ )
373
370
  }
374
- ) }),
375
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "devlead-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: failure === null ? null : t("toggle.failed.status", { message: failureMessage(failure, t) }) })
371
+ ),
372
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "devlead-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: status })
376
373
  ] });
377
374
  }
378
375
 
@@ -416,21 +413,23 @@ window.__ModuleLoader__.load({
416
413
  // packages/client-ui/src/client/locales.ts
417
414
  var zh = {
418
415
  "meta.title": "DevLead \u754C\u9762",
419
- "meta.description": "DevLead \u6A21\u5F0F\u7684 Web \u754C\u9762\uFF1A\u8F93\u5165\u6846\u5DE5\u5177\u6761\u5F00\u5173\u3001\u6A21\u5F0F\u5F00\u542F\u540E\u663E\u793A\u7684\u72B6\u6001\u6761\uFF0C\u4EE5\u53CA\u4FA7\u8FB9\u680F\u4E2D\u5DF2\u5F00\u542F\u4F1A\u8BDD\u7684 DevLead \u6807\u8BB0\u3002",
416
+ "meta.description": "DevLead \u6A21\u5F0F\u7684 Web \u754C\u9762\uFF1A\u8F93\u5165\u6846\u5DE5\u5177\u6761\u7684 DevLead \u5F00\u5173\uFF08\u4E24\u6001\u5747\u53EF\u5207\u6362\uFF09\u3001\u6A21\u5F0F\u5F00\u542F\u540E\u663E\u793A\u7684\u72B6\u6001\u6761\uFF0C\u4EE5\u53CA\u4FA7\u8FB9\u680F\u4E2D\u5DF2\u5F00\u542F\u4F1A\u8BDD\u7684 DevLead \u6807\u8BB0\u3002",
420
417
  "bar.aria": "DevLead \u72B6\u6001\u680F",
421
418
  "label": "DevLead",
422
- "switch.aria": "DevLead \u6A21\u5F0F",
423
- "switch.disable": "\u5173\u95ED DevLead \u6A21\u5F0F",
424
- "switch.pending": "\u6B63\u5728\u6267\u884C DevLead \u547D\u4EE4\u2026",
425
- "hint.enabled": "DevLead \u5DF2\u5F00\u542F\uFF1A\u5B50\u4F1A\u8BDD\u7684\u8F6E\u6B21\u7ED3\u675F\u4F1A\u901A\u77E5\u5E76\u5524\u9192\u672C\u4F1A\u8BDD\u3002",
419
+ "hint.enabled": "DevLead \u5DF2\u5F00\u542F\uFF1A\u88AB\u76D1\u7763\u4F1A\u8BDD\u7684\u8F6E\u6B21\u7ED3\u675F\u4F1A\u901A\u77E5\u5E76\u5524\u9192\u672C\u4F1A\u8BDD\u3002",
426
420
  "count.watched": "\u76D1\u7763 {count} \u4E2A\u4F1A\u8BDD",
427
421
  "count.running": "\u8FD0\u884C\u4E2D {count}",
428
422
  "count.missing": "{count} \u4E2A\u5DF2\u4E0D\u53EF\u7528",
429
423
  "row.mark.aria": "DevLead \u6A21\u5F0F\u5DF2\u542F\u7528",
430
424
  "row.hover.enabled": "DevLead \u6A21\u5F0F\u5DF2\u542F\u7528\uFF1A\u672C\u4F1A\u8BDD\u53EF\u8C03\u5EA6\u5E76\u76D1\u7763\u5176\u4ED6\u4F1A\u8BDD\u3002",
425
+ "toggle.label": "DevLead",
431
426
  "toggle.enable": "\u5F00\u542F DevLead \u6A21\u5F0F",
432
- "toggle.failed": "\u5F00\u542F DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}\uFF08\u60AC\u505C\u67E5\u770B\uFF0C\u53EF\u91CD\u8BD5\uFF09",
427
+ "toggle.disable": "\u5173\u95ED DevLead \u6A21\u5F0F",
428
+ "toggle.pending": "\u6B63\u5728\u6267\u884C DevLead \u547D\u4EE4\u2026",
429
+ "toggle.failed": "\u5F00\u542F DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
430
+ "toggle.failed.disable": "\u5173\u95ED DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
433
431
  "toggle.failed.status": "\u5F00\u542F DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
432
+ "toggle.failed.status.disable": "\u5173\u95ED DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
434
433
  "notification.turn": "\u7B2C {turn} \u8F6E",
435
434
  "transition.completed": "\u5B8C\u6210",
436
435
  "transition.error": "\u5931\u8D25",
@@ -440,10 +439,6 @@ window.__ModuleLoader__.load({
440
439
  "transition.interrupted": "\u5DF2\u4E2D\u65AD",
441
440
  "transition.forked": "\u5DF2\u5206\u53C9",
442
441
  "transition.unknown": "\u672A\u77E5\u72B6\u6001",
443
- "error.command": "\u547D\u4EE4\u5931\u8D25\uFF1A{message}\uFF08{code}\uFF09",
444
- "error.rejected": "\u547D\u4EE4\u88AB\u62D2\u7EDD\uFF1A{message}",
445
- "error.unknown": "\u547D\u4EE4\u6267\u884C\u5931\u8D25\uFF1A{message}",
446
- "error.unresolved": "\u547D\u4EE4\u672A\u6267\u884C\uFF1AHost \u672A\u8BC6\u522B {line}",
447
442
  "error.fallback.transport": "\u547D\u4EE4\u5931\u8D25",
448
443
  "error.fallback.rejected": "\u547D\u4EE4\u88AB\u62D2\u7EDD",
449
444
  "error.fallback.unknown": "\u672A\u77E5\u9519\u8BEF",
@@ -451,21 +446,23 @@ window.__ModuleLoader__.load({
451
446
  };
452
447
  var en = {
453
448
  "meta.title": "DevLead UI",
454
- "meta.description": "Web UI for DevLead mode: the composer toolbar switch, the status strip shown while the mode is on, and the DevLead mark on enabled Sessions in the sidebar.",
449
+ "meta.description": "Web UI for DevLead mode: the composer-toolbar toggle that switches the mode on or off, the status strip shown while the mode is on, and the DevLead mark on enabled Sessions in the sidebar.",
455
450
  "bar.aria": "DevLead status bar",
456
451
  "label": "DevLead",
457
- "switch.aria": "DevLead mode",
458
- "switch.disable": "Turn off DevLead mode",
459
- "switch.pending": "Running the DevLead command\u2026",
460
452
  "hint.enabled": "DevLead is on: watched-session turn changes notify and wake this session.",
461
453
  "count.watched": "{count} watched",
462
454
  "count.running": "{count} running",
463
455
  "count.missing": "{count} unavailable",
464
456
  "row.mark.aria": "DevLead mode is on",
465
457
  "row.hover.enabled": "DevLead mode is on: this session can dispatch and watch other Sessions.",
458
+ "toggle.label": "DevLead",
466
459
  "toggle.enable": "Turn on DevLead mode",
467
- "toggle.failed": "Could not turn on DevLead mode: {message} (hover to read, then retry)",
460
+ "toggle.disable": "Turn off DevLead mode",
461
+ "toggle.pending": "Running the DevLead command\u2026",
462
+ "toggle.failed": "Could not turn on DevLead mode: {message}",
463
+ "toggle.failed.disable": "Could not turn off DevLead mode: {message}",
468
464
  "toggle.failed.status": "Could not turn on DevLead mode: {message}",
465
+ "toggle.failed.status.disable": "Could not turn off DevLead mode: {message}",
469
466
  "notification.turn": "turn {turn}",
470
467
  "transition.completed": "completed",
471
468
  "transition.error": "failed",
@@ -475,10 +472,6 @@ window.__ModuleLoader__.load({
475
472
  "transition.interrupted": "interrupted",
476
473
  "transition.forked": "forked",
477
474
  "transition.unknown": "unknown state",
478
- "error.command": "Command failed: {message} ({code})",
479
- "error.rejected": "Command rejected: {message}",
480
- "error.unknown": "Command failed: {message}",
481
- "error.unresolved": "Command did not run: the Host did not recognize {line}",
482
475
  "error.fallback.transport": "command failed",
483
476
  "error.fallback.rejected": "command rejected",
484
477
  "error.fallback.unknown": "unknown error",
@@ -489,25 +482,70 @@ window.__ModuleLoader__.load({
489
482
  var STYLE_ATTRIBUTE = "data-plugin-css";
490
483
  var STYLE_KEY = "devlead";
491
484
  var styles = `
492
- /* Composer-tool row control: the 28px round glyph seat of the shipped attach
493
- and mode controls, so the off-state entry reads as one of them. */
485
+ /* Composer-tool row control: the users glyph plus a visible DevLead label. It
486
+ keeps the 28px control height of the toolbar and sizes horizontally from its
487
+ content, rather than occupying a fixed square glyph seat. */
494
488
  .devlead-toggle {
495
489
  flex: none;
496
- width: 28px;
490
+ width: auto;
497
491
  height: 28px;
498
- padding: 0;
492
+ padding: 0 10px;
499
493
  border-radius: 999px;
500
- color: var(--dsw-alias-label-tertiary, GrayText);
494
+ gap: 6px;
495
+ color: var(--dsw-alias-label-secondary, GrayText);
496
+ }
497
+
498
+ .devlead-toggle-label {
499
+ flex: none;
500
+ font-weight: 500;
501
+ white-space: nowrap;
501
502
  }
502
503
 
503
504
  @media (hover: hover) {
504
- .devlead-toggle:hover:not(:disabled) {
505
- color: var(--dsw-alias-label-secondary, GrayText);
505
+ .devlead-toggle:hover:not(:disabled):not([data-devlead-failed="true"]) {
506
+ color: var(--dsw-alias-label-primary, CanvasText);
506
507
  }
507
508
  }
508
509
 
510
+ /* While the mode is on the same button stays in place and reads at full label
511
+ color; a failed settle overrides it and takes over the error color. */
512
+ .devlead-toggle[data-devlead-enabled="true"] {
513
+ color: var(--dsw-alias-label-primary, CanvasText);
514
+ }
515
+
509
516
  .devlead-toggle[data-devlead-failed="true"] {
510
- color: var(--dsw-alias-state-error-primary, #c0392b);
517
+ color: var(--dsw-alias-label-error, #c0392b);
518
+ }
519
+
520
+ /* The shell marks an active toolbar control with a subtle fill; the mode is a
521
+ pressed toggle, not only a colour change, so mirror that affordance. */
522
+ .devlead-toggle[aria-pressed="true"] {
523
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
524
+ }
525
+
526
+ /* On a narrow viewport the visible label and the stale-watch warning would
527
+ squeeze the composer toolbar and the status notice. The toggle keeps its
528
+ accessible name and icon; the bar keeps the watched/running counts. */
529
+ @media (max-width: 480px) {
530
+ .devlead-toggle {
531
+ padding: 0 8px;
532
+ gap: 0;
533
+ }
534
+
535
+ .devlead-toggle-label,
536
+ .devlead-label,
537
+ .devlead-missing {
538
+ display: none;
539
+ }
540
+
541
+ .devlead-bar {
542
+ gap: 6px;
543
+ padding: 4px 10px;
544
+ }
545
+
546
+ .devlead-meta {
547
+ gap: 6px;
548
+ }
511
549
  }
512
550
 
513
551
  .devlead-dock {
@@ -537,12 +575,14 @@ window.__ModuleLoader__.load({
537
575
  align-items: center;
538
576
  gap: 8px;
539
577
  width: 100%;
578
+ min-width: 0;
540
579
  min-height: 34px;
541
580
  margin: 0 auto;
542
- padding: 4px 6px 4px 12px;
581
+ padding: 4px 12px;
582
+ overflow: hidden;
543
583
  border: 0;
544
584
  --dsw-elevation-stroke-color: var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
545
- border-radius: var(--dsw-radius-md, 10px);
585
+ border-radius: var(--dsw-radius-lg, 12px);
546
586
  box-shadow: var(--dsw-elevation-panel, 0 1px 2px rgba(0, 0, 0, 0.08));
547
587
  color: var(--dsw-alias-label-primary, CanvasText);
548
588
  font-size: 13px;
@@ -575,10 +615,6 @@ window.__ModuleLoader__.load({
575
615
  white-space: nowrap;
576
616
  }
577
617
 
578
- .devlead-switch {
579
- flex: none;
580
- }
581
-
582
618
  .devlead-meta {
583
619
  display: inline-flex;
584
620
  flex: none;
@@ -612,7 +648,7 @@ window.__ModuleLoader__.load({
612
648
  }
613
649
 
614
650
  .devlead-missing {
615
- color: var(--dsw-alias-state-warn-primary, #a15c00);
651
+ color: var(--dsw-alias-label-secondary, GrayText);
616
652
  }
617
653
 
618
654
  /* One stable live region wrapping the hint or the latest-notification chip so
@@ -686,21 +722,11 @@ window.__ModuleLoader__.load({
686
722
  flex: 0 1 auto;
687
723
  min-width: 0;
688
724
  overflow: hidden;
689
- color: var(--dsw-alias-state-error-primary, #c0392b);
725
+ color: var(--dsw-alias-label-error, #c0392b);
690
726
  font-size: 12px;
691
727
  text-overflow: ellipsis;
692
728
  }
693
729
 
694
- .devlead-error {
695
- flex: 0 1 auto;
696
- min-width: 0;
697
- overflow: hidden;
698
- color: var(--dsw-alias-state-error-primary, #c0392b);
699
- font-size: 12px;
700
- text-overflow: ellipsis;
701
- white-space: nowrap;
702
- }
703
-
704
730
  /* Visually hidden but announced: the compact toolbar surface has no inline
705
731
  error seat, so its failure text is mirrored into a live region through this
706
732
  class (the shipped visually-hidden idiom used by the chat surfaces). */
@@ -793,7 +819,7 @@ window.__ModuleLoader__.load({
793
819
  name: "conversation.input.left",
794
820
  id: "devlead",
795
821
  // No shipped entry occupies this list; the order only sequences additive
796
- // contributions, so the compact switch stays ahead of any later entry.
822
+ // contributions, so the compact toggle stays ahead of any later entry.
797
823
  order: 12,
798
824
  locale: NS,
799
825
  inject: face
@@ -802,10 +828,10 @@ window.__ModuleLoader__.load({
802
828
  name: "conversation.input.dock",
803
829
  id: "devlead",
804
830
  // The shipped context stack orders Todo (0), Goal (10), and Queue (20):
805
- // the DevLead strip sits directly below the goal card.
831
+ // the status strip sits directly below the goal card. It has no injected
832
+ // command face: only the composer-toolbar toggle submits commands.
806
833
  order: 12,
807
- locale: NS,
808
- inject: face
834
+ locale: NS
809
835
  }, DevLeadBar));
810
836
  ctx.slots.inject("sidebar.session.row.trailing", () => ctx.slots.register({
811
837
  name: "sidebar.session.row.trailing",
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "DevLead UI",
4
- "description": "Web UI for DevLead mode: the composer toolbar switch, the status strip shown while the mode is on, and the DevLead mark on enabled Sessions in the sidebar."
4
+ "description": "Web UI for DevLead mode: the composer-toolbar toggle that switches the mode on or off, the status strip shown while the mode is on, and the DevLead mark on enabled Sessions in the sidebar."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "DevLead 界面",
4
- "description": "DevLead 模式的 Web 界面:输入框工具条开关、模式开启后显示的状态条,以及侧边栏中已开启会话的 DevLead 标记。"
4
+ "description": "DevLead 模式的 Web 界面:输入框工具条的 DevLead 开关(两态均可切换)、模式开启后显示的状态条,以及侧边栏中已开启会话的 DevLead 标记。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yankeguo/dsh-client-ui-devlead",
3
- "version": "0.2.2",
4
- "description": "DevLead surfaces: a compact composer-toolbar switch while off, the full status strip above the composer while the mode is on, and a DevLead mark on the Session's sidebar row.",
3
+ "version": "0.2.4",
4
+ "description": "DevLead surfaces: the composer-toolbar toggle that switches the mode on or off, the status strip above the composer while the mode is on, and a DevLead mark on the Session's sidebar row.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
@@ -35,7 +35,7 @@
35
35
  "@deepseek-ai/cordis": "~4.1.0"
36
36
  },
37
37
  "dependencies": {
38
- "@yankeguo/dsh-devlead-protocol": "0.2.2"
38
+ "@yankeguo/dsh-devlead-protocol": "0.2.4"
39
39
  },
40
40
  "engines": {
41
41
  "dsh": ">=0.2.2-rc.1 <0.3.0"