Skip to content

feat(studio): Update Records offers the triggering record as its target, starts on the trigger object, and picks keys by label - #27930

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-pv704t
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-pv704t

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

维护者速读

Fixes #27834

Clause-②: no
Metadata-protocol: none

What changes

Measured first, on main at e6553619. The Update Records node is drawn by FlowNodeConfigField from the offline descriptor (flow-node-config.ts, update_record: Object, Filter, Field values) or the engine's configSchema. A new node is seeded by defaultNodeExtras (previews/flow-canvas-parts.tsx), which seeded nothing for update_record. Field values already listed the object's fields as datalist suggestions under a free-text key (objectui#11788); Filter keys had none. The spec's own guidance for a CRUD node's target row (UpdateRecordConfigSchema, recordId guidance) is filter: { id: { dialect: 'cel', source: 'record.id' } }, and flow-scope.ts already scopes the trigger record as record at every node the start reaches.

  1. The object starts on the trigger's. defaultNodeExtras(type, nodes?) takes the draft the node joins; for update_record on a flow whose start node is a record trigger with an object, the new node is { config: { objectName } }. FlowCanvas.addNode and insertOnEdge pass their nodes. The trigger-type set is the one resolveFlowScope reads, through a new recordTriggerObjectName in flow-scope.ts. Seeded at creation only: opening a node writes nothing.
  2. "Update the triggering record". Above an update_record Filter, when the trigger record is in scope at the node (triggerScope, from useFlowScope) and the node's object is the trigger's: on an empty filter a button writes the id match above (writeValueEnvelope, no syntax of this surface's own) with a hint naming the object; on a filter that is exactly that match, a line says the node updates the record that started the flow. Any other filter is the author's and is left alone; the button comes back once its rows are removed. The row it writes is an ordinary filter row (id, value as a CEL expression), so the existing value-slot checks and Problems list judge it as before.
  3. Keys by label. FlowKeyValueField gains keysByLabel: while there are key options, the key cell is the searchable InspectorComboField, which shows a field by its label (API name beside it in the list) and stores the API name; a key the catalog does not hold is still taken through its "Use …" row, and a stored unknown key shows as written. With no options (no object, or fields not read) the key stays the plain box. FIELD_VALUE_MAPS turns it on for update_record fields and filter (whose keys are fields of the same object). create_record keeps the suggested text box, as the order's "other node types unchanged" asks.

i18n: three keys added to the studio namespace (engine.inspector.flowNode.triggeringRecord.*, en and zh); no en value changed (check:i18n-drift: 0).

Tests

  • New inspectors/FlowNodeInspector.updateRecordTarget-27834.test.tsx (9 cases, the real FlowNodeInspector): one press writes the id match, the line replaces the button, a Status value picked by label completes the node, and the saved flow passes the publish verdict, computed with the real FlowSchema plus validateStackExpressions from @objectstack/lint (control: the same node with a blank expression is refused); an authored filter is left alone and opening writes nothing (onPatch not called); not offered on another object, a non-record trigger, a node the start does not reach, or delete_record / get_record; Field values and Filter keys pick by label and store the API name; a stored unknown key shows as written and a typed one is taken; control: create_record keeps the text box.
  • New previews/FlowCanvas.updateRecordSeed-27834.test.tsx (4 cases): the "+" on a record-triggered flow emits update_record with config.objectName = the trigger object, and the node parses against the spec's FlowNodeSchema; controls: a manual trigger seeds nothing, other node types seed what they did, a record trigger with no object seeds nothing.
  • Updated pins: FlowNodeInspector.fieldValueMap-11788 (its datalist case now runs create_record only; the not-a-field-value-map control moves from update_record filter to delete_record filter), flowValueSlots-12372 (stubs useObjectFields, since the update_record filter now reads the object's fields), flow-node-producers.label (its scan control matches defaultNodeExtras(type now that the call passes the nodes).
Readings
  • pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/ packages/app-shell/src/views/metadata-admin/previews/ packages/app-shell/src/views/studio-design/ on 85ec2c36: Test Files 639 passed (639), Tests 6471 passed, 1 skipped; lock VERDICT command-exit 0.
  • pnpm --filter @object-ui/app-shell type-check: lock VERDICT command-exit 0 (both tsc --noEmit and tsconfig.test.json).
  • Ablation (scripts/ablation-replace.mjs, one leg per behaviour, app-shell tests import src so there is no dist leg; each leg restored to the HEAD blob with git diff HEAD empty):
    • the target button's write replaced by a no-op: 1 failed / 13;
    • pickKeys forced false: 4 failed / 13;
    • the update_record seed returning nothing: 2 failed / 13.

Acceptance notes

  • The seed lives at node creation (previews/flow-canvas-parts.tsx, FlowCanvas.tsx), outside the claim's inspectors/** surface; the seat widened the surface to those two files before the edit.
  • create_record's Field values could take the same label picker by adding byLabel: true to its FIELD_VALUE_MAPS row; left out because the order keeps other node types unchanged.
  • The target is offered only where record is in scope at the node, the same rule the reference picker uses, so a node not yet connected below Start does not offer it until it is.
  • The hint and line name the object by its API name, as the sibling "Fields of …" hint does.

Verification

Local derived gates (dispatch-gates --commands on this diff) all exit 0; ui check:new-line-citations 0 new; check:i18n-drift 0 findings; check:sdui-manifest exit 0. CI runs the rest.


Generated by Claude Code

…et, starts on the trigger object, and picks keys by label

Claude-Session: https://claude.ai/code/session_01Utp6CYAmDt6mjenGQb2UNR
Co-authored-by: Claude <noreply@anthropic.com>
…key picker and trigger-object seed; changeset

Claude-Session: https://claude.ai/code/session_01Utp6CYAmDt6mjenGQb2UNR
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l 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 Oct 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe

席位核对

ACCEPT · head 85ec2c3678e99dee44e3e72b4d7cc27e1276b777 · 2026-10-30T04:34Z

  • Shape: draft → main, Fixes #27834 (single-PR card). Clause-②: no and Metadata-protocol: none match the claim. The change is Studio-side only (@object-ui/app-shell, plus studio en/zh keys), so no contract review is owed.
  • Premise, measured: before this change, a new Update Records node seeded nothing, and Filter keys were free text with no suggestions. Authors had to know to type id with the CEL source record.id.
    • A new update_record node on a record-triggered flow now starts on the trigger's object. The seed runs at creation only, and opening a node writes nothing.
    • On an empty filter, the node offers "Update the triggering record", which writes the spec's own guided shape (filter: { id: { dialect: 'cel', source: 'record.id' } }). Any filter the author wrote is left alone.
    • Filter and Field values keys are picked by label, and the API name is still what gets stored.
    • The saved flow passes the real FlowSchema plus the @objectstack/lint publish verdict, with a blank-expression control. Ablations were run on all three behaviours, and each fails its own tests.
  • Gates (check-runs on the head): 44 success, 11 skipped, 0 failure; mergeable_state clean. check-governed-merges --pr 27930: NOT governed (0 of 13 paths), 635 changed lines.
  • Accepted deviations: the seed lives at node creation (previews/flow-canvas-parts.tsx and the two FlowCanvas.tsx call sites), outside the claim's inspectors/** surface. The seat widened the surface to those files before the edit. The three updated pins are re-pointed controls, not loosened ones: their update_record cases move to delete_record/create_record, and a stub covers the new useObjectFields read.
  • Out of scope: create_record Field values keep the text box, as the order keeps other node types unchanged. The Acceptance notes name the one-line follow-up.
  • Landing: non-governed, all checks green, mergeable_state clean ⇒ the seat lands it (pr_ready + automerge_enable).

Generated by Claude Code

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/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant