Repository navigation
Commit b10fd65
fix(studio): a flow node's key / value map stacks each field over its value, so field names are readable (#27405)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ836VkJMbRirYcP4FDCFmjrE)_
Part of #27356
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Studio 流程检查器里,键/值映射(新建记录节点的字段值、HTTP
头等)的每一行改为上下两行:字段名单独一行(旁边是删除按钮),值在下面一行(旁边是表达式切换)。
- 为什么改:HotCRM 18.2.0 走查(hotcrm#2320 Studio S5)发现新建记录节点把字段名截成 4–5
个字符(「subj」「dueD」);300px 的检查器里一行要塞字段、值和两个按钮。
- 风险与回滚:只改这个编辑器的行布局,存储的值不变;回滚即 revert 本 PR。
-
先看:`ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.tsx`(行渲染的
`flow-kv-key-line` / `flow-kv-value-line`)。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.stackedRows-27356.test.tsx`,预期
2 个用例全绿。
- 需要你做的:无,席位落地。
## What changes
Row 16 of #27356 (hotcrm#2320, Studio report finding S5): "The Create
Record node cuts field names to 4–5 characters ("subj", "dueD")."
`FlowKeyValueField`, the key / value map editor in the flow node
inspector, draws each row on two lines instead of one:
- **Key line:** the key box (`min-w-0 flex-1`) and the remove button.
- **Value line:** the value box and, where the map has one, the text /
expression toggle.
Rows are spaced `space-y-3` (was `space-y-1.5`) so one pair reads apart
from the next. Nothing about what the map commits changes: the same
rows, the same flush on blur, the same refusal and expression-issue
lines under the value.
`FlowNodeConfigField` is the editor's only caller, so every key / value
map in the flow inspector stacks: Create Record and Update Record field
values, the Update Record filter, HTTP headers, Assignment assignments,
subflow input mapping, script inputs, screen form defaults, action
parameters. That is one component's layout, not a sweep; each of those
maps had the same cut-off key.
## Why
In the 300 px Studio inspector (`STUDIO_ASIDE_WIDTH`, less the inspector
shell's `p-4`), the key box got the width left after the value box and
two 32 px buttons.
<details><summary>Geometry reading (Chromium, Tailwind 4.3.3 compiled
from the same class strings, 267 px content width)</summary>
Key box holding `customer_satisfaction_score`, computed font 14 px
monospace (the `Input` primitive's `md:text-sm` outranks the row's
`text-xs` at desktop width; unchanged here):
| | key box width | characters visible |
|---|---|---|
| before (one line: key, value, toggle, remove) | 104 px | 9 |
| after (key + remove over value + toggle) | 227 px | 24 |
One-off probe, not committed: a static page with both row shapes built
from `compile()` of `tailwindcss/dist/lib.mjs`, measured with
Playwright.
</details>
## Tests
`ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.stackedRows-27356.test.tsx`
(2 tests, through `FlowNodeConfigField`; jsdom draws no layout, so the
pin is the row's structure):
- Create Record field values with `customer_satisfaction_score`: the
key's line holds no value box, exactly one input and one button
(remove); the value's line is a different line, after it, and holds the
expression toggle.
- HTTP headers (a map with no toggle): the key's line holds no value
box.
<details><summary>Ablation (one: rejoin the two lines)</summary>
`node scripts/ablation-replace.mjs --delete` of the anchor that closes
the key line and opens the value line (anchor 1 → 0, blob `9f71951b7644`
→ `d9d573fada30`): both tests fail, `expected true to be false`.
Restored: blob after restore = blob at HEAD = `9f71951b7644`, `git diff
HEAD` empty.
</details>
## Acceptance notes
- The key box still shows the API name (`subject`), as before; the
datalist suggestions keep showing `Label (name)`. Showing the label in
the box would change what the box edits, which this row does not ask
for.
- A 27-character name still needs 251 px at desktop width and shows 24
characters in the 300 px aside; the box scrolls as any input does.
- The `Input` primitive's `md:text-sm` outranks this editor's `text-xs`
at desktop width, so the key box reads at 14 px rather than 12 px.
Pre-existing and unchanged; noted only.
## Verification
Code on head `d30f8380` (fix + test + changeset); head `5ebc5576` adds a
one-line changeset wording fix, after which the changeset families were
re-run. Merge base `7e200b4a`. Under the shared verification lock.
- New file: 2 / 2 passed. Every app-shell test file that imports
`FlowNodeInspector`, `FlowNodeConfigField` or `FlowKeyValueField` (65
files, the new one included): 971 / 971 passed.
- `pnpm --filter @object-ui/app-shell run type-check` (both `tsc`
programs): exit 0.
- `pnpm --dir ui run check:new-line-citations`: 0 new citations, exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: the same 34 families as row 21, all 34 exit
0; `--ran`: 34 run, 0 NOT-MEASURED, 0 UNRUN. Tier: no path-derived
mandate; 132 changed lines.
- The `ui scripts/` family first exited 1 on
`quick-reference-commands-4149` ("no row for apps/site"): an ignored
`ui/apps/site/node_modules` left in this worktree from before the site
retired (#27329). Deleted it and re-ran: 169 files passed, 2 skipped,
exit 0. Not a tree defect.
- Re-run on `5ebc5576`: `check-adr-0087-registration`,
`check-changeset-no-major`, `check-empty-changeset`,
`check:changeset-gate-self-tests`, `check:pm-changeset-deadline-census`,
`check:nul-bytes`, all exit 0.
Repo-wide lint, the full ui test battery and the e2e jobs are CI's.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbWuU6sVfBYiy4dY4PA)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7f17135 commit b10fd65
3 files changed
Lines changed: 117 additions & 15 deletions
File tree
- .changeset
- ui/packages/app-shell/src/views/metadata-admin/inspectors
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
| |||
384 | 390 | | |
385 | 391 | | |
386 | 392 | | |
387 | | - | |
| 393 | + | |
388 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
389 | 409 | | |
390 | 410 | | |
391 | 411 | | |
| |||
415 | 435 | | |
416 | 436 | | |
417 | 437 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | 438 | | |
431 | 439 | | |
432 | 440 | | |
| |||
0 commit comments