This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
test(app-shell): pin the flow-node label at the producer, not the reader - #6979
Merged
Merged
Conversation
FlowNodeSchema requires `label`; the designer's FlowDesignerNode makes it optional, and that is a layer difference, not drift. Both hold only if something guarantees a node acquires a label before save. Census of every flow-node construction path: six node literals across five producer call sites, all already writing a label — but three of the five were enforced only by accident (deleting the label line from insertOnEdge and from FlowPreview.handleAddNode left vitest, tsc and eslint all green on main). Adds flow-node-producers.label.test.tsx: each producer driven through its real affordance with the emitted node safeParse'd whole against the spec, plus a source census that refuses a node literal writing no label. Records on FlowDesignerNode.label why the reader-side type stays optional (a cast bypasses a required member; the optional type forces two real absent-label guards).
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #6331
The census, and the number first
Six flow-node literals across five producer call sites. Every one already writes a
label. So this lands the fork's first arm: a producer-boundary pin plus the recorded reason the reader type stays optional. No live defect to grade as a Bug.Pathspec bound — the census is not "I grepped around". Three complementary searches over the tracked tree at
7a5da1414(git ls-files= 5885 files; 4692 under the source/data extensions), each carrying a hot control:: (FlowDesignerNode|FlowNodeLike|FlowNode) = {*.ts,*.tsx,*.js,*.mjs,*.cjsFlowCanvas.tsx:273addNode✅nodesarray (nodes: [,.nodes.push(,[...nodes,,appendArray(nodes,spliceArray(nodes)FlowCanvas.tsx:281+FlowPreview.tsx:144✅type: '<one of the 20 FLOW_BUILTIN_NODE_TYPES>')*.json,*.yml,*.yaml(0 hits — no flow fixtures on disk)apps/console/src/preview-samples.ts✅The third search is the one that earned its keep: it surfaced
buildFlowSkeleton, which ahead-capped grep had hidden from me a step earlier. A zero from a truncated pipe reads exactly like a zero from a clean tree.The producers, and what enforces each
FlowCanvas.addNode— palette pick and the+append handledefaultNodeLabel(type, locale)FlowCanvas.insertOnEdge— "Insert node here"defaultNodeLabel(type, locale)FlowCanvas.addReviseLoop— the ADR-0044 one-click looptr('engine.flowCanvas.awaitingRevision')flow-canvas-seeds.spec-parse.test.tsxclicks the real button andsafeParses the emitted nodeFlowPreview.handleAddNode— the empty-flow seeddefaultNodeLabel('start', locale)buildFlowSkeleton— Studio "New flow" (mints 2 nodes)startLabel/endLabelcreateConformance.test.tsparses the whole draftNot producers, checked and excluded with the reason:
FlowCanvas.persistPosition,deleteNode, andflow-nested-selection.ts's nested writes — all re-spread an existing node ({ ...node, position }) or filter. They cannot be where a label is first written, and cannot drop one:FlowNodeInspector.patchNodeis{ ...node, ...updates }.anchors.tsflowcreateDefaults— seedsnodes: []. No node.flow-region-view.tsx— nested regions render read-only ("no drag / insert"), so there is no nested-node producer.ProcessDesigner's BPMN clipboard, and that isBPMNNodefrom@object-ui/types(a different shape,labelalready required there) with no path to a flow save.0hits).apps/console/src/preview-samples.ts— read-only gallery data, not an authoring path.⭐ "They all happen to" vs "something prevents otherwise" — measured, not argued
That distinction is the whole value of the census, so it was taken as a measurement on
origin/main, before any change here. Deleting thelabelline frominsertOnEdgeand fromFlowPreview.handleAddNode(mutation proved on disk in both directions: anchor counts 1→0, replacement marker 0→1, and blob hashes moved) left everything green:Three of five producers were held only by every current author happening to write the line. That is the finding, and it is why the pin is at the producer.
Why not the reader type — do not re-litigate
FlowNodeSchemarequireslabel;FlowDesignerNodemakes it optional. That is a layer difference the repo already adjudicated in that interface's own doc comment — a canvas holds nodes the user has dropped but not finished. #6287 measured making it required on the reader side:tscexit 0, zero errors, because every node arrives throughas FlowNodeLike[]casts out ofRecord<string, unknown>and a cast bypasses a required member. It is also mildly harmful:node.label ?? ''andnode.label || node.idare guards the optional type forces. So this PR touches no declared type — Clause-② staysno. The reasoning is now recorded onFlowDesignerNode.labelitself, which is what stops the question being opened a third time.What the pin is
flow-node-producers.label.test.tsx, in two halves, because neither is enough alone:safeParsed whole against the spec. ⛔ Never a hand-composed node — the sibling seeds file composes{ id, type, label: defaultNodeLabel(type), ...defaultNodeExtras(type) }itself, which is right for its subject (the seed extras) and is exactly why it stayed green through the ablation above: it supplies the label, so it can never see a producer drop one.previews/,inspectors/andstudio-design/and refuses one that writes no label, with a hot control so a scan that matches nothing fails loudly instead of reading as clean. Its blind spot (an untyped literal assembled elsewhere and cast in) is stated in the file.Two-world proof, on the committed pin, restoring by hash equality:
addNodedropslabel(blobefc46c8f, byte-identical run)FlowCanvas.addNode+ the census ratchetinsertOnEdge+FlowPreview.handleAddNode+buildFlowSkeletondroplabelQuestion 3 — what the server does
@objectstack/spec@17.2.0(lockfile-resolved) by probe:So a label-less node is refused at the flow level too. Two related readings, both stated so they are not mistaken for the pin's subject:
clientValidation.tsmapsflow → FlowSchema, on both the create and edit doors), andflow-problems.tsmaps anodes.<n>.…path onto that node — so the refusal already surfaces as an on-canvas badge and a Problems-panel row while the author types.FlowNodeSchemaacceptslabel: '', and the inspector's Label field commitspatchNode({ label: v })— so clearing it yields an empty string, never an absent key. Noted, not changed: making non-empty a rule would be a second de-facto contract this card did not ask for.Verification
All on the final commit
8cf0859a6, exit codes captured before any pipe, each result quoted from the gate's own verdict line.pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build, exit 0) — the worktree had nodistanywhere, and an unbuilt run reads as a false red.Test Files 8 passed (8)/Tests 146 passed (146).tsc -p packages/app-shell/tsconfig.test.json --noEmit→ exit 0.--listFilesconfirms both changed files are in the checked program (1 hit each), so the green is a measurement rather than an exclusion.eslint .over the wholepackages/app-shellpackage, unnarrowed — population read from eslint's own config via--format json: 1026 files, 0 errors, 2798 pre-existing warnings, and both of this PR's files contribute 0 errors and 0 warnings.check:control-bytesOK (5802 files) ·check:spec-symbols0 untriaged collisions ·check:vi-mock-specifiersOK ·check:vi-mock-inheritOK ·check:i18n-keysOK ·check:phantom-depsOK ·check-changeset-presenceOK (1 changeset, empty frontmatter — the explicit "releases nothing" exemption) ·check-changeset-no-majorOK.Changeset carries an empty frontmatter: a test plus a comment, no runtime behaviour and no published type changed.
Generated by Claude Code