Skip to content

fix(console): Studio condition editors list fields by their label - #35296

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-34122-condition-label-first
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-34122-condition-label-first

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Fixes #34122

Clause-②: no (@object-ui/app-shell is "private": true; flipping the labelSubjects default reaches no published export)
Metadata-protocol: none

维护者速读

  • 改了什么:Studio 条件编辑器(Hook「仅当…时运行」、操作的「显示条件 / 禁用条件」、页面区块「显示条件」、元数据表单里的通用条件字段)的字段下拉,改为「字段标签为主、机器名在旁」;ConditionBuilder 的 labelSubjects 默认值翻为开启。
  • 为什么改:其余入口只显示 status 这类机器名,与流程「进入条件」和对象校验已有的标签显示不一致,作者要猜字段。
  • 风险与回滚:只改显示文字,生成的 CEL 条件不变;回滚即把默认值改回 false(一行)。没有标签、或标签与字段名相同的字段仍显示机器名。
  • 先看:ConditionBuilder.tsx 中 labelSubjects = true 默认值与 labelOf 那段;ConditionBuilder.mountScope.test.tsx 末尾的四个挂载点用例;ConditionBuilder.subjectVocabulary.test.tsx 的 spellingOf(被迫改动的旧用例)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/ConditionBuilder.mountScope.test.tsx,预期全部通过,含 "every mount names a field subject by its label" 四例。
  • 需要你做的:无,席位落地。

What changes

ConditionBuilder's labelSubjects now defaults to true, so every remaining mount names a field subject by its label with its CEL spelling as the hint (ux-conventions.labels-over-machine-names). A field with no label, or whose label only repeats its name (the object-field catalog fills an unlabelled field's label with its name), reads as its spelling alone. The compiled CEL is unchanged.

The default-flip decision (the card's Ask): flip it. Every ConditionBuilder mount in the tree (git grep '<ConditionBuilder' ui/) lists the fields of a known object, so no mount needs the spelling primary; a future mount whose subjects are not object fields passes labelSubjects={false} and says why at the mount (the prop's doc says so).

Per mount, the subject read:

Mount Subject source Verdict
ActionDefaultInspector "Visible when" / "Disabled when" objectName = the action's object, catalog by useObjectFields field of a known object: labels on (by default)
HookDefaultInspector condition objectName = the hook's object field of a known object: labels on
PageBlockInspector "Visible when" objectName = the record page's object; a page with no object offers no field subjects field of a known object: labels on
widgets.tsx ConditionWidget context.objectFields, the bound object's catalog the host loads field of a known object: labels on
FlowNodeConfigField entry condition, ObjectValidationsPanel already passed labelSubjects unchanged; the explicit prop now restates the default

Forced edits to existing pins

Each found or listed a subject by bare spelling, which the label-first option no longer renders as its whole text:

  1. ConditionBuilder.contextSubjects.test.tsx "offers only subjects the record scope ACCEPTS": the option reader now reads the spelling hint, so the catalog field is filtered out of the context half by spelling as before.
  2. ConditionBuilder.nullGuard-27513.test.tsx "the card flow": picks Estimated Hours record.estimated_hours.
  3. ConditionBuilder.typedEmptyOps-11894.test.tsx "Add condition seeds equals": picks Due date record.due_date.
  4. ConditionBuilder.subjectVocabulary.test.tsx: the subjectOptions reader reads each option's spelling through a spellingOf helper (the convention the flow-entry pins already use), which turns green "offers record.FIELD for the catalog…", "fieldPrefix: '' declares a flattened scope" and "includePrevious offers previous.FIELD…"; "COMPILES a chosen subject" picks Amount record.amount. The same reader keeps "hides hidden fields" and "offers no previous.* subject by default" meaningful: against label-first text their spelling negatives would have passed whatever the builder offered.

