@yankeguo/dsh-client-ui-devlead 0.2.4 → 0.2.6
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 +16 -10
- package/lib/client.js +216 -24
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,17 +5,21 @@ Browser half of the DevLead suite, loaded on the DSH **Web** platform.
|
|
|
5
5
|
- **Mode switch (both states):** a compact ghost button in the composer toolbar
|
|
6
6
|
(`conversation.input.left`) shows the users icon plus a visible `DevLead` label and sends
|
|
7
7
|
`/devlead on` while the mode is off and `/devlead off` while it is on. The same button stays
|
|
8
|
-
mounted in both states
|
|
8
|
+
mounted in both states; while the mode is on it gains the business-accent border and a light
|
|
9
|
+
halo, with the border reserved transparent in the off state so the toolbar never shifts.
|
|
9
10
|
- **On state:** a status strip above the composer (`conversation.input.dock`) shows the brand,
|
|
10
|
-
watched/running counts, and the
|
|
11
|
-
display-only and
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
`
|
|
11
|
+
watched/running counts, and the newest retained notification or mid-turn report (or the help
|
|
12
|
+
hint). Reports show sender, localized kind, and summary/message; the strip is display-only and
|
|
13
|
+
owns no switch.
|
|
14
|
+
- **Sidebar marks:** the active DevLead row gets a business-accent ring (scoped by the shell's
|
|
15
|
+
stable `data-row-key` row attribute through `:has`) and deliberately no trailing glyph; watched
|
|
16
|
+
non-lead rows get a quieter target glyph (`IconGoalOutlineRegular`, `sidebar.session.row.trailing`).
|
|
17
|
+
The mark predicates read the summary-sized `devLeadMode` / `devLeadWatch` projections; the row
|
|
18
|
+
hover card (`sidebar.session.row.hover`) restates active/watched for accessibility.
|
|
15
19
|
|
|
16
20
|
The browser bundle only registers into DSH client slots and sends `/devlead` commands from the
|
|
17
21
|
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
|
|
22
|
+
all durable state comes from the `devLead` / `devLeadMode` / `devLeadWatch` projections. The locale namespace is
|
|
19
23
|
`devlead` with `zh` and `en` dictionaries.
|
|
20
24
|
|
|
21
25
|
Style injection is reference-counted across **module instances** (`Symbol.for(...)` key on `globalThis`):
|
|
@@ -24,8 +28,9 @@ still uses. The two surfaces and `useDevLeadAdmission` have React render tests u
|
|
|
24
28
|
`react-test-renderer` (devDependency only, pure node, no jsdom); the style-tag refcount is covered
|
|
25
29
|
by a second-module-instance test (`vi.resetModules()` + dynamic import).
|
|
26
30
|
|
|
27
|
-
Known UI limits: the
|
|
28
|
-
README
|
|
31
|
+
Known UI limits: the marks are subject to the projection-cache backfill described in the repository
|
|
32
|
+
README; DSH 0.2.2-rc.1 does not render the trailing seat on a blank (no-turn-yet) Session row; and
|
|
33
|
+
search results use a separate row surface without that seat, so marks are absent while searching.
|
|
29
34
|
|
|
30
35
|
## Install
|
|
31
36
|
|
|
@@ -45,7 +50,8 @@ dsh plugin --profile desktop add @yankeguo/dsh-devlead-bundle
|
|
|
45
50
|
|
|
46
51
|
`@yankeguo/dsh-client-ui-devlead` 是浏览器半边:composer 工具条里两态都存在的 DevLead
|
|
47
52
|
图标 + 文本开关(关闭态发 `/devlead on`、开启态发 `/devlead off`)、开启后的只读 DevLeadBar 状态条、
|
|
48
|
-
|
|
53
|
+
侧边栏激活 lead 的强调色行环(无行尾图标)与已关注会话的弱化准星;只读 `devLead`/`devLeadMode`/
|
|
54
|
+
`devLeadWatch` projection 并发送 `/devlead` 命令。
|
|
49
55
|
0.2.0 起样式注入用跨模块实例引用计数(HMR 新旧实例交替不误删标签),组件与准入 hook 用
|
|
50
56
|
`react-test-renderer` 做渲染测试。已知 mark 回填与 blank 行限制见根 README。完整中文文档见
|
|
51
57
|
[根 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
|
@@ -36,8 +36,10 @@ window.__ModuleLoader__.load({
|
|
|
36
36
|
// packages/protocol/src/types.ts
|
|
37
37
|
var DEVLEAD_PROJECTION_KEY = "devLead";
|
|
38
38
|
var DEVLEAD_MODE_PROJECTION_KEY = "devLeadMode";
|
|
39
|
+
var DEVLEAD_WATCH_PROJECTION_KEY = "devLeadWatch";
|
|
39
40
|
var DEVLEAD_COMMAND_NAME = "devlead";
|
|
40
41
|
var DEVLEAD_ERROR_EXCERPT_MAX = 240;
|
|
42
|
+
var DEVLEAD_REPORT_KINDS = ["progress", "blocked", "decision", "fyi"];
|
|
41
43
|
|
|
42
44
|
// packages/protocol/src/format.ts
|
|
43
45
|
var DEVLEAD_TRANSITIONS = [
|
|
@@ -86,6 +88,22 @@ window.__ModuleLoader__.load({
|
|
|
86
88
|
const suffix = detail === void 0 ? "" : `: ${detail}`;
|
|
87
89
|
return `${who} \u2014 turn ${notification.turn} ${transitionLabel(notification.transition)}${suffix}`;
|
|
88
90
|
}
|
|
91
|
+
var REPORT_KIND_LABELS = {
|
|
92
|
+
progress: "progress",
|
|
93
|
+
blocked: "blocked",
|
|
94
|
+
decision: "decision needed",
|
|
95
|
+
fyi: "fyi"
|
|
96
|
+
};
|
|
97
|
+
function isDevLeadReportKind(value) {
|
|
98
|
+
return typeof value === "string" && DEVLEAD_REPORT_KINDS.includes(value);
|
|
99
|
+
}
|
|
100
|
+
function reportLine(report) {
|
|
101
|
+
const title = presentLine(report.senderSessionTitle);
|
|
102
|
+
const who = title === void 0 ? report.senderSessionId : `${title} (${report.senderSessionId})`;
|
|
103
|
+
const detail = presentLine(report.summary) ?? excerptLine(report.message, DEVLEAD_ERROR_EXCERPT_MAX);
|
|
104
|
+
const suffix = detail === void 0 ? "" : `: ${detail}`;
|
|
105
|
+
return `${who} \u2014 report ${REPORT_KIND_LABELS[report.kind]}${suffix}`;
|
|
106
|
+
}
|
|
89
107
|
|
|
90
108
|
// packages/client-ui/src/client/format.ts
|
|
91
109
|
var TRANSITION_LABEL_KEYS = {
|
|
@@ -133,6 +151,31 @@ window.__ModuleLoader__.load({
|
|
|
133
151
|
}
|
|
134
152
|
return { watched: seen.size, running, missing };
|
|
135
153
|
}
|
|
154
|
+
var REPORT_LABEL_KEYS = {
|
|
155
|
+
progress: "report.kind.progress",
|
|
156
|
+
blocked: "report.kind.blocked",
|
|
157
|
+
decision: "report.kind.decision",
|
|
158
|
+
fyi: "report.kind.fyi"
|
|
159
|
+
};
|
|
160
|
+
function reportLabelKey(kind) {
|
|
161
|
+
return isDevLeadReportKind(kind) ? REPORT_LABEL_KEYS[kind] : "report.kind.unknown";
|
|
162
|
+
}
|
|
163
|
+
function reportSummary(report) {
|
|
164
|
+
const title = typeof report.senderSessionTitle === "string" ? excerptLine(report.senderSessionTitle, DEVLEAD_ERROR_EXCERPT_MAX) : void 0;
|
|
165
|
+
const who = title ?? report.senderSessionId;
|
|
166
|
+
const detail = typeof report.summary === "string" ? excerptLine(report.summary, DEVLEAD_ERROR_EXCERPT_MAX) : typeof report.message === "string" ? excerptLine(report.message, DEVLEAD_ERROR_EXCERPT_MAX) : void 0;
|
|
167
|
+
return {
|
|
168
|
+
tooltip: isDevLeadReportKind(report.kind) ? reportLine(report) : `${who} \u2014 report ${String(report.kind)}`,
|
|
169
|
+
who,
|
|
170
|
+
kind: String(report.kind),
|
|
171
|
+
labelKey: reportLabelKey(report.kind),
|
|
172
|
+
detail,
|
|
173
|
+
at: typeof report.at === "number" ? report.at : 0
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function latestReport(reports) {
|
|
177
|
+
return reports.at(-1) ?? null;
|
|
178
|
+
}
|
|
136
179
|
|
|
137
180
|
// packages/client-ui/src/client/DevLeadBar.tsx
|
|
138
181
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -149,7 +192,11 @@ window.__ModuleLoader__.load({
|
|
|
149
192
|
if (projection === void 0 || !enabled) return null;
|
|
150
193
|
const summary = summarizeWatched(projection.sessions, rows, statuses);
|
|
151
194
|
const latest = latestNotification(projection.notifications);
|
|
152
|
-
const
|
|
195
|
+
const latestRep = latestReport(projection.reports ?? []);
|
|
196
|
+
const showReport = latestRep !== null && (latest === null || latestRep.at >= latest.at);
|
|
197
|
+
const notice = !showReport && latest !== null ? notificationSummary(latest) : null;
|
|
198
|
+
const reportNotice = showReport && latestRep !== null ? reportSummary(latestRep) : null;
|
|
199
|
+
const tooltip = reportNotice?.tooltip ?? notice?.tooltip ?? t("hint.enabled");
|
|
153
200
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
201
|
"div",
|
|
155
202
|
{
|
|
@@ -187,8 +234,20 @@ window.__ModuleLoader__.load({
|
|
|
187
234
|
role: "status",
|
|
188
235
|
"aria-live": "polite",
|
|
189
236
|
"aria-atomic": "true",
|
|
190
|
-
title:
|
|
191
|
-
children:
|
|
237
|
+
title: tooltip,
|
|
238
|
+
children: reportNotice !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "devlead-notification", "data-report": "true", children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
240
|
+
"span",
|
|
241
|
+
{
|
|
242
|
+
className: "devlead-notification-dot",
|
|
243
|
+
"data-report-kind": reportNotice.kind,
|
|
244
|
+
"aria-hidden": "true"
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-who", children: reportNotice.who }),
|
|
248
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-label", children: t(reportNotice.labelKey) }),
|
|
249
|
+
reportNotice.detail !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-notification-error", children: reportNotice.detail })
|
|
250
|
+
] }) : notice === null ? (
|
|
192
251
|
// An enabled Session with no retained notification keeps the help
|
|
193
252
|
// hint visible instead of leaving the row visually empty.
|
|
194
253
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "devlead-hint", children: t("hint.enabled") })
|
|
@@ -257,8 +316,27 @@ window.__ModuleLoader__.load({
|
|
|
257
316
|
rejected: "error.fallback.rejected",
|
|
258
317
|
unexpected: "error.fallback.unknown"
|
|
259
318
|
};
|
|
319
|
+
var ALREADY_ACTIVE_PREFIX = "Another Session is already in DevLead mode: ";
|
|
320
|
+
var ALREADY_ACTIVE_INSTRUCTION = ". Run /devlead off there first";
|
|
321
|
+
var ALREADY_ACTIVE_ARCHIVED_INSTRUCTION = ". That Session is archived and could not be released automatically;";
|
|
322
|
+
function alreadyActiveDetails(message) {
|
|
323
|
+
if (!message.startsWith(ALREADY_ACTIVE_PREFIX)) return void 0;
|
|
324
|
+
const rest = message.slice(ALREADY_ACTIVE_PREFIX.length);
|
|
325
|
+
const archived = rest.includes(ALREADY_ACTIVE_ARCHIVED_INSTRUCTION);
|
|
326
|
+
const marker = archived ? ALREADY_ACTIVE_ARCHIVED_INSTRUCTION : ALREADY_ACTIVE_INSTRUCTION;
|
|
327
|
+
const end = rest.indexOf(marker);
|
|
328
|
+
if (end <= 0) return void 0;
|
|
329
|
+
const session = rest.slice(0, end).trim();
|
|
330
|
+
return session.length === 0 ? void 0 : { session, archived };
|
|
331
|
+
}
|
|
260
332
|
function failureMessage(failure, t) {
|
|
261
333
|
if (failure.kind === "unresolved") return t("error.fallback.unresolved");
|
|
334
|
+
if (failure.kind === "rejected" && failure.message !== void 0) {
|
|
335
|
+
const active = alreadyActiveDetails(failure.message);
|
|
336
|
+
if (active !== void 0) {
|
|
337
|
+
return t(active.archived ? "error.alreadyActive.archived" : "error.alreadyActive", { session: active.session });
|
|
338
|
+
}
|
|
339
|
+
}
|
|
262
340
|
return failure.message ?? t(FAILURE_FALLBACK_KEYS[failure.kind]);
|
|
263
341
|
}
|
|
264
342
|
function createDevLeadAdmissionGate() {
|
|
@@ -380,15 +458,32 @@ window.__ModuleLoader__.load({
|
|
|
380
458
|
function devLeadRowEnabled(summary) {
|
|
381
459
|
return summary?.projectionValues?.[DEVLEAD_MODE_PROJECTION_KEY]?.enabled === true;
|
|
382
460
|
}
|
|
461
|
+
function devLeadRowWatched(sessionId, byId) {
|
|
462
|
+
const own = byId[sessionId];
|
|
463
|
+
if (devLeadRowEnabled(own)) return false;
|
|
464
|
+
for (const [leadId, lead] of Object.entries(byId)) {
|
|
465
|
+
if (leadId === sessionId || !devLeadRowEnabled(lead)) continue;
|
|
466
|
+
const sessions = lead?.projectionValues?.[DEVLEAD_WATCH_PROJECTION_KEY]?.sessions;
|
|
467
|
+
if (Array.isArray(sessions) && sessions.includes(sessionId)) return true;
|
|
468
|
+
}
|
|
469
|
+
return false;
|
|
470
|
+
}
|
|
383
471
|
|
|
384
472
|
// packages/client-ui/src/client/DevLeadSessionHoverMark.tsx
|
|
385
473
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
386
474
|
function DevLeadSessionHoverMark({ sessionId, useSessions, t }) {
|
|
387
475
|
const enabled = useSessions((state) => devLeadRowEnabled(state.byId[sessionId]));
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
391
|
-
|
|
476
|
+
const watched = useSessions((state) => devLeadRowWatched(sessionId, state.byId));
|
|
477
|
+
if (enabled) {
|
|
478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "devlead-row-hover", "data-devlead-row-hover": "true", children: [
|
|
479
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "devlead-row-hover-glyph", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "devlead-row-hover-active-dot" }) }),
|
|
480
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: t("row.hover.enabled") })
|
|
481
|
+
] });
|
|
482
|
+
}
|
|
483
|
+
if (!watched) return null;
|
|
484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "devlead-row-hover", "data-devlead-row-hover": "true", "data-devlead-row-watched": "true", children: [
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "devlead-row-hover-glyph", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives3.IconGoalOutlineRegular, { size: 14 }) }),
|
|
486
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: t("row.hover.watched") })
|
|
392
487
|
] });
|
|
393
488
|
}
|
|
394
489
|
|
|
@@ -397,15 +492,27 @@ window.__ModuleLoader__.load({
|
|
|
397
492
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
398
493
|
function DevLeadSessionMark({ sessionId, useSessions, t }) {
|
|
399
494
|
const enabled = useSessions((state) => devLeadRowEnabled(state.byId[sessionId]));
|
|
400
|
-
|
|
495
|
+
const watched = useSessions((state) => devLeadRowWatched(sessionId, state.byId));
|
|
496
|
+
if (enabled) {
|
|
497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
498
|
+
"span",
|
|
499
|
+
{
|
|
500
|
+
className: "devlead-sr-only",
|
|
501
|
+
role: "img",
|
|
502
|
+
"aria-label": t("row.mark.aria"),
|
|
503
|
+
"data-devlead-active-mark": "true"
|
|
504
|
+
}
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
if (!watched) return null;
|
|
401
508
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
402
509
|
"span",
|
|
403
510
|
{
|
|
404
|
-
className: "devlead-row-mark",
|
|
511
|
+
className: "devlead-row-mark devlead-row-mark-watched",
|
|
405
512
|
role: "img",
|
|
406
|
-
"aria-label": t("row.
|
|
407
|
-
"data-devlead-row-mark": "
|
|
408
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.
|
|
513
|
+
"aria-label": t("row.watched.aria"),
|
|
514
|
+
"data-devlead-row-mark": "watched",
|
|
515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconGoalOutlineRegular, { size: 13 })
|
|
409
516
|
}
|
|
410
517
|
);
|
|
411
518
|
}
|
|
@@ -413,15 +520,17 @@ window.__ModuleLoader__.load({
|
|
|
413
520
|
// packages/client-ui/src/client/locales.ts
|
|
414
521
|
var zh = {
|
|
415
522
|
"meta.title": "DevLead \u754C\u9762",
|
|
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\
|
|
523
|
+
"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\u6FC0\u6D3B DevLead \u884C\u4E0E\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u7684\u6807\u8BB0\u3002",
|
|
417
524
|
"bar.aria": "DevLead \u72B6\u6001\u680F",
|
|
418
525
|
"label": "DevLead",
|
|
419
|
-
"hint.enabled": "DevLead \u5DF2\u5F00\u542F\uFF1A\
|
|
420
|
-
"count.watched": "\
|
|
526
|
+
"hint.enabled": "DevLead \u5DF2\u5F00\u542F\uFF1A\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u7684\u8F6E\u6B21\u7ED3\u675F\u4F1A\u901A\u77E5\u5E76\u5524\u9192\u672C\u4F1A\u8BDD\u3002",
|
|
527
|
+
"count.watched": "\u5DF2\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD",
|
|
421
528
|
"count.running": "\u8FD0\u884C\u4E2D {count}",
|
|
422
529
|
"count.missing": "{count} \u4E2A\u5DF2\u4E0D\u53EF\u7528",
|
|
423
|
-
"row.mark.aria": "
|
|
424
|
-
"row.
|
|
530
|
+
"row.mark.aria": "\u5F53\u524D\u6FC0\u6D3B\u7684 DevLead \u4F1A\u8BDD",
|
|
531
|
+
"row.watched.aria": "\u88AB\u5F53\u524D DevLead \u5173\u6CE8",
|
|
532
|
+
"row.hover.enabled": "\u5F53\u524D\u6FC0\u6D3B\u7684 DevLead \u4F1A\u8BDD\uFF1A\u53EF\u8C03\u5EA6\u5E76\u5173\u6CE8\u5176\u4ED6\u4F1A\u8BDD\u3002",
|
|
533
|
+
"row.hover.watched": "\u88AB\u5F53\u524D DevLead \u5173\u6CE8\uFF1A\u5B83\u7684\u8F6E\u6B21\u7ED3\u675F\u4F1A\u901A\u77E5\u5E76\u5524\u9192 lead\u3002",
|
|
425
534
|
"toggle.label": "DevLead",
|
|
426
535
|
"toggle.enable": "\u5F00\u542F DevLead \u6A21\u5F0F",
|
|
427
536
|
"toggle.disable": "\u5173\u95ED DevLead \u6A21\u5F0F",
|
|
@@ -431,6 +540,11 @@ window.__ModuleLoader__.load({
|
|
|
431
540
|
"toggle.failed.status": "\u5F00\u542F DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
|
|
432
541
|
"toggle.failed.status.disable": "\u5173\u95ED DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
|
|
433
542
|
"notification.turn": "\u7B2C {turn} \u8F6E",
|
|
543
|
+
"report.kind.progress": "\u8FDB\u5EA6",
|
|
544
|
+
"report.kind.blocked": "\u963B\u585E",
|
|
545
|
+
"report.kind.decision": "\u5F85\u51B3\u7B56",
|
|
546
|
+
"report.kind.fyi": "\u544A\u77E5",
|
|
547
|
+
"report.kind.unknown": "\u62A5\u544A",
|
|
434
548
|
"transition.completed": "\u5B8C\u6210",
|
|
435
549
|
"transition.error": "\u5931\u8D25",
|
|
436
550
|
"transition.blocked": "\u963B\u585E",
|
|
@@ -439,6 +553,8 @@ window.__ModuleLoader__.load({
|
|
|
439
553
|
"transition.interrupted": "\u5DF2\u4E2D\u65AD",
|
|
440
554
|
"transition.forked": "\u5DF2\u5206\u53C9",
|
|
441
555
|
"transition.unknown": "\u672A\u77E5\u72B6\u6001",
|
|
556
|
+
"error.alreadyActive": "\u53E6\u4E00\u4E2A\u4F1A\u8BDD\u5DF2\u5904\u4E8E DevLead \u6A21\u5F0F\uFF1A{session}\u3002\u8BF7\u5148\u5728\u90A3\u91CC\u6267\u884C /devlead off\uFF0C\u518D\u5F00\u542F\u672C\u4F1A\u8BDD\u3002",
|
|
557
|
+
"error.alreadyActive.archived": "\u53E6\u4E00\u4E2A\u4F1A\u8BDD\u5DF2\u5904\u4E8E DevLead \u6A21\u5F0F\uFF1A{session}\u3002\u8BE5\u4F1A\u8BDD\u5DF2\u5F52\u6863\u4E14\u65E0\u6CD5\u81EA\u52A8\u91CA\u653E\uFF1B\u8BF7\u6253\u5F00\u5B83\uFF0C\u6267\u884C /devlead off \u540E\u91CD\u8BD5\u3002",
|
|
442
558
|
"error.fallback.transport": "\u547D\u4EE4\u5931\u8D25",
|
|
443
559
|
"error.fallback.rejected": "\u547D\u4EE4\u88AB\u62D2\u7EDD",
|
|
444
560
|
"error.fallback.unknown": "\u672A\u77E5\u9519\u8BEF",
|
|
@@ -446,15 +562,17 @@ window.__ModuleLoader__.load({
|
|
|
446
562
|
};
|
|
447
563
|
var en = {
|
|
448
564
|
"meta.title": "DevLead UI",
|
|
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
|
|
565
|
+
"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 active-DevLead and watched-session marks in the sidebar.",
|
|
450
566
|
"bar.aria": "DevLead status bar",
|
|
451
567
|
"label": "DevLead",
|
|
452
568
|
"hint.enabled": "DevLead is on: watched-session turn changes notify and wake this session.",
|
|
453
569
|
"count.watched": "{count} watched",
|
|
454
570
|
"count.running": "{count} running",
|
|
455
571
|
"count.missing": "{count} unavailable",
|
|
456
|
-
"row.mark.aria": "DevLead
|
|
457
|
-
"row.
|
|
572
|
+
"row.mark.aria": "Active DevLead Session",
|
|
573
|
+
"row.watched.aria": "Watched by the active DevLead",
|
|
574
|
+
"row.hover.enabled": "Active DevLead Session: this session can dispatch and watch other Sessions.",
|
|
575
|
+
"row.hover.watched": "Watched by the active DevLead: its turn changes notify and wake the lead.",
|
|
458
576
|
"toggle.label": "DevLead",
|
|
459
577
|
"toggle.enable": "Turn on DevLead mode",
|
|
460
578
|
"toggle.disable": "Turn off DevLead mode",
|
|
@@ -464,6 +582,11 @@ window.__ModuleLoader__.load({
|
|
|
464
582
|
"toggle.failed.status": "Could not turn on DevLead mode: {message}",
|
|
465
583
|
"toggle.failed.status.disable": "Could not turn off DevLead mode: {message}",
|
|
466
584
|
"notification.turn": "turn {turn}",
|
|
585
|
+
"report.kind.progress": "progress",
|
|
586
|
+
"report.kind.blocked": "blocked",
|
|
587
|
+
"report.kind.decision": "decision",
|
|
588
|
+
"report.kind.fyi": "fyi",
|
|
589
|
+
"report.kind.unknown": "report",
|
|
467
590
|
"transition.completed": "completed",
|
|
468
591
|
"transition.error": "failed",
|
|
469
592
|
"transition.blocked": "blocked",
|
|
@@ -472,6 +595,8 @@ window.__ModuleLoader__.load({
|
|
|
472
595
|
"transition.interrupted": "interrupted",
|
|
473
596
|
"transition.forked": "forked",
|
|
474
597
|
"transition.unknown": "unknown state",
|
|
598
|
+
"error.alreadyActive": "Another Session is already in DevLead mode: {session}. Run /devlead off there first, then enable this Session.",
|
|
599
|
+
"error.alreadyActive.archived": "Another Session is already in DevLead mode: {session}. That Session is archived and could not be released automatically; open it, run /devlead off, then retry.",
|
|
475
600
|
"error.fallback.transport": "command failed",
|
|
476
601
|
"error.fallback.rejected": "command rejected",
|
|
477
602
|
"error.fallback.unknown": "unknown error",
|
|
@@ -484,12 +609,16 @@ window.__ModuleLoader__.load({
|
|
|
484
609
|
var styles = `
|
|
485
610
|
/* Composer-tool row control: the users glyph plus a visible DevLead label. It
|
|
486
611
|
keeps the 28px control height of the toolbar and sizes horizontally from its
|
|
487
|
-
content, rather than occupying a fixed square glyph seat.
|
|
612
|
+
content, rather than occupying a fixed square glyph seat. The transparent
|
|
613
|
+
1px border is part of the base box (with 1px less padding), so enabling the
|
|
614
|
+
accent border changes colour only, never the control's size or the toolbar
|
|
615
|
+
layout. */
|
|
488
616
|
.devlead-toggle {
|
|
489
617
|
flex: none;
|
|
490
618
|
width: auto;
|
|
491
619
|
height: 28px;
|
|
492
|
-
padding: 0
|
|
620
|
+
padding: 0 9px;
|
|
621
|
+
border: 1px solid transparent;
|
|
493
622
|
border-radius: 999px;
|
|
494
623
|
gap: 6px;
|
|
495
624
|
color: var(--dsw-alias-label-secondary, GrayText);
|
|
@@ -508,13 +637,21 @@ window.__ModuleLoader__.load({
|
|
|
508
637
|
}
|
|
509
638
|
|
|
510
639
|
/* While the mode is on the same button stays in place and reads at full label
|
|
511
|
-
color
|
|
640
|
+
color, with the business accent as a real border plus a very light halo.
|
|
641
|
+
The halo is a box-shadow so it cannot add layout width; the border was
|
|
642
|
+
already reserved (transparent) in the base rule. The failed rule below has
|
|
643
|
+
the same specificity and wins the colour, so an error never leaves a blue
|
|
644
|
+
accent behind. */
|
|
512
645
|
.devlead-toggle[data-devlead-enabled="true"] {
|
|
513
646
|
color: var(--dsw-alias-label-primary, CanvasText);
|
|
647
|
+
border-color: var(--dsw-alias-state-business-primary, #4176e6);
|
|
648
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-state-business-tertiary, rgba(65, 118, 230, 0.12));
|
|
514
649
|
}
|
|
515
650
|
|
|
516
651
|
.devlead-toggle[data-devlead-failed="true"] {
|
|
517
652
|
color: var(--dsw-alias-label-error, #c0392b);
|
|
653
|
+
border-color: var(--dsw-alias-label-error, #c0392b);
|
|
654
|
+
box-shadow: none;
|
|
518
655
|
}
|
|
519
656
|
|
|
520
657
|
/* The shell marks an active toolbar control with a subtle fill; the mode is a
|
|
@@ -528,7 +665,7 @@ window.__ModuleLoader__.load({
|
|
|
528
665
|
accessible name and icon; the bar keeps the watched/running counts. */
|
|
529
666
|
@media (max-width: 480px) {
|
|
530
667
|
.devlead-toggle {
|
|
531
|
-
padding: 0
|
|
668
|
+
padding: 0 7px;
|
|
532
669
|
gap: 0;
|
|
533
670
|
}
|
|
534
671
|
|
|
@@ -705,6 +842,18 @@ window.__ModuleLoader__.load({
|
|
|
705
842
|
background: var(--dsw-alias-state-warn-primary, #a15c00);
|
|
706
843
|
}
|
|
707
844
|
|
|
845
|
+
.devlead-notification-dot[data-report-kind="progress"] {
|
|
846
|
+
background: var(--dsw-alias-state-success-primary, #2e7d32);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.devlead-notification-dot[data-report-kind="blocked"] {
|
|
850
|
+
background: var(--dsw-alias-state-error-primary, #c0392b);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.devlead-notification-dot[data-report-kind="decision"] {
|
|
854
|
+
background: var(--dsw-alias-state-warn-primary, #a15c00);
|
|
855
|
+
}
|
|
856
|
+
|
|
708
857
|
.devlead-notification-who {
|
|
709
858
|
flex: 0 1 auto;
|
|
710
859
|
min-width: 0;
|
|
@@ -749,8 +898,51 @@ window.__ModuleLoader__.load({
|
|
|
749
898
|
color: var(--dsw-alias-label-secondary, GrayText);
|
|
750
899
|
}
|
|
751
900
|
|
|
901
|
+
/* The active lead row gets the same business accent as the toolbar toggle,
|
|
902
|
+
painted as an overlay ring so the 32px row box, padding, and title lane never
|
|
903
|
+
move. Do not color or resize the shell row's border: it has a 3px transparent
|
|
904
|
+
border-inline (paint inset) but no top/bottom border, and an inset box-shadow
|
|
905
|
+
is clipped to the padding box, so either would look thicker/deeper on the
|
|
906
|
+
left/right than on top/bottom. The ::after overlay is positioned against the
|
|
907
|
+
row's border box (negative inline offsets cancel the transparent paint inset)
|
|
908
|
+
and draws one 1px border plus a light outer halo on all four sides at the
|
|
909
|
+
row's own radius. The row owns a stable data-row-key; :has scopes the
|
|
910
|
+
decoration to exactly the active row. The status hook stays mounted while the
|
|
911
|
+
shell hides the resting seat on hover, so the overlay survives hover/focus. */
|
|
912
|
+
[data-row-key^="session:"]:has([data-devlead-active-mark="true"]) {
|
|
913
|
+
position: relative;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
[data-row-key^="session:"]:has([data-devlead-active-mark="true"])::after {
|
|
917
|
+
content: '';
|
|
918
|
+
position: absolute;
|
|
919
|
+
inset: 0 calc(-1 * var(--dsh-sidebar-paint-inset));
|
|
920
|
+
border: 1px solid var(--dsw-alias-state-business-primary, #4176e6);
|
|
921
|
+
border-radius: inherit;
|
|
922
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-state-business-tertiary, rgba(65, 118, 230, 0.12));
|
|
923
|
+
pointer-events: none;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/* A watched row uses a quieter shield than the active lead's mark: secondary
|
|
927
|
+
ink at reduced opacity stays legible in both palettes without competing with
|
|
928
|
+
the active ring. */
|
|
929
|
+
.devlead-row-mark-watched {
|
|
930
|
+
color: var(--dsw-alias-label-secondary, GrayText);
|
|
931
|
+
opacity: 0.62;
|
|
932
|
+
}
|
|
933
|
+
|
|
752
934
|
/* Hover-card line explaining the mark; mirrors the shell's hover status rows
|
|
753
935
|
(12px text on a 20px line) so the card keeps one rhythm. */
|
|
936
|
+
.devlead-row-hover-active-dot {
|
|
937
|
+
display: inline-block;
|
|
938
|
+
flex: none;
|
|
939
|
+
box-sizing: border-box;
|
|
940
|
+
width: 8px;
|
|
941
|
+
height: 8px;
|
|
942
|
+
border: 1px solid var(--dsw-alias-state-business-primary, #4176e6);
|
|
943
|
+
border-radius: 999px;
|
|
944
|
+
}
|
|
945
|
+
|
|
754
946
|
.devlead-row-hover {
|
|
755
947
|
display: flex;
|
|
756
948
|
align-items: center;
|
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 toggle that switches the mode on or off, the status strip shown while the mode is on, and the DevLead
|
|
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 active-DevLead and watched-session marks in the sidebar."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yankeguo/dsh-client-ui-devlead",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@deepseek-ai/cordis": "~4.1.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yankeguo/dsh-devlead-protocol": "0.2.
|
|
38
|
+
"@yankeguo/dsh-devlead-protocol": "0.2.6"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"dsh": ">=0.2.2-rc.1 <0.3.0"
|