@qzsy/dsh-yunxiao-panel 1.2.0 → 1.2.1

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/README.md +59 -27
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -24,19 +24,32 @@ and a repository chip row for its merge requests.
24
24
  dynamic-programming fuzzy match): full pinyin (`qunxing`), pinyin initials
25
25
  (`qxkj`), project codes (`QXERP`), and mixed forms all match, and the hit
26
26
  ranges are highlighted in the rows.
27
- - **我的工作台** — aggregates the work items assigned to the token's user across
28
- every Projex project, with:
29
- - KPI cards (**全部工作项 / 未完成 / 缺陷 / 涉及项目**) where the first three act
30
- as filters; 涉及项目 shows its project breakdown as a tooltip,
31
- - a status donut and a type bar list whose **legend and rows are clickable
32
- filters**, plus an adaptive trend chart labelled with its unit and window
33
- (day/week/month, chosen by where the data actually is),
27
+ - **我的工作台** — a cross-project workbench with two scopes, switched at the top
28
+ and remembered per browser:
29
+ - **我的** aggregates the work items assigned to the token's user; **组织** drops
30
+ that filter and covers every open item in the organization (up to 400, open
31
+ ones first), so an organization manager can triage work unrelated to them.
32
+ - a hero card with a status ring (completion in the middle), a plain-language
33
+ summary, and a **优先处理** row that picks the most urgent open item (bugs
34
+ first) and opens it in one click,
35
+ - four clickable KPI cards (**全部工作项 / 未完成 / 缺陷 / 待评审**), then status,
36
+ project, type and trend charts whose **bars, slices and legends filter the
37
+ list**; organization scope adds a **按负责人** chart,
34
38
  - a scrollable **work-item list** (serial, project code + **Chinese project
35
- name**, type, status, relative time) with active-filter chips and a clear
36
- action; rows open the detail pane, which offers **查看项目 / 转为 Issue /
37
- 在对话中处理**,
38
- - merge requests waiting for my review, with a direct link to Yunxiao when the
39
- list is empty.
39
+ name**, assignee in organization scope, type, status, relative time) with
40
+ removable filter chips; rows open the detail pane,
41
+ - merge requests waiting for review (all open ones in organization scope), with
42
+ a direct link to Yunxiao when the list is empty.
43
+ - **Change status from the detail pane** — the pane shows the current status, a
44
+ dropdown of the whole workflow for that work item type, and a **标记完成**
45
+ button that picks the type's own done status (缺陷 → 已修复, 需求 → 已完成, else
46
+ 已关闭). The item is repainted in the detail, every project list and the
47
+ workbench (including its status chart) before the request returns, and a
48
+ failure rolls every snapshot back.
49
+ - **在对话中处理** opens a workspace picker first: it lists the local DSH
50
+ workspaces (suggesting the one whose name matches the repository or project),
51
+ remembers the choice per Yunxiao project, and shows it on the button so the
52
+ next handoff is a single click with a **切换** action beside it.
40
53
  - **Repository page** — clicking any repository (in the repository list or under
41
54
  **未绑定的仓库**) opens its own page with four tabs:
42
55
  **概览 / 提交 / 工作项 / 合并请求**.
@@ -124,23 +137,29 @@ while it revalidates in the background.
124
137
  | Data | Query key | staleTime | gcTime |
125
138
  |---|---|---|---|
126
139
  | bootstrap (repos / namespaces / projects) | `['bootstrap']` | 30s | 10min |
127
- | workbench aggregation | `['workbench']` | 60s | 10min |
140
+ | workbench aggregation (per scope) | `['workbench', scope]` | 30s (+90s poll while visible) | 10min |
128
141
  | work items page | `['workitems', spaceId, category]` | 30s | 10min |
129
142
  | merge requests page | `['prs', repoId, state]` | 30s | 10min |
130
- | one work item | `['workitem', id]` | 60s | 10min |
143
+ | one work item | `['workitem', id]` | 15s | 10min |
144
+ | workflow statuses | `['workflow', spaceId, typeId]` | 10min | 10min |
145
+ | repository detail / activity | `['repo-detail' | 'repo-activity', …]` | 2min | 10min |
146
+ | DSH workspaces | `['workspaces']` | 60s | 10min |
131
147
  | types / members / me | `['workitem-types' | 'members' | 'me', …]` | 5min | 10min |
132
148
 
133
149
  - Window focus and reconnect revalidate stale queries (`refetchOnWindowFocus`).