Also in this branch

  • subjectLabels-27521 default pin renders the builder with no labelSubjects prop at all: routed through the file's mount helper, an undefined took the helper's own default and passed true, so the pin stayed green with the default flipped back off (measured by the ablation below).
  • previous.FIELD labels read labelOf once into a local, which the package type-check required.
  • The new ConditionWidget pin hands the widget a complete WidgetContext (conditionScope: 'record').
  • Every edited test file pays its dynamic-import loads at collection with module-top side-effect imports, as check:test-source-alias asks of edited files.

Tests

New pins (one per changed mount, each with a CONTROL): action "Visible when", action "Disabled when", hook condition and record page block "Visible when" in ConditionBuilder.mountScope.test.tsx; the generic widget in ConditionWidget.conditionSubjects.test.tsx; the builder default and the name-only-label rule in ConditionBuilder.subjectLabels-27521.test.tsx. Each finds the option by its label-first accessible name (Status record.status) and asserts the hint is the spelling; the CONTROL finds the unlabelled field by spelling with no hint.

Acceptance notes

  • FlowNodeConfigField and ObjectValidationsPanel still pass labelSubjects explicitly; it now restates the default. Left in place (ObjectValidationsPanel is outside this card's file surface).
  • test:repo, the full lint farm, check:type-check-debt and Lint UI are CI's: not run locally.

Verification

All readings below are on head b6d441814b unless a block names another.

Wide run — the whole @object-ui/app-shell package, type-check + tests (head b6d4418)

bash scripts/pm/os-verify-lock.sh -c "pnpm --filter @object-ui/app-shell run type-check && cd ui && pnpm exec vitest run --maxWorkers=2 packages/app-shell/"

 Test Files  2330 passed | 1 skipped (2331)
      Tests  21781 passed | 9 skipped (21790)
os-verify-lock: VERDICT command-exit 0

type-check is both programs (tsc --noEmit and tsc -p tsconfig.test.json); the two earlier wide attempts went red there, which is what the labelOf local and the complete WidgetContext commits fix.

Targeted run before the forced edits (head 359883a) and after (head c31d3c8)

Before (the resume head merged with main): Test Files 4 failed | 13 passed (17), Tests 7 failed | 171 passed (178) — exactly the seven pins listed above. After the forced edits: Test Files 17 passed (17), Tests 178 passed (178).

Ablations ran on head 060a33c371 (the final head only adds a local in the previous.FIELD label and a test-context key since).

Ablation 1 — default flipped back to false (anchor labelSubjects = true, verdictPath })

Mutation landed by scripts/ablation-replace.mjs (anchor 1 → 0, blob 40845f46e22b → ed604132839a), 8 files run: Test Files 6 failed | 2 passed (8), Tests 9 failed | 100 passed (109). Red: the four mount pins, the widget pin, the 27521 default pin, and the three forced-edit pickers (nullGuard, typedEmptyOps, COMPILES). Every CONTROL stayed green. Restored: blob == HEAD (40845f46e22b), git diff HEAD empty.

Ablation 2 — a label that repeats the name counts as a label (anchor (f.label && f.label !== f.name ? f.label : undefined) → (f.label))

Mutation landed (blob 40845f46e22b → 0ba9b3f964d0): Test Files 2 failed | 1 passed (3), Tests 5 failed | 25 passed (30). Red: the four mount pins (their CONTROL code field arrives from the catalog labelled code) and the 27521 name-only pin. Restored: blob == HEAD, git diff HEAD empty.

Derived gate families (dispatch-gates --commands, head b6d4418)

All 38 derived families exit 0, including check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:type-check-coverage, check:type-check-debt and pnpm --dir ui exec vitest run scripts/ (Test Files 171 passed | 2 skipped (173)). Reconciliation:

Run reconciliation — 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.

Also pnpm --dir ui check:new-line-citations: 0 new citation(s). node scripts/pm/overlap-check.mjs before each push: VERDICT clean exit 0.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY

