feat(approvals): annotate approver value + escalateTo as typed references#1414
Merged
Conversation
…nces Adds `xRef` annotations to two Approval-node config strings so the Studio flow designer renders pickers instead of free text (ADR-0018 §configSchema), mirroring the existing `approvalStatusField` annotation: - `approvers[].value` — a *polymorphic* reference (`kindFrom: 'type'`): the concrete picker follows the sibling `type` column (user / role / team / department / queue), or an object-field picker resolved from the flow's `$trigger` object when `type` is `field`. `manager` and any unmapped value carry no `value` and stay free text. - `escalation.escalateTo` — a `role` reference (the common case); free text is still accepted for a specific user id. Both fold the annotation and description into a single `.meta()` so neither is dropped from the published `z.toJSONSchema` config contract. Consumed by the companion objectui PR's reference pickers.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
xRefannotations to two Approval-node config strings so the Studio flow designer renders pickers instead of free text (ADR-0018 §configSchema), mirroring theapprovalStatusFieldannotation already onmain.approvers[].value— a polymorphic reference (kindFrom: 'type'): the concrete picker follows the siblingtypecolumn (user / role / team / department / queue), or an object-field picker resolved from the flow's$triggerobject whentypeisfield.managerand any unmapped value carry novalueand stay free text.escalation.escalateTo— arolereference (the common case); free text is still accepted for a specific user id.Both fold the annotation and description into a single
.meta()so neither is dropped from the publishedz.toJSONSchemaconfig contract.Scope
One file (
packages/spec/src/automation/approval.zod.ts), 28+/2−. Branched off currentorigin/main; structurally identical to the existingapprovalStatusField.meta({ description, xRef }).Companion
Consumed by objectui PR objectstack-ai/objectui#1424 (polymorphic reference pickers). The frontend degrades gracefully without these annotations.
Test plan
xRefannotations survivez.toJSONSchema(ApprovalNodeConfigSchema, { io: 'input' })with their descriptions preserved.