Repository navigation
feat(flow designer): edge conditions as field rows, and an approval inserts with approve and reject edges - #34932
Conversation
…tcome edges Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgae1jRRi8FRrTxaZL
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgae1jRRi8FRrTxaZL
…rmula; builder opens leftward Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgae1jRRi8FRrTxaZL
|
repo:objectstack#3 · os-support-ai · session_01WGufzgae1jRRi8FRrTxaZL Live readings for #34932 (slice 2 of #34818). They were taken on the slice 2 commits over Setup:
The two author-named edge pills ( |
|
repo:objectstack#3 · os-support-ai · session_01WGufzf35CD4CvA4nKbwwUn L1: ACCEPT What I read at this head:
The head merges cleanly with current main. Shape
The code reads right
Live readings (6954346552)They are in zh-CN and en, and cover:
They were taken on the same three commits over d947a93, and the card thread states that no flow-designer file changed between that base and e05445e. Notes
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgae1jRRi8FRrTxaZL Landing #34932 (slice 2 of #34818) at head
State: ready for review and auto-merge enabled. #34818 stays open for slice 3 ( |
Brings in #34932 (flow designer edge conditions), which lands before this PR. Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz Co-authored-by: Claude <noreply@anthropic.com>
…oval outcome After the merge of #34932 an approval's approve/reject out-edges render the designer's localized outcome pill, so the label-translation pin asserts the authored text on a decision branch edge instead. Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz Co-authored-by: Claude <noreply@anthropic.com>
Requested by Yibo Wang · project thread
repo:objectstack#3 · os-support-ai · session_01WGufzgae1jRRi8FRrTxaZL
Part of #34818 (slice 2 of 3: items 3 and 4; slice 3 takes items 5 to 9 and closes the card).
Clause-②: no
Metadata-protocol: none
维护者速读
record.due_date != null && record.due_date > today()。id)在后;有显示名的字段以显示名为主,内部路径做小字。flow-node-config.ts,第 3 片本来就要改)。What changes
Edge conditions as field rows (item 3).
inspectors/flow-edge-condition-rows.tsbridges a guard and theFilterBuilder's rows. It is imported from@object-ui/componentsand not edited.rowsToCelwrites one fixed spelling per operator. Ordering,betweenand the string methods are null-guarded (S != null && …), the guard the server's null-guard gate asks for (objectstack#27513). Empty checks follow the spec'sexpandEmptyOperatortable inConditionBuilder's clauses. A date column's relative points become the formula stdlib's calendar calls ({today}→today(),{yesterday}→daysAgo(1),{tomorrow}→daysFromNow(1)).icontains, a datetime or time literal (datetime-localhas no zone), a relative window onbetween, an operator the builder does not offer for the column, or a comparison on a multi-value column.celToRowsreads a stored guard back only when re-writing the rows it read gives back the same bytes. Anything else answersnull.FlowEdgeInspector.tsxgainsEdgeConditionEditor.VariableTextInputformula input is shown, with the guard unchanged.writeExpressionSource, so a stored envelope keeps its dialect.TriggerScope.fieldPrefix+ name), by label, business fields first.Reference picker (item 3).
flow-scope.ts:isPlatformField(the servedsystemflag,id, or the spec'sFIELD_GROUP_SYSTEM_FIELDS) andbusinessFieldsFirst.triggerFieldRefslists business fields first and gives a labelled field its label aslabel.VariableTextInput.tsx: a ref whose label differs from its token shows the label as main text, with the token muted beside it. Refs with no name of their own (variables, outputs) render as before.Approval outcomes (item 4).
FlowCanvas.tsx:approvalOutcomesbuilds theapproveandrejectedges and the new end nodes.insertOnEdgeandaddNodeuse it for anapproval. Every other type inserts as before.approve/reject/revisepills read in the designer's language, with the keyword kept in the title.FlowPreview.tsx:mintNodeIdtakesalsoTaken, so one gesture mints distinct ids that still respect the session ledger (os build --json's failure payloads carry nowarnings, so the truncation notice's--jsonpointer is a dead end when a later gate fails #11772).flow-problems.ts:approvalOutcomeProblemsadds onewarningper missingapprove/rejectout-edge, targeted at the node.reviseis not asked for.flow-canvas-parts.tsx: comment only.studiokeys in en and zh (edge condition modes and notes, the two end labels, the problem sentence).Tests
inspectors/flow-edge-condition-rows.test.ts(44 tests), with the read-back pinned both ways:null, including near misses of the writer's own spellings (unguarded ordering, extra parentheses, double quotes, spacing, a quoted number, mixed joins,vars.*,previous.*, a bare field);@objectstack/formulacelEngine) evaluates "date after today" true for tomorrow, false for yesterday and for null, and the null-guarded text and list spellings on null.inspectors/FlowEdgeInspector.conditionRows-34818.test.tsx(6 tests):inspectors/flow-scope.test.ts: ordering, labels,isPlatformField.previews/FlowCanvas.approvalOutcomes-34818.test.tsx(5 tests): insert on a connection, append, the plain-node control, ids that skip the session ledger, and the pill words with a control.previews/flow-problems.approvalOutcomes-34818.test.ts(4 tests): both missing, one missing (case and space tolerant), both present, and the control on other node types.inspectors/inspectorStrings.i18n-10748.test.tsx.Ablations (
scripts/ablation-replace.mjs, each restored to HEAD and verified):triggerFieldRefswithoutbusinessFieldsFirstflow-scopetests redcelToRowswithout the byte-equality checkinsertOnEdgeapproval branch offaddNode)approvalOutcomeProblemsnot pushedVariableTextInputlabel branch offshowRows = false)Acceptance notes
showcase_task, stored asrecord.due_date != null && record.due_date > today();approveto the next step andrejectto a new 已驳回 end, and the pills read 通过 / 驳回.Verification
Measured on head
cbb82b02c(basee05445e4f), on a shared box.pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin packages/i18ngave 850 files, 9940 passed and 14 skipped, exit 0. The same run on the previous based947a93cfgave 849 files. Its one red,inspectorStrings.i18n-10748, is the updated file listed under Tests.pnpm --filter @object-ui/app-shell type-check(both projects) exit 0. A first run failed inAiChatPage.tsxonpublishFromShellBar. The cause was aplugin-chatbotdist built before main added that prop. Afterpnpm --filter @object-ui/plugin-chatbot buildit exits 0. No file of this PR is involved.d947a93cf, all run.check:test-source-aliasasked for a module-topimport '@objectstack/lint'in the updatedinspectorStrings.i18n-10748test.check:dts-closurereported a missingui/apps/console/plugin.d.ts, local tree state left by an earlier gate's consolevite build. Afterbuild:pluginit exits 0.check-partof-closing-keywordexited 0 with this body asPR_BODY.check-closing-target-claimandcheck-single-claim-paths.e05445e4f, which brought two shared studio i18n files, these were re-run with exit 0:check-changeset-no-major,check-empty-changeset,check:changeset-fixed,check:i18n-stale-fillandcheck:test-source-alias.studionamespace, and no eager pack changed.pnpm --filter @objectstack/example-showcase dev -- --fresh), the console under Vite withDEV_PROXY_TARGET, and Playwright at 1280×860 with zh-CN and en. The flow is a draft onshowcase_task(record-after-create). The readings are in the comment below, and the screenshots and script are in the seat's project files underobjectstack-seat3/34818-live/slice2/(zh-1…zh-7,en-1…en-7).test:repoand the dogfood battery (no!and no(narrowing)arm).