ConditionBuilder's labelSubjects now defaults to true, so the hook, action,
page-block and generic widget condition mounts name a field subject by its
label with its CEL spelling as the hint. A label that only repeats the field
name reads as the spelling alone.

Claude-Session: https://claude.ai/code/session_01ADHkmRcktQEQx7ViBAPoK5
Co-authored-by: Claude <noreply@anthropic.com>
…bel-first name

The subject dropdown now names a field by its label with the CEL spelling as
the hint, so the pins that found or listed options by bare spelling read the
spelling from the hint, or find the option by its label-first accessible name.
The changeset carries the claim's Clause-② line verbatim.

Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY
Co-authored-by: Claude <noreply@anthropic.com>
…bjects

Handing the file's mount helper an undefined took the helper's own default and
passed true explicitly, so the builder's default was never read: the pin
stayed green with the default flipped back off.

Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY
Co-authored-by: Claude <noreply@anthropic.com>
…t collection

Each test file this change edits reaches a dynamic import of @objectstack/lint,
@objectstack/formula or @object-ui/core through the builder; a module-top
side-effect import pays that load during collection, as
check:test-source-alias asks of every edited file.

Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY
Co-authored-by: Claude <noreply@anthropic.com>
…name-only rule

labelOf returns string | undefined, so reading it twice left tFormat's argument
typed as possibly undefined; read it once into a local.

Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY
Co-authored-by: Claude <noreply@anthropic.com>
…e context

WidgetContext requires conditionScope; the pin declares the record scope a
record-scoped host hands down, so the test program type-checks.

Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY

