Repository navigation
Commit 421f180
feat(flow designer): add variables, say why Runs is empty, Debug takes the side column, and autosave reads 已保存 in the header (#34955)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLW6dHPW6sSheA32XPKZzPV)_
repo:objectstack#3 · os-support-ai · session_01WGufzgae1jRRi8FRrTxaZL
Fixes #34818 (slice 3 of 3: items 5 to 9, plus the approval help text
moved from slice 2; slices 1 and 2 landed as #34850 and #34932). Surface
per the seat's amendment 6954475081.
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **变量页可以新增变量了。**
空状态说明变量是做什么的;「添加变量」新建一个不重名的文本变量,每行可改名称、类型、默认值、输入、输出。`$`
开头、空名、重名会被拦下并提示;还被步骤引用的变量不能改名或删除,提示里列出是哪些步骤(这张卡不自动改引用)。只读包仍是原来的列表。
- **运行页签分两种说法。**
从未发布的流程写「发布并启用后,这里显示每次运行的记录。」,并且不去请求运行记录;已发布但引擎不响应时只说引擎不可用。
- **调试面板占用右栏。** Studio
里流程的「属性」本来在右侧面板,进入「调试」后模拟器直接画在右侧面板里,画布独占中间;离开调试,属性面板带着原来的选中回来。没有右侧面板的布局下,属性栏不画,模拟器列加宽到属性栏的宽度。1280
宽实测「运行 / 单步 / 重置」和状态徽标完整可见。
- **自动保存不再弹提示。**
标题栏的「正在保存」落定为「已保存」,读屏读作「流程「X」已保存」,下次编辑前一直在;保存失败照旧显示错误条,另弹一条错误提示。其他
Studio 编辑器的保存提示不变。按席位裁定,徽标在流程自己的标题行里、紧挨流程名。
- **节点面板在 zh-CN 下没有英文了。**
包括条件分支的「分支方式」、审批的「解析为」「没有解析出审批人时」和分组占位,也包括实测才发现的、由服务端下发的审批人各列说明、「排除提交人」「备用审批人」和
SLA 升级各项说明。`quorum`、`per_group` 改为「法定人数」「分组会签」。审批人说明改为「插入时自带通过和驳回两条连线」。
- 元数据结构、引擎行为、发布检查都不变。
## What changes
**Item 5, the node panel in zh-CN (and the approval help text).**
- `inspectors/flow-node-config.ts`:
- The approval `approvers` help says the node comes with an "approve"
and a "reject" connection, instead of asking the author to label them
(slice 2 inserts them).
- `localizeField` and `localizeColumn` overlay a prose `placeholder`,
and `localizeColumn` overlays a column `help`. Example literals (CEL,
numbers, field names) stay as written.
- `metadata-admin/i18n.ts` (`FLOW_FIELD_ZH`):
- decision: `mode` and its two options; the branch columns' help and
prose placeholders.
- approval: `resolveAs`; `onEmptyApprovers` with all four options
(including `fallback`); `excludeSubmitter`; `fallbackApprovers`; the
escalation helps; `minApprovals` reads 法定人数 / 分组会签.
- `APPROVER_COLS_ZH` is shared by `approvers` and `fallbackApprovers`
(both are `ApprovalNodeApproverSchema`). It covers every column's label
and help, including `organization`, plus a `platform_admin` option
label.
- The served help: live, the panel draws the fields the engine
publishes, whose help is the spec's `.describe()`. Seven of those
strings were English in zh-CN. They are now in the table, and the test
reads the fields from the spec's own JSON Schema, as the engine
publishes them.
**Item 6, Debug takes the right column's place.**
- `studio-design/StudioDesignSurface.tsx` (flow pillar): while the
section is `debug`, the Configuration aside is not drawn. The selection
is kept.
- In the surface's right slot, the chrome gets `debugTarget:
slot.propsTarget`, and opening Debug calls `showProps()`, so the slot
shows the half the simulator is drawn in.
- In the classic row (no slot), nothing else is needed.
- `previews/FlowPreview.tsx`: `FlowPreviewChrome.debugTarget`. With a
target, the simulator is portaled into it and the section keeps the
canvas alone (`grid-cols-1`). Without one, the simulator column beside
the canvas widens from 240px to the aside's 300px.
- `FlowSimulatorPanel.tsx`: the toolbar wraps (`flex-wrap`), the row the
claim allows. Live readings at the slot's 419px:
- idle: 运行 / 单步 / 重置 and the status fit on one row;
- paused with 继续: 运行 / 单步 / 继续 / 重置 and 已暂停 fit on one row;
- paused on an approval with `approve` and `reject` connections (slice
2's default): the status pill was clipped past the slot's edge before
the wrap, and with the wrap it moves to a second row.
**Item 7, Add variable.**
- New `previews/FlowVariablesPanel.tsx` replaces the read-only
`FlowVariablesList`, in both the chrome `variables` section and the
classic side panel. It edits only with `onPatch` (the designer's
`canEdit`).
- Every write is the whole `variables` array, in the shape
`FlowVariableSchema` parses. `objectName` rides along untouched.
- Name refusals: blank, `$`-led (the spec's
`flowBoundVariableNameSchema('variableName')`), or held by another
variable.
- Default values parse by type (number, `true`/`false`, a JSON object or
list). A default the type cannot hold is held with a note, and so is a
type change the current default cannot follow.
- Rename and remove are refused while a step reads the variable.
`flowVariableReaders` reads a whole-word mention in any string of a step
(template holes and bare CEL alike), connection conditions, and the
flow's `successMessage` / `errorMessage`. The read is deliberately wide,
so a refusal can be stricter than the engine, never looser.
- An input that declares `objectName` cannot be unticked (the spec
refuses `objectName` on a non-input).
**Item 8, autosave says 已保存 in the header.**
- `StudioDesignSurface.tsx` (flow pillar): a landed draft save no longer
calls `announceDraftSaved`. It sets `flowSavedFor`, and the header
actions show `auto-autosaved`: a ✓ and 已保存, with an sr-only sentence
naming the flow, in a `role="status"`. The next edit clears it.
- It is shown only when nothing was edited in flight (`sent.unmoved()`).
- A failed save raises one `toast.error` naming the flow, under one id
per flow, beside the existing refusal strip.
- `StudioPillarKit.tsx`: comment only. `announceDraftSaved` no longer
lists the flow pillar; its other callers are unchanged.
- Seat ruling 6954475081 holds this to ruling 6545938831 ② on #28345
(write feedback names the item): the badge sits in the flow header's own
title row, beside the title, and its accessible text names the flow.
Both are pinned.
**Item 9, Runs says why it is empty.**
- `previews/FlowRunsPanel.tsx`: a `published` prop. For `false` it says
发布并启用后… and does not fetch. For `true`, a failed fetch names the engine
alone. For an unknown value, the old sentence stays.
- `StudioDesignSurface.tsx`: `readPublishedFlowNames` lists the served
flows per scope (the package and its pair) beside the flow list, and the
chrome passes `published` for the open flow. A failed read leaves it
unknown.
- **Deviation from the claim's wording.** The claim said `published`
comes from "what the pillar already reads". It is a new read: one
`listResponse('flow', { packageId })` per scope per rail load, with no
per-row fan-out. The seat acked it as an extension of amendment
6954475081.
**Shared.** New and reworded keys in the lazy `studio` namespace (en and
zh). No eager pack changes. Changeset: `@object-ui/app-shell` and
`@object-ui/i18n` patch.
## Tests
- `inspectors/flow-node-config.zhPanel-34818.test.ts` (7 tests). This is
the surface's `inspectorStrings.i18n-34818` row, written against the
field tables directly.
- Every decision and approval label, help, option, column and prose
placeholder has CJK in zh-CN, both from the offline table and from the
served fields
(`jsonSchemaToFlowFields(z.toJSONSchema(ApprovalNodeConfigSchema /
DecisionConfigSchema))`).
- No `quorum` / `per_group`.
- The approvers help is checked in zh and en.
- en-US control: the overlay is the identity.
- `previews/FlowVariablesPanel-34818.test.tsx` (10 tests): add (two
unique names), the edit of all five properties into one row, a held
default, the three name refusals (the spec agrees on `$`), the reference
guard on rename and remove with a control that renames and removes, the
`objectName` input, the read-only control, the zh rows, and the reader's
whole-word rule. Every write is parsed with `FlowVariableSchema`.
- `previews/FlowRunsPanel.render.test.tsx`: a new describe (4 tests):
unpublished with no fetch, published engine-only, and the unknown and
empty controls.
- `studio-design/StudioDesignSurface.flowAutosave-34818.test.tsx` (9
tests), on the real `AutomationsPillar` with the real `FlowPreview` /
`FlowInspector`:
- item 8: the badge is in the header's title row beside the `h1`, its
sr-only text names the flow, and no success toast; a second edit clears
the badge; a refused save gives one error toast, the strip and no badge;
the leaf control (an Interfaces page autosave still toasts by its
label);
- item 6: classic Debug hides the aside and widens to 300px, and Canvas
brings it back with the selection; in the right slot, Debug draws the
simulator in the slot, calls `showProps`, and keeps the section
canvas-only; control: Canvas keeps the aside;
- item 9: an unserved flow reads the unpublished sentence with no run
fetch, and a served flow with a silent engine reads the engine sentence.
- Updated:
- `previews/emptyCollection-8526.test.tsx`: the reworded `noVars`
sentence.
- `previews/flowFieldChrome.i18n-10862-s4.test.tsx`: an editable flow's
variables panel shows Input / Output boxes and name values instead of in
/ out tags, so the case pins those keys.
- Both, plus the new Studio test, take a module-top `import
'@objectstack/lint'` (`check:test-source-alias`).
Ablations (each restored, tree clean after):
| Mutation | Result |
| --- | --- |
| `flowsEmpty \|\| section === 'debug'` back to `flowsEmpty` | classic
Debug test red |
| chrome `debugTarget: null` | right-slot Debug test red |
| drop `setFlowSavedFor(current.name)` | badge title-row and second-edit
tests red |
| chrome `published: undefined` | both Studio Runs tests red |
| `flowVariableReaders` returns `[]` | reference-guard and reader tests
red |
| `localizeColumn` without the help overlay | both served-fields zh
tests red |
## Acceptance notes
- "zh-CN 下节点面板没有英文标签或英文说明": live. Start, decision, approval and end
panels were read in zh-CN, and no line with an English phrase was left
(the approval had 7 before the served-help fix).
- "1280 宽下调试工具栏四个按钮和状态都完整可见": live at 1280 in the right slot (419px).
- Paused after 单步 ×3 on the approval: 运行 / 单步 / 继续 / 重置 and 已暂停 are on
one row, in zh and en.
- With `approve` / `reject` connections, the two decision buttons take
继续's place, and the toolbar wraps the status to a second row instead of
clipping it.
- The decision buttons show the connection keywords (Approve / Reject)
in zh as well; they are left as they were, and named as a follow-up.
- "连续改三处配置,标题栏不被提示盖住": live. A variable was added, renamed and given a
type and default. 0 toasts were on screen, and the header read ✓ 已保存
beside the switch.
- Item 9: an unpublished draft flow reads 发布并启用后…; a published showcase
flow with the engine up reads 暂无运行记录 (control).
## Verification
Measured on head `56a158240`; `84f3858ad` adds only the toolbar's
`flex-wrap`, after which the two `FlowSimulatorPanel` suites (6 tests)
pass (base `c6ecd1fab`, main merged in at `f825d67a9`), on a shared box.
- Tests: the 218 test files under `metadata-admin` and `studio-design`
that touch flows, the edited i18n tables, autosave or toasts on the
final head: 218 files, 2977 passed and 1 skipped, exit 0.
`packages/i18n`: 102 files, 1894 passed, 13 skipped, exit 0.
- Type-check: `pnpm --filter @object-ui/app-shell type-check` (both
projects) exit 0 on the final head. A first run failed on
`columnMenuLabel` in code main brought (#34926), because the local
`@object-ui/components` dist predated it. After `pnpm --filter
@object-ui/components build` it exits 0. No file of this PR is involved.
- Derived gates: `dispatch-gates --commands` on the merged tree gave 38.
All 38 were run, plus `check:i18n` and `check:i18n-stale-fill`. 37
exited 0 at once. `check:test-source-alias` asked for the module-top
lint import in three edited tests; after that it exits 0.
- Eager bundle: not measured. Every new key is in the lazy `studio`
namespace, and no eager pack changed.
- Live: showcase backend (`pnpm --filter @objectstack/example-showcase
dev -- --fresh`), the console under Vite with `DEV_PROXY_TARGET`, and
Playwright at 1280×860 in zh-CN and en. The flow is a draft 「新会议提醒」 in
an authored package, never published. The readings are in the comment
below. The screenshots and the script are in the seat's project files
under `objectstack-seat3/34818-live/slice3/`.
- Not run locally, left to CI: the full ui suite, `test:repo` and the
dogfood battery (no `!` and no `(narrowing)` arm).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WGufzgae1jRRi8FRrTxaZL
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzgae1jRRi8FRrTxaZL -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 119d5db commit 421f180
17 files changed
Lines changed: 1458 additions & 92 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views
- metadata-admin
- inspectors
- previews
- studio-design
- i18n/src/namespaces/studio
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
217 | | - | |
218 | | - | |
| 219 | + | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| |||
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
230 | 288 | | |
231 | 289 | | |
232 | 290 | | |
| |||
293 | 351 | | |
294 | 352 | | |
295 | 353 | | |
296 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
297 | 363 | | |
298 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
299 | 371 | | |
300 | 372 | | |
301 | 373 | | |
| |||
391 | 463 | | |
392 | 464 | | |
393 | 465 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 466 | + | |
| 467 | + | |
412 | 468 | | |
413 | 469 | | |
414 | 470 | | |
| |||
420 | 476 | | |
421 | 477 | | |
422 | 478 | | |
423 | | - | |
| 479 | + | |
424 | 480 | | |
425 | 481 | | |
426 | 482 | | |
427 | 483 | | |
428 | 484 | | |
429 | 485 | | |
430 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
431 | 490 | | |
432 | 491 | | |
| 492 | + | |
433 | 493 | | |
434 | 494 | | |
435 | | - | |
436 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
437 | 501 | | |
438 | 502 | | |
439 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
440 | 527 | | |
441 | 528 | | |
442 | 529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1004 | 1004 | | |
1005 | 1005 | | |
1006 | 1006 | | |
1007 | | - | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
1008 | 1010 | | |
1009 | 1011 | | |
1010 | 1012 | | |
| |||
1508 | 1510 | | |
1509 | 1511 | | |
1510 | 1512 | | |
1511 | | - | |
| 1513 | + | |
1512 | 1514 | | |
1513 | 1515 | | |
1514 | | - | |
| 1516 | + | |
1515 | 1517 | | |
1516 | 1518 | | |
1517 | 1519 | | |
1518 | 1520 | | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1519 | 1526 | | |
1520 | 1527 | | |
1521 | 1528 | | |
| |||
1533 | 1540 | | |
1534 | 1541 | | |
1535 | 1542 | | |
| 1543 | + | |
1536 | 1544 | | |
1537 | 1545 | | |
1538 | 1546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
0 commit comments