@yankeguo/dsh-client-ui-devlead 0.2.5 → 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 +11 -7
- package/lib/client.js +94 -17
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,13 +11,15 @@ Browser half of the DevLead suite, loaded on the DSH **Web** platform.
|
|
|
11
11
|
watched/running counts, and the newest retained notification or mid-turn report (or the help
|
|
12
12
|
hint). Reports show sender, localized kind, and summary/message; the strip is display-only and
|
|
13
13
|
owns no switch.
|
|
14
|
-
- **Sidebar marks:**
|
|
15
|
-
|
|
16
|
-
`
|
|
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.
|
|
17
19
|
|
|
18
20
|
The browser bundle only registers into DSH client slots and sends `/devlead` commands from the
|
|
19
21
|
toolbar toggle. It has no custom Remote API, no optimistic state flips, and no direct Host access;
|
|
20
|
-
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
|
|
21
23
|
`devlead` with `zh` and `en` dictionaries.
|
|
22
24
|
|
|
23
25
|
Style injection is reference-counted across **module instances** (`Symbol.for(...)` key on `globalThis`):
|
|
@@ -26,8 +28,9 @@ still uses. The two surfaces and `useDevLeadAdmission` have React render tests u
|
|
|
26
28
|
`react-test-renderer` (devDependency only, pure node, no jsdom); the style-tag refcount is covered
|
|
27
29
|
by a second-module-instance test (`vi.resetModules()` + dynamic import).
|
|
28
30
|
|
|
29
|
-
Known UI limits: the
|
|
30
|
-
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.
|
|
31
34
|
|
|
32
35
|
## Install
|
|
33
36
|
|
|
@@ -47,7 +50,8 @@ dsh plugin --profile desktop add @yankeguo/dsh-devlead-bundle
|
|
|
47
50
|
|
|
48
51
|
`@yankeguo/dsh-client-ui-devlead` 是浏览器半边:composer 工具条里两态都存在的 DevLead
|
|
49
52
|
图标 + 文本开关(关闭态发 `/devlead on`、开启态发 `/devlead off`)、开启后的只读 DevLeadBar 状态条、
|
|
50
|
-
|
|
53
|
+
侧边栏激活 lead 的强调色行环(无行尾图标)与已关注会话的弱化准星;只读 `devLead`/`devLeadMode`/
|
|
54
|
+
`devLeadWatch` projection 并发送 `/devlead` 命令。
|
|
51
55
|
0.2.0 起样式注入用跨模块实例引用计数(HMR 新旧实例交替不误删标签),组件与准入 hook 用
|
|
52
56
|
`react-test-renderer` 做渲染测试。已知 mark 回填与 blank 行限制见根 README。完整中文文档见
|
|
53
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,6 +36,7 @@ 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;
|
|
41
42
|
var DEVLEAD_REPORT_KINDS = ["progress", "blocked", "decision", "fyi"];
|
|
@@ -457,15 +458,32 @@ window.__ModuleLoader__.load({
|
|
|
457
458
|
function devLeadRowEnabled(summary) {
|
|
458
459
|
return summary?.projectionValues?.[DEVLEAD_MODE_PROJECTION_KEY]?.enabled === true;
|
|
459
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
|
+
}
|
|
460
471
|
|
|
461
472
|
// packages/client-ui/src/client/DevLeadSessionHoverMark.tsx
|
|
462
473
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
463
474
|
function DevLeadSessionHoverMark({ sessionId, useSessions, t }) {
|
|
464
475
|
const enabled = useSessions((state) => devLeadRowEnabled(state.byId[sessionId]));
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
468
|
-
|
|
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") })
|
|
469
487
|
] });
|
|
470
488
|
}
|
|
471
489
|
|
|
@@ -474,15 +492,27 @@ window.__ModuleLoader__.load({
|
|
|
474
492
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
475
493
|
function DevLeadSessionMark({ sessionId, useSessions, t }) {
|
|
476
494
|
const enabled = useSessions((state) => devLeadRowEnabled(state.byId[sessionId]));
|
|
477
|
-
|
|
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;
|
|
478
508
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
479
509
|
"span",
|
|
480
510
|
{
|
|
481
|
-
className: "devlead-row-mark",
|
|
511
|
+
className: "devlead-row-mark devlead-row-mark-watched",
|
|
482
512
|
role: "img",
|
|
483
|
-
"aria-label": t("row.
|
|
484
|
-
"data-devlead-row-mark": "
|
|
485
|
-
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 })
|
|
486
516
|
}
|
|
487
517
|
);
|
|
488
518
|
}
|
|
@@ -490,15 +520,17 @@ window.__ModuleLoader__.load({
|
|
|
490
520
|
// packages/client-ui/src/client/locales.ts
|
|
491
521
|
var zh = {
|
|
492
522
|
"meta.title": "DevLead \u754C\u9762",
|
|
493
|
-
"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",
|
|
494
524
|
"bar.aria": "DevLead \u72B6\u6001\u680F",
|
|
495
525
|
"label": "DevLead",
|
|
496
|
-
"hint.enabled": "DevLead \u5DF2\u5F00\u542F\uFF1A\
|
|
497
|
-
"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",
|
|
498
528
|
"count.running": "\u8FD0\u884C\u4E2D {count}",
|
|
499
529
|
"count.missing": "{count} \u4E2A\u5DF2\u4E0D\u53EF\u7528",
|
|
500
|
-
"row.mark.aria": "
|
|
501
|
-
"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",
|
|
502
534
|
"toggle.label": "DevLead",
|
|
503
535
|
"toggle.enable": "\u5F00\u542F DevLead \u6A21\u5F0F",
|
|
504
536
|
"toggle.disable": "\u5173\u95ED DevLead \u6A21\u5F0F",
|
|
@@ -530,15 +562,17 @@ window.__ModuleLoader__.load({
|
|
|
530
562
|
};
|
|
531
563
|
var en = {
|
|
532
564
|
"meta.title": "DevLead UI",
|
|
533
|
-
"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.",
|
|
534
566
|
"bar.aria": "DevLead status bar",
|
|
535
567
|
"label": "DevLead",
|
|
536
568
|
"hint.enabled": "DevLead is on: watched-session turn changes notify and wake this session.",
|
|
537
569
|
"count.watched": "{count} watched",
|
|
538
570
|
"count.running": "{count} running",
|
|
539
571
|
"count.missing": "{count} unavailable",
|
|
540
|
-
"row.mark.aria": "DevLead
|
|
541
|
-
"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.",
|
|
542
576
|
"toggle.label": "DevLead",
|
|
543
577
|
"toggle.enable": "Turn on DevLead mode",
|
|
544
578
|
"toggle.disable": "Turn off DevLead mode",
|
|
@@ -864,8 +898,51 @@ window.__ModuleLoader__.load({
|
|
|
864
898
|
color: var(--dsw-alias-label-secondary, GrayText);
|
|
865
899
|
}
|
|
866
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
|
+
|
|
867
934
|
/* Hover-card line explaining the mark; mirrors the shell's hover status rows
|
|
868
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
|
+
|
|
869
946
|
.devlead-row-hover {
|
|
870
947
|
display: flex;
|
|
871
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"
|