Skip to content

fix(ui): workflow builder live defects — canvas height and save 400s - #155

Merged
BMJLearnToHelloWorld merged 1 commit into
mainfrom
fix/workflow-builder-live-defects
Nov 6, 2026
Merged

BMJLearnToHelloWorld merged 1 commit into
mainfrom
fix/workflow-builder-live-defects

Conversation

@BMJLearnToHelloWorld

Copy link
Copy Markdown
Owner

Fix: Workflow Builder live defects — blank canvas and Save/Test 400s

Live interactive walkthrough (Playwright redo, 2026-11-07, REPORT.md Step 4)
found the merged #150 Builder unusable as shipped: the canvas paints blank
(.vue-flow computes to 0px) and Save PUT / Test /validate both return
400. This PR fixes the four pinned root causes. No behavior is invented:
every serializer change restores the stored entity shape the server accepts
(stored-shape PUT → 200 in the walkthrough bisection).

1. Canvas height — WorkflowCanvas.vue

The wrapper's height can sit on its min-height: 420px floor (not a definite
height), so the library's .vue-flow { height: 100% } resolves to 0px and
overflow: hidden clips every node. Fix mirrors the verified LineageGraph
pattern in the same repo (live: .vue-flow 635px, renders fine):
.workflow-canvas becomes a flex-column container and .vue-flow a flex
item (flex: 1 1 auto; min-height: 0), so its size comes from flex layout,
not percentage resolution.

2. Defect A — stored user-task subtype discarded

mapNodeTypeAndSubtype hardcoded subType = 'userApprovalTask', dropping
the stored createRecognizerFeedbackApprovalTask. Schema mechanism
(openmetadata-spec/.../nodes/userTask/*.json, pin a3012259ca): the
specific schema's input allows 4 items and its inputNamespaceMap requires
all 4 keys; the generic schema caps input at 1 item and its namespace at
relatedEntity — so coercing the subtype makes the stored input/namespace
illegal and the PUT 400s. The specific subtype is now preserved (unknown
values still fall back to the generic name).

Required companion (otherwise A itself regresses): configureUserTaskIO
now applies the approval config for both approval subtypes via the new
shared predicate isUserApprovalTaskSubType — without it a specific-subtype
node would save with an empty config (assignees is required → 400).

3. Defect B — emptyAssigneeStrategy injected

applyUserApprovalConfig defaulted
emptyAssigneeStrategy: ... ?? 'none'. The specific-subtype schema's
assignees is additionalProperties: false without that property → 400.
The ...assigneesFromNode spread already carries it when the stored config
has it (all live generic-subtype definitions do); when absent the generic
schema defaults it server-side. candidates: [] is kept (allowed by the
specific schema).

4. Defect C + node descriptions — trigger output and description

  • Trigger output was hardcoded to ['relatedEntity', 'updatedBy'],
    dropping triggeringObjectId + recognizerFeedback (stored: 4 items).
    The save now round-trips the stored trigger.output — only when the
    trigger type is unchanged (a type change rebuilds the trigger, so the
    stored outputs no longer describe it); otherwise it falls back to the
    default pair.
  • Node descriptions typed in the form were dropped at save: the node
    schemas declare description, so getNodeConfiguration (task nodes)
    and buildWorkflowNodes (start/end nodes) now carry it through when
    present, and omit it when blank (seed nodes carry none).

Out of scope (recorded, not fixed here)

  • UI create-workflow bare POST → 500 (getTrigger() null server NPE):
    separate residual, needs official create-flow analysis first.
  • Node input lists truncated on save (stored 4 items → emitted 1):
    the walkthrough control PUTs return 200, so not a 400 cause; observed
    round-trip lossiness, left for a later decision.
  • Load-path === 'userApprovalTask' checks (resolveUpdatedByNamespace,
    migrateWorkflowInputNamespaceMap, condition modal, form dispatch):
    the load path always saw the stored specific subtype, so fix A does not
    change their behavior; left untouched (see FIX.md).

Alignment degree (vs official pin a3012259ca)

  • Canvas height: product-owned styling issue; fixed with the repo's own
    verified LineageGraph pattern. No official counterpart to compare.
  • Serializer A/B/C + descriptions: fidelity to the stored entity, which
    the server validates against the pin's per-subtype schemas
    (createRecognizerFeedbackApprovalTask.json,
    userApprovalTask.json, endEvent.json). No official behavior is
    invented; no official UI code is copied beyond what WorkflowBuilder port (Vue 3): official OSS builder 1:1 (S1+S2+S3) #150 already ported.

Tests

  • 8 new cases, all passing: workflowValidation.test.ts (specific subtype
    preserved + approval config, trigger output round-tripped, default output
    on trigger-type change, node descriptions carried) and
    workflowNodeUtils.test.ts (specific-subtype approval config without the
    injected property, stored property carried for the generic subtype,
    description carried/omitted, predicate itself).
  • workflowSerializer.test.ts (live 21 definitions round-trip): 2 cases
    (AutoPilotWorkflow, RecognizerFeedbackReviewWorkflow) failed before this
    fix because their assertions pinned the buggy behavior (hardcoded 2-item
    output, subtype collapsed to generic, 'none' default). Retargeted at
    the same strength to the stored values; the other 19 cases pass
    unchanged. See FIX.md for the per-assertion retarget list.
  • Canvas CSS cannot be asserted in jsdom (no layout engine); the existing
    WorkflowCanvas.test.ts cases pass with no regression. Live re-verification
    without the forced-height workaround follows merge + frontend deploy.

Gates (branch head dabec147e480)

  • Vitest (4 related files): 68 passed, 0 failed
  • npm run build: pass, 9.18s
  • Real typecheck vue-tsc --noEmit -p tsconfig.app.json: 233 errors,
    byte-identical to the main 023a0e1f baseline (0 new, 0 removed)
    ,
    0 errors in touched files. Full Vitest suite not run (related files only,
    per task scope).

@BMJLearnToHelloWorld
BMJLearnToHelloWorld merged commit 6b9faf3 into main Nov 6, 2026
54 checks passed
@BMJLearnToHelloWorld
BMJLearnToHelloWorld deleted the fix/workflow-builder-live-defects branch November 12, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant