Commit Graph
2 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 4.7 26f41a8122 fix(portal): workflows layout — canvas collapsed to 0 width
ci / test (pull_request) Failing after 4m55s
ci / shared (pull_request) Successful in 11s
ci / e2e (pull_request) Has been skipped
ci / image (pull_request) Has been skipped
The workflows route layout used `display: flex` on the wrapper without
giving the `.flow` child `flex: 1`. With Flexbox's default
`flex: 0 1 auto`, the child shrunk to its non-flex content — palette
(234px) + inspector (286px) = 520px — leaving the canvas wrap at width 0.
Nodes, toolbar and zoom controls were positioned absolutely against a
0-wide parent so nothing painted.

Fix: drop `display: flex` on the wrapper. `.flow` already has
`display: flex; height: 100%` and as a block-level child it fills the
width naturally.

Verified via Playwright: canvas-wrap now 1168×746 and all 7 seed nodes
render at expected positions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 16:04:26 +02:00
Sharang ParnerkarandClaude Opus 4.7 a03aa0a4c4 feat(portal): M10.2 — workflows node-graph editor
ci / shared (pull_request) Successful in 11s
ci / test (pull_request) Failing after 4m56s
ci / e2e (pull_request) Has been skipped
ci / image (pull_request) Has been skipped
Builds the §3 workflows editor as a client component at
`/[slug]/workflows`. IT_ADMIN only. Full-bleed layout (own
`layout.tsx`) — palette (234px) + canvas (flex) + inspector (286px).

* `src/lib/flow-modules.ts` — TS port of the handoff `FLOW_MODULES`
  catalog: 18 modules across Triggers / Scanner / CERTifAI / Logic /
  Actions, each with kind-colored monogram, input/output ports, and a
  typed settings schema (select / text / num / area / toggle). Helpers
  for `nodeH`, `portX/Y`, `defConfig`, `wirePath` (bezier), `seedFlow`
  (7-node sample workflow), `modsByCat`. KIND_COLOR token map.
* `src/components/portal/workflows/WorkflowEditor.tsx` — client
  component with:
  - Palette: collapsible category tree, draggable items, kind-colored
    dots and monos.
  - Canvas: dotted grid that pans (drag background) and zooms (+/− with
    `Maximize2` reset, 0.5–1.6). Floating toolbar = workflow name input
    (running pulse on the dot during a test run) + node/link count +
    Validate / Save / **Test run** buttons. Save respects the frozen
    write-guard; Test run highlights nodes in BFS order from triggers
    with animated wires (`.wire.run` keyframes already in globals.css).
  - Nodes: 202px cards with kind-bordered monogram + title, first-config
    value or `desc` in the body, input ports on left, output ports on
    right (multi-output gates labeled PASS/FAIL, etc.). Drag to move,
    click to select. Delete/Backspace removes selection.
  - Wires: bezier paths via `wirePath`. Drag output port → input port
    creates an edge (replaces existing edges into that input). Click to
    select. Pending wire shows dashed.
  - Inspector: live form against `selNode.config` driven by the module's
    settings schema. Per-type fields (select / text / num / area /
    toggle). Empty state shows the kind legend; edge selection shows a
    delete-link affordance.
  - Toasts: inline bottom-right queue with mono status-code footer for
    the workflow actions (`workflow.valid`, `workflow.saved`,
    `workflow.tested`, `402 → reactivation.requested` when frozen).
* `src/app/[slug]/workflows/layout.tsx` — strips `.content-inner` and
  fills `position: absolute; inset: 0` so the editor's 3-column flex
  fills the entire content area.

The page returns 200 against `BP_DEV_FIXTURE=admin-acme` with every
flow-* class marker present.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 15:52:07 +02:00