Final head for L1: b6d441814b1939061eb5bc252387de0bcd70dc81 · 2026-11-19T03:14Z

  • CI on this head: 41 success, 15 skipped, 0 failed or pending.
  • Diff 256 lines (9 files): above the 50-line self-landing bar, so the L1-a thread reads it. Clause-②: no (@object-ui/app-shell is private) · Metadata-protocol: none.
  • Default flip decided: ConditionBuilder labelSubjects defaults to true; per-mount table in the body. 7 forced pin edits listed; the resume head's vacuous 27521 default pin fixed and re-ablated red.
  • Dev local: wide app-shell run 2330 files passed (1 skipped), 38/38 derived gates run (os-dev report 6998245177).
  • Body-only edit added the attribution and footer lines (head unchanged).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 改了什么:Studio 条件编辑器(Hook 条件、操作显示/禁用条件、页面区块显示条件、元数据表单通用条件字段)的字段下拉改为「标签为主、机器名在旁」;ConditionBuilder 的 labelSubjects 默认值翻为开启。
  • 为什么改:卡 Studio condition editors: hook, action, page-block and widget conditions list fields by machine name #34122。流程进入条件和对象校验已经这样显示,其余入口只显示机器名。
  • 风险与回滚:只改显示,生成的 CEL 不变;没有标签或标签只重复字段名的字段仍显示机器名。回滚即 revert 本 PR。
  • 先看:ConditionBuilder.tsx 的默认值与 labelOf;ConditionBuilder.mountScope.test.tsx 末尾四个挂载点用例。
  • 两分钟验证:跑 ConditionBuilder.mountScope.test.tsx,全部通过。
  • 需要你做的:无,区内落地(非受管面、256 行)。L1 意见:可落;但 main 已前进 18 个提交,落地前须先合并 main 并等重跑全绿。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head b6d441814b1939061eb5bc252387de0bcd70dc81 · 2026-11-19T03:17Z

  • 形态: draft → main, 9 files, +235/−21, 7 commits (6 content + 1 main-only merge of cdb327fd). Fixes #34122 on its own line; no other card number sits beside a closing keyword. check-governed-merges --pr 35296: 0 of 9 paths governed, 256 lines ≤ 3000 → ordinary queue landing. Clause-②: no holds: ConditionBuilder lives in @object-ui/app-shell (private: true), so the default flip reaches no published export; Metadata-protocol: none.
  • Fixes vs the card: the card asks to turn labels on at each remaining mount whose subject is a field of a known object (or say why not), decide the default, pin each mount, ablate, and move spelling-based tests. All delivered: the per-mount table covers Action ×2, Hook, PageBlock and ConditionWidget (L1 re-ran git grep '<ConditionBuilder' ui/: those are the only mounts besides Flow and Validations, which already passed labelSubjects); the default flips to true, with the prop doc saying a future mount that needs the spelling primary passes false and says why. So Fixes is right.
  • Changeset: .changeset/34122-condition-subjects-label-first.md, patch on @object-ui/console (published; it bundles app-shell, so the user-visible change ships there) and @object-ui/app-shell (private, harmless). Sentences read against the diff: the mount list = the four default-on mounts; "its CEL path (record.status) beside it as secondary text" = named(...) → hint: spelling; "A field with no label, or whose label only repeats its name, still reads as its path" = labelOf returning undefined for label === name; "The compiled condition is unchanged" = only option label/hint change, value stays the spelling.
  • 差异由 L1 读过: default labelSubjects = true; labelOf treats a label equal to the name as no label (the object-field catalog fills an unlabelled field's label with its name) and also feeds the previous.FIELD labels.
  • 接受的偏差: (1) labelOf also reaches the Flow and Validations mounts, which already had labels on: a field whose label only repeats its name now shows its spelling alone instead of that name with the spelling as hint. Same rule everywhere, nothing lost, so the changeset's "still" is close enough. (2) Seven forced edits to existing pins (listed in the PR body) now find options by label-first name or read the spelling hint; the spellingOf reader keeps the two negative pins ("hides hidden fields", "no previous.* by default") meaningful instead of vacuous. (3) The 27521 default pin now renders with no labelSubjects prop at all, because the file's mount helper had masked the default (shown by ablation 1). (4) Model-free trailers; the merge commit carries none.
  • Pins: one new pin per changed mount, each with a CONTROL (the unlabelled field found by spelling, no hint), plus the widget pin and the builder default / name-only pins in subjectLabels-27521. Ablation 1 (default back to false): 9 red / 100 green, every CONTROL green. Ablation 2 (name-only label counted as a label): 5 red / 25 green. Restored blob == HEAD both times. Ablations ran at 060a33c3; the two later commits add a local and a test-context key only.
  • 门禁: check-runs on head b6d44181: 41 success, 15 skipped, 0 failure (Lint & Repo Gates, TypeScript Type Check, Type Check UI, Lint UI and Test UI among the successes). Dev local: the whole app-shell package, type-check (both programs) + tests, 21781 passed; 38 of 38 derived gate families, 0 NOT MEASURED.
  • 范围外去向: none.
  • 落地条款: ⚠️ K = 18 first-parent commits on main since merge base cdb327fd (≥ 15). Per landing-operations.md, ux-1 merges main first and waits for the re-run to go fully green, then pr_ready + auto-merge (unless GitHub reports behind, the stated exception). This ACCEPT stands across that merge if the merge is main-only and conflict-free; a conflict resolution that touches the diff comes back for L1. No locale pack. On MERGED, close-out on Studio condition editors: hook, action, page-block and widget conditions list fields by machine name #34122.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY

Landing · area ux-1 · 2026-11-19T03:38Z

Reading Value
check-governed-merges --pr 35296 0 of 9 paths governed, 256 lines → ordinary queue landing
K 18 at ACCEPT → origin/main merged by relay pr_update_branch (conflict-free, main-only); re-run on 09ea181de848d39ad9b020f76d39dba9399e4c0e: 39 success, 13 skipped, 0 failed

ACCEPT 6998618448 (L1-a) at b6d441814b, standing across the main-only merge. Ready + auto-merge now. #34122 closes on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 03:39
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 645d2bb Nov 19, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34122-condition-label-first branch November 19, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio condition editors: hook, action, page-block and widget conditions list fields by machine name

2 participants