@yankeguo/dsh-client-ui-devlead 0.4.2-rc.2 → 0.4.2-rc.5

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 (3) hide show
  1. package/README.md +55 -11
  2. package/lib/client.js +1944 -442
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -23,14 +23,12 @@ Browser half of the DevLead suite, loaded on the DSH **Web** platform.
23
23
  other Session. The page strictly validates schema v1 bytes, follows `workspaceFiles.changes`,
24
24
  groups/sorts project cards, and exposes only refresh/disclosure controls. The page reads the
25
25
  board file directly through the Workspace Files Remote: the schema's 256 KiB file cap applies and
26
- the model tool's separate 64 KiB read cap does not. A not-yet-existing file is not an error — the
27
- panel keeps polling on a bounded backoff (4s growing to 30s) until the first Host write appears —
28
- and the decoder is the same protocol schema implementation the Host validates with (the browser
29
- uses DSH's frozen `zod` platform singleton; no extra runtime dependency). A restored right-Sidebar
26
+ the model tool's separate 64 KiB read cap does not. A not-yet-existing file is not an error, and
27
+ the decoder is the same protocol schema implementation the Host validates with (the browser uses
28
+ DSH's frozen `zod` platform singleton; no extra runtime dependency). A restored right-Sidebar
30
29
  board tab whose on-screen Session is no longer an eligible lead is closed on the first sync even
31
- when this page instance never registered the board surfaces. A collapsed section
32
- joins the authoritative Workspace/Session projections to show registered Workspaces absent from
33
- the board.
30
+ when this page instance never registered the board surfaces. A collapsed section joins the
31
+ authoritative Workspace/Session projections to show registered Workspaces absent from the board.
34
32
  The path comes from the Host global `__DSH_DEVLEAD_BOARD__` when it names this lead
35
33
  (`{ boardPath, schemaVersion, pathPlatform, leadSessionId, override }`); otherwise it is derived
36
34
  from the Session's *original* workspace root as `<cwd>/.dsh/devlead/board.json`. A deployment
@@ -40,6 +38,33 @@ Browser half of the DevLead suite, loaded on the DSH **Web** platform.
40
38
  keeps reading a previous lead's file. The required services follow the default Web composition,
41
39
  and this package has no runtime dependency on the Host package.
42
40
 
41
+ Automatic refresh retains the 120 ms change debounce and polls **every** file state: ready/loading
42
+ use a fixed 5 s cadence by default, while empty/error back off exponentially from 5 s to a 30 s
43
+ ceiling. Timers run only while the document is visible and focused. Visibility/focus resume
44
+ triggers an immediate coalesced read; blur, hidden, unmount, and path changes clear timers. Watch,
45
+ poll, and resume triggers share one in-flight read. A watch ready/change received during that read schedules
46
+ at most one trailing refresh; poll/focus triggers only coalesce, so later changes are neither duplicated nor dropped. Manual refresh can still force a fresh read
47
+ and reconnect the watch; an ended watch never reconnects silently, but polling continues. The
48
+ compact header keeps active/blocked/paused/done KPIs in a single-line pill strip, with
49
+ revision/updated time and Live refresh health. Blocked projects lead with a strong warning; compact
50
+ active cards use responsive two/three-column layouts (one column when narrow), avoid redundant
51
+ visible field labels without dropping information, and give non-obvious icons accessible tooltips.
52
+ Paused/done and unlisted projects are secondary disclosures. Light/dark styling, aria labelling,
53
+ keyboard-native disclosures, narrow-pane focus order, and read-only operation are part of the
54
+ browser acceptance checklist.
55
+
56
+ The client derives `dirname(boardPath)/notes/index.json` from the already-resolved board config;
57
+ it never accepts a user path and performs all index/body I/O through the same read-only Workspace
58
+ Files state machine (`stat`, `readBytes`, `changes`, watch + poll). Cards show note count and
59
+ latest-title chips from index metadata; bodies are not embedded in the index. Opening a note loads
60
+ only that validated `<project.directory>/<note.id>.md` body into a full-pane, read-only reader.
61
+ Both the index and current note refresh automatically after external changes. Empty/missing,
62
+ loading, read, malformed, oversized, and watch-ended states remain distinct; a bad index or note
63
+ degrades only its notes surface, not the board. The dependency-free Markdown subset renders
64
+ headings, paragraphs, lists, quotes, fenced/inline code, emphasis, strikethrough, and explicit
65
+ HTTP(S) links as React elements/text. Raw HTML and dangerous link schemes stay inert text; there is
66
+ no `dangerouslySetInnerHTML` or browser write path.
67
+
43
68
  The browser bundle only registers into DSH client slots and sends `/devlead` commands from the
44
69
  toolbar toggle. It has no custom Remote API, no optimistic state flips, and no direct Host access;
45
70
  DevLead mode state comes from projections, while the board uses DSH's existing read-only Workspace
@@ -80,15 +105,34 @@ dsh plugin --profile desktop add @yankeguo/dsh-devlead-bundle
80
105
  guide 卡片、标题与 Session 头部按钮(头部按钮本身静态注册,其他 Session 下不渲染)。看板严格
81
106
  校验 schema v1、跟随文件变更、分组展示项目与任务,并从未看板 workspace 的 Host 投影生成折叠清单。
82
107
  面板直接经 Workspace Files Remote 读取看板文件(schema 的 256 KiB 文件上限;模型工具另有的
83
- 64 KiB 读取裁剪不作用于面板);文件尚不存在时按有界退避轮询(4s 起、上限 30s)等待首次写入,
84
- 解码器与 Host 共用同一份 protocol schema(浏览器侧 `zod` 来自 DSH 冻结 module table,无额外运行期
85
- 依赖)。恢复出来但当前 on-screen Session 已非合规 lead 的 board tab 会在首次 sync 时被关闭
86
- (即使本页从未注册过看板 surface)。
108
+ 64 KiB 读取裁剪不作用于面板),解码器与 Host 共用同一份 protocol schema(浏览器侧 `zod` 来自 DSH
109
+ 冻结 module table,无额外运行期依赖)。恢复出来但当前 on-screen Session 已非合规 lead 的 board tab
110
+ 会在首次 sync 时被关闭(即使本页从未注册过看板 surface)。
87
111
  路径优先取 Host global `__DSH_DEVLEAD_BOARD__`(新 Host 带 `leadSessionId` 与 `override`),否则由
88
112
  Session 原始 workspace root 派生 `<cwd>/.dsh/devlead/board.json`;配置 `boardPath` 仍是部署级覆盖,
89
113
  但页面若在 lead 出现之前加载,需要刷新才能看到覆盖路径。模式关闭或切换到非 lead Session 会注销全部
90
114
  看板注册并关闭当前 Session 遗留的看板 tab,绝不继续读上一个 lead 的文件。所需服务由默认 Web 组合
91
115
  提供,本包不依赖 Host 包运行期代码。
116
+
117
+ 自动刷新保留 120ms change debounce,并覆盖**所有**文件状态:ready/loading 默认固定 5s 一轮,
118
+ empty/error 从 5s 起指数退避到 30s 上限。只有 document visible 且 focused 时才运行 timer;
119
+ visibility/focus 恢复立即 coalesced read,blur/hidden/unmount/path change 清理 timer;watch、poll 与
120
+ 恢复触发共享 in-flight 读取;在途期间新到的 watch ready/change 合并为一次 trailing refresh(poll/focus
121
+ 只共享当前读取),避免叠发或丢失后续 change。
122
+ 手动刷新仍可强制重读并重连 watch;watch ended 不静默重连,但轮询
123
+ 继续。紧凑顶部以单行 pill strip 显示 active/blocked/paused/done KPI,并保留 revision/updated 与
124
+ Live 自动状态;blocked 强警示置顶,active 主区响应式 2/3 列(窄栏 1 列)。卡片不重复显示可见
125
+ field label,但保留 focus/next/blocker 与任务进度,非自明图标有可访问 tooltip;paused/done/unlisted
126
+ 为次级折叠。light/dark、aria、窄栏焦点顺序、键盘 disclosure 与只读行为均纳入浏览器人工验收。
127
+
128
+ client 从已解析的 board config 派生 `dirname(boardPath)/notes/index.json`,不接受用户路径,index
129
+ 与正文 I/O 都只经既有 Workspace Files `stat/readBytes/changes` 和 watch+poll 状态机。卡片从 metadata
130
+ 显示 note 数与最近标题 chip,index 不含正文;打开 note 时才读取经过校验的
131
+ `<project.directory>/<note.id>.md`,并用全栏只读 reader 展示。index 与当前 note 都会在外部修改后
132
+ 自动刷新;缺失/空、加载、读取/解析错误、超限与 watch ended 分开呈现,坏 index/note 只降级对应
133
+ notes 区域,不影响 board。无依赖 Markdown 子集以 React 元素/文本渲染标题、段落、列表、引用、
134
+ fenced/inline code、强调、删除线与显式 HTTP(S) 链接;raw HTML 和危险 scheme 保持惰性文本,不使用
135
+ `dangerouslySetInnerHTML`,浏览器没有写路径。
92
136
  0.2.0 起样式注入用跨模块实例引用计数(HMR 新旧实例交替不误删标签),组件与准入 hook 用
93
137
  `react-test-renderer` 做渲染测试。已知 mark 回填与 blank 行限制见根 README。完整中文文档见
94
138
  [根 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)。