134
- - **刷新** first clears the Host's own cache and then invalidates every query.
135
- - Creating a work item invalidates `workitems` and `workbench` only.
136
- - Reopening a project or the workbench within `staleTime` renders from cache with
137
- no network request; beyond it, the cached page renders first and revalidates
138
- behind it.
150
+ - **刷新** clears the Host cache, drops the localStorage snapshot, resets every
151
+ query, and tells other open tabs to refresh too.
152
+ - A status write paints the new status into the detail, every project list and the
153
+ workbench immediately, broadcasts it to other tabs, and rolls back on failure.
154
+ - The Host keeps its own short-lived cache and **overlays recent status writes on
155
+ stale search results** for 3 minutes, so a list refetched right after a write
156
+ cannot resurrect the old status.
139
157
  - **localStorage persistence**: 700ms after the cache changes, the freshest
140
- successful queries are snapshotted under `dsh.yunxiao.queryCache.v1`
141
- (2 MB cap, largest entries skipped, failures clear the snapshot). On startup
142
- they are hydrated with their original `updatedAt`, so the first paint after a
143
- reload is instant and a background revalidation follows when the data is stale.
158
+ successful queries are snapshotted under `dsh.yunxiao.queryCache.v2`
159
+ (2 MB cap, largest entries skipped, failures clear the snapshot). Snapshots
160
+ older than 24 hours are discarded on load; the v1 key is removed automatically.
161
+ Hydrated data keeps its original `updatedAt`, so the first paint after a reload
162
+ is instant and a background revalidation follows when the data is stale.
144
163
  - The bundle is generated by `scripts/sync-vendor-query.mjs` from
145
164
  `vendor/react-query.min.cjs` (React stays external and resolves through the
146
165
  host module table); the license is kept at `vendor/react-query.LICENSE`.
@@ -154,7 +173,7 @@ loopback-only same-origin facade at `/api/yunxiao`:
154
173
  |---|---|
155
174
  | `GET /bootstrap` | repositories (all pages), namespaces, projects, connection state |
156
175
  | `GET /repos?page&search` | one page of repositories |
157
- | `GET /workbench` | cross-project aggregation: my items, stats, reviews |
176
+ | `GET /workbench?scope=mine\|org` | cross-project aggregation: items, stats, reviews per scope |
158
177
  | `GET /repo-detail?id` | repository detail + decoded root README |
159
178
  | `GET /repo-activity?id&ref` | recent commits + contributors (avatars) |
160
179
  | `GET /file?repoId&ref&path` | raw file bytes (README images, relative links) |
@@ -165,6 +184,9 @@ loopback-only same-origin facade at `/api/yunxiao`:
165
184
  | `GET /members?spaceId` | project members for the assignee picker |
166
185
  | `GET /me` | the user behind the personal access token |
167
186
  | `POST /workitems` | create a work item (`ProjexCreateWorkitem`) |
187
+ | `GET /workflow?spaceId&typeId` | workflow statuses of a work item type |
188
+ | `POST /workitem-status` | move a work item to another status (`PUT /workitems/{id}`) |
189
+ | `GET /workspaces` | local DSH workspaces for the chat handoff picker |
168
190
  | `GET /prs?repoId&state&page` | `codeup .../changeRequests` |
169
191
  | `GET /status` | token / organization presence |
170
192
  | `POST /refresh` | drop the short-lived cache |
@@ -187,14 +209,24 @@ Published on npm as **`@qzsy/dsh-yunxiao-panel`**. Install it from the Harness
187
209
  Plugin Manager by package name, or during development install this directory
188
210
  with `plugin_manager install_bundle` (absolute package directory).
189
211
 
190
- After installation, reload the Web page; the 云效 icon appears in the left rail
191
- between the command palette and the Git entry.
212
+ Each person needs their own Yunxiao personal access token in the environment
213
+ (see *Data path*); the panel never ships a credential. The token needs Codeup
214
+ read access and Projex read/write access (to change status and create work
215
+ items). After installation and setting the environment variables, restart the
216
+ Harness and reload the Web page; the 云效 icon appears in the left rail between
217
+ the command palette and the Git entry.
218
+
219
+ Project↔repository bindings, the remembered chat workspace and the workbench
220
+ scope live in the browser's local storage, so each teammate binds and picks once
221
+ per browser.
192
222
 
193
223
  ## Test
194
224
 
195
225
  The browser half has a jsdom render test that mounts the real component against
196
226
  a mocked facade and exercises repository switching, the unbound-project state,
197
- the work-item list and detail pane, the chat handoff, and the merge-request tab.
227
+ the work-item list and detail pane, status changes (including the list repaint),
228
+ the chat handoff with its workspace picker and remembered choice, the workbench
229
+ scopes, and the merge-request tab.
198
230
 
199
231
  ```bash
200
232
  npm install --no-save react@18 react-dom@18 jsdom@24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qzsy/dsh-yunxiao-panel",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "description": "Yunxiao (阿里云云效) panel for the DeepSeek Harness Web client: a cross-project workbench with charts, project/repository navigation, Projex work items, Codeup commits and merge requests.",
6
6
  "license": "MIT",