dsh-jira-work-overview 0.16.5 → 0.16.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/CHANGELOG.md +16 -0
- package/README.md +31 -12
- package/README.zh.md +26 -14
- package/client.js +36 -4
- package/index.js +27 -5
- package/package.json +1 -1
- package/test/README.md +1 -1
- package/test/dsh-jira-plan.mjs +103 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ All notable changes to **dsh-jira-work-overview** are documented here.
|
|
|
4
4
|
|
|
5
5
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The first 25 releases were built in a single day, so the dates are real but the cadence was not: each entry lists what changed, not how long it took.
|
|
6
6
|
|
|
7
|
+
## [0.16.6] - 2026-11-26
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **「计划」不再要求项目先绑定工作区。** 以前项目没挂工作区时点「计划」只报一句「项目还没有绑定工作区」,
|
|
12
|
+
一条会话都不建;现在落点按一条顺序判定:项目已绑定的工作区 → 基座的**默认工作区**
|
|
13
|
+
(`workspaces.initializeDefault()`,与侧栏第一次用时初始化的是同一个),只有连默认工作区都取不到
|
|
14
|
+
(老基座没有工作区服务 / 调用失败)才报错并说明缺什么。host 侧(`createPlanSession`)同样兜底,
|
|
15
|
+
客户端与 host 的中英文案同步改。
|
|
16
|
+
为什么不能只删那句报错:DSH 的 `session.create` 在既无 `workspaceId` 又无 `cwd` 时用的是**基座的
|
|
17
|
+
`defaultCwd`**,不是默认工作区,所以两边都必须显式解析出默认工作区的 id。
|
|
18
|
+
|
|
19
|
+
- **README 把「计划」的落点写清楚了。** 中英两份都新增「落在哪个工作区」的判定顺序、两种落点分别长什么样、
|
|
20
|
+
怎么把已经生成的计划对话挪进项目工作区(先关联、再点 `×` 归档、重新点「计划」),错误表补了
|
|
21
|
+
「计划会话进了 `default-workspace`」一行;`test/README.md` 的套件说明同步。
|
|
22
|
+
|
|
7
23
|
## [0.16.5] - 2026-11-24
|
|
8
24
|
|
|
9
25
|
### Added
|
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Show **your** Jira work items — with their real workflow status — inside [De
|
|
|
38
38
|
DSH installs plugins from an **installation spec** — anything `pnpm add` accepts (registry package name, git URL, tarball, absolute path). Pick one:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
# 1) from the npm registry (published since 0.14.0; pin a version with @0.16.
|
|
41
|
+
# 1) from the npm registry (published since 0.14.0; pin a version with @0.16.6)
|
|
42
42
|
plugin_manager install_bundle(target="dsh-jira-work-overview")
|
|
43
43
|
|
|
44
44
|
# 2) straight from GitHub (no npm publishing needed)
|
|
@@ -98,14 +98,16 @@ Prefer files? Add an override row to your profile's `cordis.patch.yml` (this is
|
|
|
98
98
|
- Click a **status chip** on any row to move the issue; the list reloads. **Esc** closes the top-most layer (status menu → configure dialog → panel).
|
|
99
99
|
- The list is **virtualized**: thousands of rows scroll smoothly because only the visible ones are in the DOM.
|
|
100
100
|
- **Plan at the end of a row** (the `☰ 计划` chip) opens a *planning* conversation for that issue in the
|
|
101
|
-
workspace the project is linked to
|
|
101
|
+
workspace the project is linked to (or in DSH's default Workspace when it is not linked): the new session
|
|
102
|
+
switches to plan mode, receives the issue key, title, status and link, and is told
|
|
102
103
|
to report **only the list of changes it intends to make** — no explanations, no analysis. You approve or amend
|
|
103
104
|
the plan in that conversation, and nothing is executed before you do. If the issue is too thin to plan (no
|
|
104
105
|
description, no parent and no links), the session stops instead of guessing and tells you the Jira issue is
|
|
105
106
|
unclear. One issue maps to one planning session: once bound the chip is highlighted, clicking it reopens the
|
|
106
107
|
existing conversation (the binding lives in the volatile `planSessions` config as `ISSUE<TAB>sessionId`, and a
|
|
107
|
-
lost binding is recovered from the `JIRA_PLAN_SESSION:<KEY>` marker in the session's first message).
|
|
108
|
-
|
|
108
|
+
lost binding is recovered from the `JIRA_PLAN_SESSION:<KEY>` marker in the session's first message). Only
|
|
109
|
+
when neither the project mapping nor DSH's default Workspace can be resolved does the button report what is
|
|
110
|
+
missing; if the profile ships
|
|
109
111
|
`deepseek-ai/dsh-plan-mode`, its `section` is the planning policy, and without it the first message carries a
|
|
110
112
|
built-in one ("plan only, list the changes, execute once the user agrees").
|
|
111
113
|
A planned row also carries a `×`: it archives that conversation through DSH's own workspace archive
|
|
@@ -113,10 +115,24 @@ Prefer files? Add an override row to your profile's `cordis.patch.yml` (this is
|
|
|
113
115
|
unplanned again and the next click starts a fresh session. Archiving keeps the log — a mis-click is
|
|
114
116
|
recoverable from the archive.
|
|
115
117
|
|
|
116
|
-
### Planning:
|
|
118
|
+
### Planning: click `☰ Plan`
|
|
117
119
|
|
|
118
|
-
The `☰ Plan` chip
|
|
119
|
-
|
|
120
|
+
The `☰ Plan` chip at the end of a row creates a **planning-mode conversation** for that issue: the new session
|
|
121
|
+
switches to plan mode, receives the issue key / title / status / link, and is told to report **only the list of
|
|
122
|
+
changes it intends to make** — no explanations, no background, no analysis. You approve or amend the plan in
|
|
123
|
+
that conversation, and nothing is executed before you do. If the card is too thin to plan (no summary, no
|
|
124
|
+
description, no parent and no links), the session stops and says the Jira issue is unclear instead of guessing.
|
|
125
|
+
|
|
126
|
+
**Where the conversation lands** is decided in one place, in this order:
|
|
127
|
+
|
|
128
|
+
1. the workspace the project is linked to (sidebar → *Link Jira project…*), when there is one;
|
|
129
|
+
2. otherwise DSH's **default Workspace** — the same one the sidebar initializes on first use — so an unlinked
|
|
130
|
+
project is no longer a dead end.
|
|
131
|
+
|
|
132
|
+
Either way the session appears in the sidebar immediately and the main view switches to it. A planned row
|
|
133
|
+
always reopens its existing conversation rather than creating a second one, so to file it under a project
|
|
134
|
+
workspace: link the project first, archive the old conversation with `×`, then click *Plan* again. Linking a
|
|
135
|
+
workspace to a project is a one-time four-step job:
|
|
120
136
|
|
|
121
137
|
<img src="docs/images/plan-flow.png" width="1040" alt="Four steps: (1) right-click the workspace row and pick 'Link Jira project…', (2) the panel opens by itself — click the dashed project tab to link it, (3) click the '☰ Plan' chip on a row, (4) back in the panel the chip turns blue and hovering the row shows a ×">
|
|
122
138
|
|
|
@@ -127,9 +143,10 @@ miss. Four steps, and from then on every card is one click away from a planning
|
|
|
127
143
|
to the current workspace." Candidate tabs carry a **dashed** outline — click one to link it; the header then
|
|
128
144
|
reads "This workspace is linked to APP". Candidates appear only after the panel has fetched issues once, so
|
|
129
145
|
hit *Refresh* if there are none.
|
|
130
|
-
3. **Click the `☰ Plan` chip at the end of a row**: creates a planning-mode session in that project's
|
|
131
|
-
|
|
132
|
-
|
|
146
|
+
3. **Click the `☰ Plan` chip at the end of a row**: creates a planning-mode session in that project's
|
|
147
|
+
workspace — or in DSH's default Workspace when the project is not linked. The first message only asks for a
|
|
148
|
+
bullet list of the edits to make, and you agree to it in the conversation. `deepseek-ai/dsh-plan-mode` is
|
|
149
|
+
optional — a built-in policy is used when it is absent.
|
|
133
150
|
4. **Back in the panel**: the chip turns blue (`on`) = planned. Hovering the row reveals a `×` that archives the
|
|
134
151
|
session and clears the binding (recoverable from the archive).
|
|
135
152
|
|
|
@@ -141,8 +158,9 @@ The real panel, for comparison (the two planned rows near the top are outlined):
|
|
|
141
158
|
|
|
142
159
|
| What you see | Why | What to do |
|
|
143
160
|
| --- | --- | --- |
|
|
144
|
-
| `Project APP is not linked to a workspace: link it from the sidebar first.` |
|
|
161
|
+
| `Project APP is not linked to a workspace and no default Workspace could be resolved: link it from the sidebar first.` | Neither the project mapping nor DSH's default Workspace could be resolved (workspace service unavailable / older DSH build) | Redo steps 1–2 above, or install a DSH build that provides the workspace service |
|
|
145
162
|
| No candidate tabs / `No projects to link yet: open the panel once so the project list loads.` | The panel has never fetched issues successfully | Hit *Refresh*; if it still fails, set the site / email / token first |
|
|
163
|
+
| The planning conversation sits under *default-workspace*, not the project workspace | The project was not linked to a workspace when you clicked *Plan*, so it fell back to DSH's default Workspace | Link the project, archive the row with `×`, then click *Plan* again |
|
|
146
164
|
| The workspace context menu has no *Link Jira project…* | The client half of the plugin did not register (the host row can still read active) | Reinstall the bundle and reload the page |
|
|
147
165
|
| The chip stays grey and does nothing | The previous session creation has not returned yet | Wait for it; a failure shows `Could not create the planning session: …` |
|
|
148
166
|
| It always reopens the same conversation | One issue maps to one planning session (by design) | Click `×` to archive it, then click *Plan* again |
|
|
@@ -249,7 +267,7 @@ Behind a corporate proxy on Windows, DSH needs the proxy env vars it was started
|
|
|
249
267
|
|
|
250
268
|
## Versions and upgrades
|
|
251
269
|
|
|
252
|
-
The current version is **0.16.
|
|
270
|
+
The current version is **0.16.6** (2026-11-26). The changelog records 40 versions (from 0.1.0); GitHub carries **15 tags / releases** (0.13.0 → 0.16.6), and **0.13.4 was the first public release** — the earlier 0.1.0–0.12.0 exist only in `CHANGELOG.md` and the project notes, with no commit or tag behind them, so "an older version" means **0.13.0 or later**. Every release is described in [CHANGELOG.md](CHANGELOG.md).
|
|
253
271
|
|
|
254
272
|
### Why people still install older versions
|
|
255
273
|
|
|
@@ -290,6 +308,7 @@ The current version is **0.16.5** (2026-11-24). The changelog records 39 version
|
|
|
290
308
|
| 0.16.3 | 2026-11-23 | **fix** | the Jira site URL is now an editable field in the config page (placeholder = current URL, saved to the profile Cordis patch); the failure hint's **Configure** button matches **Save and verify** |
|
|
291
309
|
| 0.16.4 | 2026-11-23 | **fix** | on a fresh profile, filling email + token + site URL and clicking only **Save & verify** left the URL unsaved, so the panel always said there was no site URL; the panel now also reloads automatically after a successful save |
|
|
292
310
|
| 0.16.5 | 2026-11-24 | feature | **nothing configured shows a form, not an error**: the panel body is the Connect Jira form (site URL / email / API token) in the old failure slot, saved fields can stay empty, and the list reloads once Jira accepts the pair |
|
|
311
|
+
| 0.16.6 | 2026-11-26 | feature | **`☰ Plan` works on an unlinked project too**: the planning conversation lands in the project's workspace when there is one and in DSH's default Workspace otherwise (resolved through `workspaces.initializeDefault()` client-side and `workspaceController.initializeDefault()` host-side); only when neither resolves does it fail, with copy that says so |
|
|
293
312
|
|
|
294
313
|
> 0.1.0–0.12.0 all happened on 2026-11-18; tags and GitHub Releases start at 0.13.0.
|
|
295
314
|
> To install an older version: `plugin_manager install_bundle(target="github:EagleSoap/dsh-jira-work-overview#v0.13.2")`, or pin the npm version with `target="dsh-jira-work-overview@0.14.0"` (the earliest version on npm is 0.14.0).
|
package/README.zh.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
DSH 用**安装 spec** 装插件 —— 凡是 `pnpm add` 能吃的写法都行(registry 包名、git 地址、tarball、绝对路径)。选一个:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
# 1) 从 npm 装(0.14.0 起已发布;要钉版本就在后面写 @0.16.
|
|
24
|
+
# 1) 从 npm 装(0.14.0 起已发布;要钉版本就在后面写 @0.16.6)
|
|
25
25
|
plugin_manager install_bundle(target="dsh-jira-work-overview")
|
|
26
26
|
|
|
27
27
|
# 2) 直接从 GitHub 装(不需要 npm 发布)
|
|
@@ -97,20 +97,30 @@ all : assignee = currentUser() ORDER BY updated DESC
|
|
|
97
97
|
不会出现「慢请求晚到、把新列表盖回旧范围」的闪烁;等待期间旧列表留在原位并压暗到 55%(`.jmw-body.pending`),
|
|
98
98
|
新数据到达时原子替换。注意 `abort()` 只能中断「等结果」,Host 侧已经发出的 Jira 查询无法撤回。
|
|
99
99
|
|
|
100
|
-
###
|
|
100
|
+
### 计划会话:点「计划」→ 敲定计划
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
**任务行末尾的「计划」按钮**会为这张卡新建一条 **plan 模式会话**:新会话切到 plan 模式,收到任务键、
|
|
103
|
+
标题、状态与链接,只被要求「按点列出将要执行的修改任务」——不写解释、背景或分析。计划由你在对话里敲定
|
|
104
|
+
或修改,确认之前它不会执行任何东西。这张卡信息不全(没标题 / 没描述 / 没父任务与关联)时,它会**中断**
|
|
105
|
+
并提示「Jira 任务不明确,无法进行任务」,同时列出缺什么,不会硬猜着往下做。
|
|
106
|
+
|
|
107
|
+
**落在哪个工作区**只有一条判定顺序:
|
|
108
|
+
|
|
109
|
+
1. 项目已经绑定的工作区(左侧栏工作区那一行右键 →「关联 Jira 项目…」);
|
|
110
|
+
2. 没绑(第一次用 / 映射丢了)就落在 DSH 的**默认工作区**——与侧栏第一次用时初始化的是同一个,
|
|
111
|
+
不会因为「还没关联」就把按钮堵死。
|
|
112
|
+
|
|
113
|
+
两种情况新建的会话都会立刻出现在左侧栏、并当场切到主视图。一条任务**只对应一条**计划对话:已计划的行
|
|
114
|
+
再点只打开原来那条,所以想把计划会话挪进项目工作区,先关联项目,再点 `×` 归档旧的那条、重新点「计划」。
|
|
115
|
+
关联一次只要四步(图解见下)。
|
|
116
|
+
|
|
117
|
+
#### 一条任务一条对话
|
|
106
118
|
|
|
107
119
|
建会话用的是 DSH 自己的会话服务(`sessions.create`),所以新会话会立刻出现在侧栏、并当场切到主视图;
|
|
108
120
|
`/plan` 与首条消息都按聊天框同一条路发(命令先、消息后),计划对话里的节奏和你在聊天框里开一条新会话一样。
|
|
109
|
-
一条任务**只对应一条**计划对话:已经计划过的任务按钮标成 `on`,再点只打开原来那条,不会又开一条。
|
|
110
121
|
绑定存在插件的 volatile 配置 `planSessions` 里(一行一条 `ISSUE<TAB>sessionId`);即使换了浏览器、
|
|
111
122
|
清过配置,HOST 也会按计划对话首条消息里的 `JIRA_PLAN_SESSION:<KEY>` 标记翻会话日志把它找回来。
|
|
112
|
-
|
|
113
|
-
第一次用请照下面「四步操作」走一遍。
|
|
123
|
+
只有连默认工作区都取不到(老基座没有工作区服务)时才报错,不会建出半成品会话。
|
|
114
124
|
profile 里装了 `deepseek-ai/dsh-plan-mode` 就用它的 `section` 当规划口径;没装也不影响使用——
|
|
115
125
|
首条消息会自带一份「只做规划、只列修改任务、敲定后再执行」的兜底口径。
|
|
116
126
|
|
|
@@ -118,8 +128,8 @@ profile 里装了 `deepseek-ai/dsh-plan-mode` 就用它的 `section` 当规划
|
|
|
118
128
|
(依次尝试 `remote.workspace.archiveSession` / 工作区注册表 `workspaceRegistry.archiveSession` / `connection.call('workspace/archiveSession')`,与侧栏右键「归档」是同一处状态)把那条会话收进归档区,同时清掉绑定;
|
|
119
129
|
归档后这一行回到未计划状态,再点「计划」是新建一条。归档不删日志,误删可以从归档区恢复。
|
|
120
130
|
|
|
121
|
-
**四步操作(图解)**:入口是任务行末尾的「☰
|
|
122
|
-
|
|
131
|
+
**四步操作(图解)**:入口是任务行末尾的「☰ 计划」;想让计划对话落进某个项目的工作区,就先关联一次
|
|
132
|
+
(不关联也能用,落在默认工作区)。四步走完,之后每张卡都能一键开计划对话:
|
|
123
133
|
|
|
124
134
|
<img src="docs/images/plan-flow.zh.png" width="1040" alt="四步图解:① 左侧栏工作区右键选「关联 Jira 项目…」② 面板自动打开,点带虚线框的项目 tab 完成关联 ③ 任务行末尾点「☰ 计划」④ 回到面板按钮变蓝=已计划,行尾出现 ×">
|
|
125
135
|
|
|
@@ -128,7 +138,7 @@ profile 里装了 `deepseek-ai/dsh-plan-mode` 就用它的 `section` 当规划
|
|
|
128
138
|
2. **点项目 tab 完成关联**:菜单点完面板会自动打开,顶部提示「点上面的项目 tab,把它关联到当前工作区。」,
|
|
129
139
|
候选 tab 带**虚线框**,点哪个就把哪个挂上去;成功后面板顶部变成「当前工作区已关联 APP」。
|
|
130
140
|
候选 tab 要等面板至少拉到过一次 issue 才会出现——一个候选都没有时先点「刷新」。
|
|
131
|
-
3. **点任务行末尾的「☰
|
|
141
|
+
3. **点任务行末尾的「☰ 计划」**:在该项目绑定的工作区里(没绑定就落在默认工作区)新建一条 plan 模式会话,
|
|
132
142
|
首条消息只要求它「按点列出将要执行的修改任务」,由你在对话里敲定;没装 `deepseek-ai/dsh-plan-mode`
|
|
133
143
|
也能用(首条消息自带兜底口径)。
|
|
134
144
|
4. **回到面板看状态**:这一行的按钮变蓝(`on`)=已计划;鼠标移到行上,按钮旁出现 `×`,
|
|
@@ -142,8 +152,9 @@ profile 里装了 `deepseek-ai/dsh-plan-mode` 就用它的 `section` 当规划
|
|
|
142
152
|
|
|
143
153
|
| 看到什么 | 原因 | 怎么办 |
|
|
144
154
|
| --- | --- | --- |
|
|
145
|
-
| `项目 APP
|
|
155
|
+
| `项目 APP 没有绑定工作区,也取不到基座的默认工作区:先在左侧侧栏里把项目挂到工作区。` | 项目映射与基座的默认工作区都取不到(工作区服务不可用 / 老版本基座) | 按上面第 1–2 步重新关联,或升级到提供工作区服务的 DSH 版本 |
|
|
146
156
|
| 一个候选 tab 都没有 / `没有可关联的项目:面板里先拉到过 issue 才会出现项目候选。` | 面板还没成功拉到过数据 | 先点「刷新」,必要时先在配置里补站点 / 邮箱 / 令牌 |
|
|
157
|
+
| 计划会话进了 `default-workspace`,不在项目工作区里 | 点「计划」时这个项目还没绑定工作区,落到了 DSH 的默认工作区 | 先关联项目,再点 `×` 归档这条,重新点「计划」 |
|
|
147
158
|
| 工作区右键菜单里没有「关联 Jira 项目…」 | 客户端的插件模块没注册上(host 行显示 active 也可能如此) | 重新装插件包并刷新页面 |
|
|
148
159
|
| 按钮一直是灰的,点不动 | 上一次建会话还没返回 | 等它结束;失败会显示 `创建计划对话失败:…` |
|
|
149
160
|
| 打开的总是同一条对话 | 一个任务只对应一条计划对话(设计如此) | 想重开就先点 `×` 归档,再点「计划」 |
|
|
@@ -509,7 +520,7 @@ Zed(`zed`)、Sublime Text(`subl`)、gedit(`gedit`)——**找到可
|
|
|
509
520
|
|
|
510
521
|
## 版本与升级
|
|
511
522
|
|
|
512
|
-
当前版本 **0.16.
|
|
523
|
+
当前版本 **0.16.6**(2026-11-26)。`CHANGELOG.md` 记了 40 个版本(0.1.0 起),GitHub 上有 **15 个 tag / Release**(0.13.0 → 0.16.6),**0.13.4 是第一个公开版本**——更早的 0.1.0–0.12.0 只存在于 `CHANGELOG.md` 与项目记录里,没有对应的提交与 tag,所以「以前的版本」= **0.13.0 及以后**。逐版的完整说明见 [CHANGELOG.md](CHANGELOG.md)。
|
|
513
524
|
|
|
514
525
|
### 为什么有人还在装以前的版本
|
|
515
526
|
|
|
@@ -550,6 +561,7 @@ Zed(`zed`)、Sublime Text(`subl`)、gedit(`gedit`)——**找到可
|
|
|
550
561
|
| 0.16.3 | 2026-11-23 | **修复** | 配置页「Jira 连接」的服务地址改成可编辑输入框(placeholder = 当前地址,写进 profile 的 Cordis patch);失败提示里的「去配置」按钮和「保存并验证」同款样式 |
|
|
551
562
|
| 0.16.4 | 2026-11-23 | **修复** | 全新 profile 上把邮箱、令牌、站点地址一起填好、只点「保存并验证」时地址没落盘,面板一直说没配站点地址;配置保存成功后还会自动重拉列表 |
|
|
552
563
|
| 0.16.5 | 2026-11-24 | 功能 | **没配置时给的是表单而不是报错**:面板直接把「连接 Jira」表单(服务地址 / 邮箱 / API token)放在原来的失败位置,已保存的字段可留空,连接成功即重拉列表 |
|
|
564
|
+
| 0.16.6 | 2026-11-26 | 功能 | **项目没绑工作区也能点「计划」**:绑了建在项目的工作区,没绑落到 DSH 的默认工作区(client 走 `workspaces.initializeDefault()`、host 走 `workspaceController.initializeDefault()`),只有两者都取不到才报错,文案也写明是「也取不到默认工作区」 |
|
|
553
565
|
|
|
554
566
|
> 0.1.0–0.12.0 这 15 个版本都发生在 2026-11-18 同一天;0.13.0 起才有 tag 与 Release。
|
|
555
567
|
> 想装某个旧版本:`plugin_manager install_bundle(target="github:EagleSoap/dsh-jira-work-overview#v0.13.2")`,或从 npm 钉版本 `target="dsh-jira-work-overview@0.14.0"`(npm 上最早的版本是 0.14.0)。
|
package/client.js
CHANGED
|
@@ -324,7 +324,7 @@ window.__ModuleLoader__.load({
|
|
|
324
324
|
planDropped: '{key} 的计划对话已删除',
|
|
325
325
|
planDropFailed: '删除计划对话失败:{message}',
|
|
326
326
|
planBusy: '该任务正在建计划对话…',
|
|
327
|
-
planNoWorkspace: '项目 {project}
|
|
327
|
+
planNoWorkspace: '项目 {project} 没有绑定工作区,也取不到基座的默认工作区:先在左侧侧栏里把项目挂到工作区。',
|
|
328
328
|
planFailed: '创建计划对话失败:{message}',
|
|
329
329
|
planCreated: '{key} 的计划对话已创建(plan 模式)',
|
|
330
330
|
planOpened: '已打开 {key} 的计划对话',
|
|
@@ -344,7 +344,7 @@ window.__ModuleLoader__.load({
|
|
|
344
344
|
planDropped: 'Deleted the planning session for {key}',
|
|
345
345
|
planDropFailed: 'Could not delete the planning session: {message}',
|
|
346
346
|
planBusy: 'Creating the planning session…',
|
|
347
|
-
planNoWorkspace: 'Project {project} is not linked to a workspace: link it from the sidebar first.',
|
|
347
|
+
planNoWorkspace: 'Project {project} is not linked to a workspace and no default Workspace could be resolved: link it from the sidebar first.',
|
|
348
348
|
planFailed: 'Could not create the planning session: {message}',
|
|
349
349
|
planCreated: 'Planning session for {key} created (plan mode)',
|
|
350
350
|
planOpened: 'Opened the planning session for {key}',
|
|
@@ -1154,7 +1154,10 @@ window.__ModuleLoader__.load({
|
|
|
1154
1154
|
|
|
1155
1155
|
/* ------------------------------------------------ 任务 → 计划对话 */
|
|
1156
1156
|
//
|
|
1157
|
-
//
|
|
1157
|
+
// 任务行后面的「计划」按钮:开一个 plan 模式会话,让它先做任务规划。
|
|
1158
|
+
// 落在哪个工作区:项目绑了工作区就建在那个工作区里;没绑(第一次用 / 映射丢了)就建在
|
|
1159
|
+
// 基座的**默认工作区**里(`workspaces.initializeDefault()`:与侧栏第一次用时建的是同一个),
|
|
1160
|
+
// 不再直接报错——按钮不该因为「还没关联」就什么都做不了。
|
|
1158
1161
|
// 一个任务只对应一个计划对话(避免重复点出好几条):绑定记在 host 的 volatile 配置
|
|
1159
1162
|
// planSessions 里(一行一条 `ISSUE<TAB>sessionId`),和「项目 ↔ 工作区」同一个套路——
|
|
1160
1163
|
// 前端只读写、不另存。重复点击时直接打开原来那条,不再新建;本地没记(比如换了浏览器)
|
|
@@ -1263,6 +1266,34 @@ window.__ModuleLoader__.load({
|
|
|
1263
1266
|
return '';
|
|
1264
1267
|
}
|
|
1265
1268
|
|
|
1269
|
+
/**
|
|
1270
|
+
* 项目没绑工作区时的落点:基座的「默认工作区」。
|
|
1271
|
+
*
|
|
1272
|
+
* 走客户端常驻的 `workspaces` 服务(不是 `remote.workspace`:面板没在 inject 里声明遥控,
|
|
1273
|
+
* 硬取会抛 `cannot get property "remote.workspace" without inject`):`initializeDefault()`
|
|
1274
|
+
* 已经初始化过就直接返回那条,没有才按基座的目录策略建一个——与侧栏第一次用时的默认工作区
|
|
1275
|
+
* 是同一个,之后会话自动归到它下面。服务缺席(老基座)或调用失败时返回空串,由调用方报错。
|
|
1276
|
+
*/
|
|
1277
|
+
async function defaultWorkspaceId() {
|
|
1278
|
+
const ctx = runtime.ctx;
|
|
1279
|
+
if (!ctx || typeof ctx.get !== 'function') return '';
|
|
1280
|
+
let workspaces;
|
|
1281
|
+
try {
|
|
1282
|
+
workspaces = ctx.get('workspaces');
|
|
1283
|
+
} catch {
|
|
1284
|
+
return '';
|
|
1285
|
+
}
|
|
1286
|
+
if (!workspaces || typeof workspaces.initializeDefault !== 'function') return '';
|
|
1287
|
+
try {
|
|
1288
|
+
const result = await workspaces.initializeDefault();
|
|
1289
|
+
if (result && result.ok === false) return '';
|
|
1290
|
+
const workspace = result?.value?.workspace ?? result?.workspace ?? result?.value ?? result;
|
|
1291
|
+
return String(workspace?.workspaceId ?? workspace?.id ?? '');
|
|
1292
|
+
} catch {
|
|
1293
|
+
return '';
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1266
1297
|
/** 让新建的计划对话出现在主视图:uiWorkspace 是官方的换主视图接口。 */
|
|
1267
1298
|
function openPlanSession(sessionId) {
|
|
1268
1299
|
const ctx = runtime.ctx;
|
|
@@ -1349,7 +1380,8 @@ window.__ModuleLoader__.load({
|
|
|
1349
1380
|
try {
|
|
1350
1381
|
await fetchWorkspaceLinks();
|
|
1351
1382
|
const project = projectOfKey(key);
|
|
1352
|
-
|
|
1383
|
+
// 绑定了就建在项目的工作区里;没绑定落默认工作区(取不到才报错)。
|
|
1384
|
+
const workspaceId = boundWorkspaceOf(project) || await defaultWorkspaceId();
|
|
1353
1385
|
if (!workspaceId) throw new Error(t('planNoWorkspace', { project }));
|
|
1354
1386
|
// 计划口径:profile 装了 plan 模式插件就用它的 section;没装时由首条消息自己带一份
|
|
1355
1387
|
// (NO_POLICY_POLICY),不因为「宿主没配」就拒绝开对话。
|
package/index.js
CHANGED
|
@@ -317,7 +317,7 @@ const TEXT = {
|
|
|
317
317
|
'err.projectKey': '无效的项目键:「{project}」,应为大写字母开头的字母数字串(如 APP)。',
|
|
318
318
|
'err.projectWorkspaceId': '缺少工作区 id:没法把项目挂到工作区上。',
|
|
319
319
|
'err.planIssue': '无效的 issue key:「{issue}」,应形如 APP-3489。',
|
|
320
|
-
'err.planWorkspaceId': '
|
|
320
|
+
'err.planWorkspaceId': '取不到工作区 id:项目没有绑定工作区,也取不到基座的默认工作区。',
|
|
321
321
|
'err.planAction': '不支持的计划对话操作:{action}(支持 create / search / link / unlink / drop / clear)。',
|
|
322
322
|
'err.planUnbound': '{key} 没有绑定计划对话:没有可归档的会话。',
|
|
323
323
|
'err.planArchive': '归档计划对话失败:{message}',
|
|
@@ -520,7 +520,7 @@ const TEXT = {
|
|
|
520
520
|
'err.projectKey': 'Invalid project key: "{project}"; expected an uppercase alphanumeric key such as APP.',
|
|
521
521
|
'err.projectWorkspaceId': 'Missing workspace id: cannot link a project to a workspace.',
|
|
522
522
|
'err.planIssue': 'Invalid issue key: "{issue}"; expected a key such as APP-3489.',
|
|
523
|
-
'err.planWorkspaceId': '
|
|
523
|
+
'err.planWorkspaceId': 'No workspace id: the project has no linked workspace and no default Workspace could be resolved.',
|
|
524
524
|
'err.planAction': 'Unsupported planning-session action: {action} (create / search / link / unlink / drop / clear).',
|
|
525
525
|
'err.planUnbound': '{key} has no bound planning session: nothing to archive.',
|
|
526
526
|
'err.planArchive': 'Could not archive the planning session: {message}',
|
|
@@ -3075,8 +3075,10 @@ function registerProjectWorkspaceRoute(ctx, jira, settings) {
|
|
|
3075
3075
|
|
|
3076
3076
|
/* --------------------------------------------- 任务 → 计划对话 */
|
|
3077
3077
|
//
|
|
3078
|
-
//
|
|
3079
|
-
//
|
|
3078
|
+
// 面板任务行末尾的「计划」按钮:开一条 plan 模式会话,先做任务规划,由用户在对话里敲定或修改。
|
|
3079
|
+
// 落点:项目绑了工作区就建在那个工作区里;没绑(第一次用 / 映射丢了)就建在基座的**默认工作区**
|
|
3080
|
+
// (workspace 控制器的 `initializeDefault()`,与侧栏第一次用时是同一个),只有连它都取不到才报错。
|
|
3081
|
+
// **一个任务只对应一条计划对话**——绑定存成一串
|
|
3080
3082
|
// `ISSUE<TAB>sessionId`(Config 的 planSessions,volatile,和 projectWorkspaces 同一个存法),
|
|
3081
3083
|
// 重复点击时前端先查这里,命中就只打开。
|
|
3082
3084
|
//
|
|
@@ -3244,13 +3246,33 @@ async function findPlanSessionByToken(ctx, key) {
|
|
|
3244
3246
|
return '';
|
|
3245
3247
|
}
|
|
3246
3248
|
|
|
3249
|
+
/**
|
|
3250
|
+
* 项目没绑工作区时的落点:基座的「默认工作区」。
|
|
3251
|
+
*
|
|
3252
|
+
* 走 workspace 控制器自己的 `initializeDefault()`:已经初始化过就直接返回那条 durable 工作区,
|
|
3253
|
+
* 没有才按基座的目录策略建一个——与侧栏第一次用时的默认工作区是同一个。服务缺席(老基座)
|
|
3254
|
+
* 或调用失败时返回空串,由调用方报 `err.planWorkspaceId`。
|
|
3255
|
+
*/
|
|
3256
|
+
async function defaultPlanWorkspaceId(ctx) {
|
|
3257
|
+
const controller = safeService(ctx, 'workspaceController');
|
|
3258
|
+
if (!controller || typeof controller.initializeDefault !== 'function') return '';
|
|
3259
|
+
try {
|
|
3260
|
+
const result = await controller.initializeDefault();
|
|
3261
|
+
const workspace = result?.workspace ?? result?.value?.workspace ?? result?.value ?? result;
|
|
3262
|
+
return String(workspace?.workspaceId ?? workspace?.id ?? '');
|
|
3263
|
+
} catch {
|
|
3264
|
+
return '';
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
|
|
3247
3268
|
/**
|
|
3248
3269
|
* 建一条计划对话:工作区里新建会话 → /plan 进计划模式 → 投递首条消息。
|
|
3249
3270
|
* 顺序是「先 plan 再投递」:会话是新的,命令当场生效;即便宿主把它排到第一次 step,
|
|
3250
3271
|
* 也仍然排在任务消息之前。
|
|
3251
3272
|
*/
|
|
3252
3273
|
async function createPlanSession(ctx, jira, payload, key) {
|
|
3253
|
-
|
|
3274
|
+
// 绑了工作区就建在项目的工作区里;没绑(第一次用 / 映射丢了)落默认工作区。
|
|
3275
|
+
const workspaceId = String(payload?.workspaceId ?? '').trim() || await defaultPlanWorkspaceId(ctx);
|
|
3254
3276
|
if (!workspaceId) throw new Error(t('err.planWorkspaceId'));
|
|
3255
3277
|
const signal = payload?.signal;
|
|
3256
3278
|
const issue = await fetchPlanIssue(jira, key, signal);
|
package/package.json
CHANGED
package/test/README.md
CHANGED
|
@@ -49,7 +49,7 @@ skip without `JIRA_*` credentials (no secrets are configured on purpose — this
|
|
|
49
49
|
| `dsh-jira-bundle-id.mjs` | no | package identity: `__ModuleLoader__.load({ id })` === `package.json.name` === `cordis.patch.yml insert[].name`, no `@local/` leftovers, client half still a `{ id, factory(require) }` bundle that imports no `@deepseek-ai/*` |
|
|
50
50
|
| `dsh-jira-visual.mjs` | no | rendering: grouping, collapse, project tabs, status filter, header total, priority highlight, **virtualization** (windowed DOM vs. placeholder height), **in-place status change** (no `/jira` re-fetch, local row + counts), fallback when `@tanstack/react-virtual` is missing |
|
|
51
51
|
| `dsh-jira-selfwatch.mjs` | no | the watch loop's diff: someone else's status change notifies, a change **you** made (panel POST or `jira_transition`) is swallowed and its baseline advanced, a colleague changing it right afterwards still notifies, a failed write leaves no stale expectation |
|
|
52
|
-
| `dsh-jira-plan.mjs` | no | the per-row **「计划」 button** end to end: a planning session is created in the project's linked workspace, `/plan` runs before the first message, that message carries the `JIRA_PLAN_SESSION:<KEY>` token plus the "only report the changes to make" / "stop if the issue is unclear" rules, a second click reuses the same session (local binding, then a token search through the session log), gaps are listed for a thin issue, and a
|
|
52
|
+
| `dsh-jira-plan.mjs` | no | the per-row **「计划」 button** end to end: a planning session is created in the project's linked workspace (or in DSH's default Workspace when the project is not linked), `/plan` runs before the first message, that message carries the `JIRA_PLAN_SESSION:<KEY>` token plus the "only report the changes to make" / "stop if the issue is unclear" rules, a second click reuses the same session (local binding, then a token search through the session log), gaps are listed for a thin issue, and a workspace that cannot be resolved at all fails loudly (a missing plan-mode policy does not) |
|
|
53
53
|
| `dsh-jira-workspace-menu.mjs` | no | the workspace context menu **when `contextMenus` arrives late**: the plugin waits for the service via `ctx.inject` (a single `ctx.get` at apply used to lose the 「关联 Jira 项目…」 entry for the whole page), then registers a `workspace` contribution whose entry opens the panel and reads the link mapping; also covers the older host without `ctx.inject` |
|
|
54
54
|
| `dsh-jira-credential.mjs` | no | configure dialog + all six fetch routes: token/email save, verification and rejection, masked value, two-step clear, watch/language/fetch-size writes, paging (`--limit=0`, safety cap) |
|
|
55
55
|
| `dsh-jira-i18n.mjs` | no | language matrix (`DSH_JIRA_LANG`, `--lang`, `?lang`, config, host preference), Jira data kept verbatim, dictionary parity (zh/en key sets), host paging assertions, the "open `cordis.patch.yml`" route |
|
package/test/dsh-jira-plan.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import { prepareHostCopy, skipWhenUnavailable } from './lib-host-runtime.mjs';
|
|
|
3
3
|
//
|
|
4
4
|
// 全程不联网:Jira、DSH 的 remote / workspace / agents 服务都用桩,但**跑的是真的 index.js 与 client.js**。
|
|
5
5
|
// 覆盖的正是需求本身:
|
|
6
|
-
// 1.
|
|
6
|
+
// 1. 点「计划」在项目绑定的工作区里建会话(项目没绑就落基座的默认工作区),/plan 先于第一条消息;
|
|
7
7
|
// 2. 第一条消息只含「任务 + 汇报口径 + 规则」,且带 `JIRA_PLAN_SESSION:<KEY>` 标记;
|
|
8
8
|
// 3. 同一张卡再点一次不再新建(本地绑定命中;清掉本地配置后靠会话日志里的标记找回);
|
|
9
|
-
// 4.
|
|
9
|
+
// 4. 连默认工作区都取不到(老基座)→ 明确报错,一条会话都不建;没配 plan 模式照样能规划;
|
|
10
10
|
// 5. Jira 卡信息不全 → 首条消息里带「中断并告诉用户任务不明确」的指令,规划提示里也列出缺什么。
|
|
11
11
|
import { copyFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
12
12
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
@@ -46,6 +46,17 @@ const JIRA_ISSUES = {
|
|
|
46
46
|
key: 'APP-2',
|
|
47
47
|
fields: { summary: '', status: { name: 'To Do' }, issuetype: { name: 'Task' }, description: { type: 'doc', content: [] }, issuelinks: [] },
|
|
48
48
|
},
|
|
49
|
+
'APP-9': {
|
|
50
|
+
// 没绑定工作区的项目:用来验证「落到默认工作区」。
|
|
51
|
+
key: 'APP-9',
|
|
52
|
+
fields: {
|
|
53
|
+
summary: '导出当前筛选结果',
|
|
54
|
+
status: { name: 'To Do' },
|
|
55
|
+
issuetype: { name: 'Task' },
|
|
56
|
+
description: { type: 'doc', content: [{ type: 'paragraph', content: [{ type: 'text', text: '按当前筛选条件导出 CSV。' }] }] },
|
|
57
|
+
issuelinks: [],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
49
60
|
};
|
|
50
61
|
const jiraCalls = [];
|
|
51
62
|
|
|
@@ -55,6 +66,9 @@ const settingsWrites = [];
|
|
|
55
66
|
/* 「删掉计划对话」走的是基座的归档通道:记录调用,必要时模拟基座拒收。 */
|
|
56
67
|
const archiveCalls = [];
|
|
57
68
|
const connectionCalls = [];
|
|
69
|
+
/* 默认工作区(未绑定项目的落点):由 workspace 控制器提供,`false` = 老基座取不到。 */
|
|
70
|
+
let defaultWorkspaceAvailable = true;
|
|
71
|
+
const defaultWorkspaceCalls = [];
|
|
58
72
|
const registryArchiveCalls = [];
|
|
59
73
|
let registryArchiveRefuses = false;
|
|
60
74
|
let archiveRefuses = false;
|
|
@@ -83,7 +97,21 @@ const hostCtx = {
|
|
|
83
97
|
};
|
|
84
98
|
}
|
|
85
99
|
if (name === 'workspace') {
|
|
86
|
-
return {
|
|
100
|
+
return {
|
|
101
|
+
async get(id) {
|
|
102
|
+
if (id === 'ws-uuid-1') return { id, path: TMP, title: 'tmp' };
|
|
103
|
+
if (id === 'ws-default-1') return { id, path: TMP, title: 'default-workspace' };
|
|
104
|
+
return undefined;
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (name === 'workspaceController') {
|
|
109
|
+
return {
|
|
110
|
+
async initializeDefault() {
|
|
111
|
+
defaultWorkspaceCalls.push(true);
|
|
112
|
+
return defaultWorkspaceAvailable ? { workspace: { workspaceId: 'ws-default-1', path: TMP, title: 'default-workspace' } } : undefined;
|
|
113
|
+
},
|
|
114
|
+
};
|
|
87
115
|
}
|
|
88
116
|
if (name === 'remote') return remoteService;
|
|
89
117
|
// 工作区注册表本体:服务树上的键是 `workspaceRegistry`,`archivedSessionIds` 就是它写的。
|
|
@@ -319,11 +347,21 @@ check(dropAgain.ok === false && /绑定|bound/i.test(String(dropAgain.error)), '
|
|
|
319
347
|
|
|
320
348
|
/* ------------------------------------------------------------- 场景 5 */
|
|
321
349
|
|
|
322
|
-
|
|
350
|
+
console.log('\n场景 4(默认工作区 / 参数错误)');
|
|
351
|
+
// 项目没绑工作区:落到基座的默认工作区(而不是直接报错不建)。
|
|
352
|
+
const defaultCreate = await planPayload({ action: 'create', issue: 'APP-9' });
|
|
353
|
+
syncWrites();
|
|
354
|
+
check(defaultCreate.ok === true && Boolean(defaultCreate.sessionId), '没绑定工作区的项目在默认工作区建出计划对话', JSON.stringify({ ok: defaultCreate.ok, sessionId: defaultCreate.sessionId }));
|
|
355
|
+
const defaultCreateCall = [...remoteCalls].reverse().find((call) => call.call === 'create');
|
|
356
|
+
check(defaultCreateCall?.workspaceId === 'ws-default-1', '建会话用的是基座默认工作区 id', JSON.stringify(defaultCreateCall ?? null));
|
|
357
|
+
check(defaultWorkspaceCalls.length > 0, '默认工作区走 workspaceController.initializeDefault()', String(defaultWorkspaceCalls.length));
|
|
358
|
+
// 连默认工作区都取不到(老基座 / 服务缺席)才报错。
|
|
359
|
+
defaultWorkspaceAvailable = false;
|
|
360
|
+
const noWorkspace = await planPayload({ action: 'create', issue: 'APP-10' });
|
|
361
|
+
defaultWorkspaceAvailable = true;
|
|
323
362
|
const badAction = await planPayload({ action: 'nope', issue: 'APP-1' });
|
|
324
363
|
const badKey = await planPayload({ action: 'link', issue: 'not-a-key', sessionId: 'x' });
|
|
325
|
-
|
|
326
|
-
check(noWorkspace.ok === false && /工作区/.test(noWorkspace.error), '缺工作区 id → 明确报错', noWorkspace.error);
|
|
364
|
+
check(noWorkspace.ok === false && /工作区/.test(noWorkspace.error), '默认工作区也取不到 → 明确报错', noWorkspace.error);
|
|
327
365
|
check(badAction.ok === false && /plan/.test(String(badAction.error)) === false && /操作|action/i.test(String(badAction.error)), '不支持的动作 → 明确报错', badAction.error);
|
|
328
366
|
check(badKey.ok === false && /issue|key|APP-3489/i.test(String(badKey.error)), '非法 issue key → 明确报错', badKey.error);
|
|
329
367
|
|
|
@@ -500,6 +538,9 @@ const clientSessionsService = {
|
|
|
500
538
|
},
|
|
501
539
|
};
|
|
502
540
|
const clientOpened = [];
|
|
541
|
+
/* 基座的默认工作区:未绑定项目的落点;设成 null 模拟老基座取不到。 */
|
|
542
|
+
let clientDefaultWorkspace = { workspaceId: 'ws-default-1', sessionIds: [] };
|
|
543
|
+
const clientDefaultWorkspaceCalls = [];
|
|
503
544
|
const clientCtx = {
|
|
504
545
|
get(name) {
|
|
505
546
|
if (name === 'remote.commands') {
|
|
@@ -564,7 +605,16 @@ const clientCtx = {
|
|
|
564
605
|
};
|
|
565
606
|
}
|
|
566
607
|
if (name === 'sessions') return clientSessionsService;
|
|
567
|
-
if (name === 'workspaces')
|
|
608
|
+
if (name === 'workspaces') {
|
|
609
|
+
// 基座的默认工作区服务:`null` = 老基座取不到(用来验证错误提示)。
|
|
610
|
+
return {
|
|
611
|
+
list: { getSnapshot: () => ({ items: [{ workspaceId: 'ws-uuid-1', sessionIds: ['sess-main'] }] }) },
|
|
612
|
+
async initializeDefault() {
|
|
613
|
+
clientDefaultWorkspaceCalls.push(true);
|
|
614
|
+
return { ok: true, value: { workspace: clientDefaultWorkspace } };
|
|
615
|
+
},
|
|
616
|
+
};
|
|
617
|
+
}
|
|
568
618
|
return undefined;
|
|
569
619
|
},
|
|
570
620
|
on() { return () => {}; },
|
|
@@ -719,6 +769,52 @@ if (rows.length >= 2) {
|
|
|
719
769
|
check(noPolicyText.includes('plan 模式') && noPolicyText.includes('只汇报'), '首条消息自带 plan 口径兜底', noPolicyText.split('\n').filter((line) => /plan 模式|只汇报/.test(line)).join(' / '));
|
|
720
770
|
}
|
|
721
771
|
|
|
772
|
+
/* ------------------------------------------------ 项目没绑工作区的兜底 */
|
|
773
|
+
// OPS 项目不在 project-workspace 映射里(没绑工作区):点「计划」应当落到基座的默认工作区,
|
|
774
|
+
// 而不是弹一句「没有绑定工作区」把按钮堵死。
|
|
775
|
+
const pushCard = (key, project, summary) => clientListItems.push({
|
|
776
|
+
key, project, summary, status: 'To Do', category: 'new',
|
|
777
|
+
type: 'Task', priority: '', sprintId: null, sprint: '', due: '', updated: '2026-11-19',
|
|
778
|
+
labels: [], parent: '', parentKey: '', parentSummary: '', epicKey: '', epicSummary: '',
|
|
779
|
+
url: `https://example.atlassian.net/browse/${key}`,
|
|
780
|
+
});
|
|
781
|
+
const planRowOf = async (key, expected) => {
|
|
782
|
+
for (let i = 0; i < 120; i += 1) {
|
|
783
|
+
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
784
|
+
const rows = planButtonsOf(render());
|
|
785
|
+
if (rows.length >= expected) {
|
|
786
|
+
const index = clientListItems.findIndex((row) => row.key === key);
|
|
787
|
+
return rows[index];
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return undefined;
|
|
791
|
+
};
|
|
792
|
+
/* 面板默认停在自动选中的项目 tab 上(APP):先切到「全部项目」,新项目的卡片才画得出来。 */
|
|
793
|
+
const allProjectsPill = () => collectButtons(render()).find((row) => /jmw-pill/.test(String(row.props?.className ?? '')) && /全部项目|All projects/.test(collectText(row)));
|
|
794
|
+
allProjectsPill()?.props?.onClick?.();
|
|
795
|
+
pushCard('OPS-7', 'OPS', '按工单导出报表');
|
|
796
|
+
refreshButton()?.props?.onClick?.();
|
|
797
|
+
const opsRow = await planRowOf('OPS-7', 3);
|
|
798
|
+
check(Boolean(opsRow), '列表里出现未绑定项目的任务', String(planButtonsOf(render()).length));
|
|
799
|
+
const opsBefore = clientRemoteCalls.length;
|
|
800
|
+
await opsRow?.props?.onClick?.({ preventDefault() {}, stopPropagation() {} });
|
|
801
|
+
await settle(() => clientRemoteCalls.slice(opsBefore).some((call) => call.call === 'prompt'));
|
|
802
|
+
const opsCreate = clientRemoteCalls.slice(opsBefore).find((call) => call.call === 'create');
|
|
803
|
+
check(opsCreate?.workspaceId === 'ws-default-1', '项目没绑工作区 → 建在基座默认工作区', JSON.stringify(opsCreate ?? null));
|
|
804
|
+
check(clientDefaultWorkspaceCalls.length > 0, '默认工作区走 workspaces.initializeDefault()', String(clientDefaultWorkspaceCalls.length));
|
|
805
|
+
|
|
806
|
+
// 老基座没有默认工作区服务:这时才报错,一条会话都不建。
|
|
807
|
+
clientDefaultWorkspace = null;
|
|
808
|
+
pushCard('OPS-8', 'OPS', '按工单导出明细');
|
|
809
|
+
refreshButton()?.props?.onClick?.();
|
|
810
|
+
const opsRow2 = await planRowOf('OPS-8', 4);
|
|
811
|
+
check(Boolean(opsRow2), '列表里出现第二张未绑定项目的任务');
|
|
812
|
+
const opsBefore2 = clientRemoteCalls.length;
|
|
813
|
+
await opsRow2?.props?.onClick?.({ preventDefault() {}, stopPropagation() {} });
|
|
814
|
+
await settle(() => /没有绑定工作区/.test(collectText(render())));
|
|
815
|
+
check(!clientRemoteCalls.slice(opsBefore2).some((call) => call.call === 'create'), '取不到默认工作区 → 不建会话', String(clientRemoteCalls.length - opsBefore2));
|
|
816
|
+
check(/没有绑定工作区/.test(collectText(render())), '取不到默认工作区 → 面板给出明确原因', collectText(render()).slice(-120));
|
|
817
|
+
|
|
722
818
|
globalThis.fetch = realFetch;
|
|
723
819
|
console.log(failed === 0 ? '\n=== 计划对话测试:全部通过 ===' : `\n=== 计划对话测试:${failed} 项失败 ===`);
|
|
724
820
|
process.exit(failed === 0 ? 0 : 1);
|