Skip to content

fix(canvas): repair React Flow v12 and dependency upgrade regressions - #7355

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/canvas-reactflow-styling
Sep 1, 2026
Merged

fix(canvas): repair React Flow v12 and dependency upgrade regressions#7355
waleedlatif1 merged 2 commits into
stagingfrom
fix/canvas-reactflow-styling

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Fix the workflow canvas rendering light-mode block chrome on the dark theme: React Flow v12 stamps its colorMode class (default light) on the .react-flow wrapper, which cancels every dark: Tailwind utility under our :not(:where(.light, .light *)) dark variant — the canvas now derives colorMode from the app theme (editor, log preview, and docs previews)
  • Restore the hand-designed canvas z-scale: v12's default zIndexMode: 'basic' adds a parented node's internal z to every touching edge, lifting container edges above the cards they must render behind — all ReactFlow mounts now pass zIndexMode={CANVAS_Z_INDEX_MODE} exported beside the z-scale in @sim/workflow-renderer
  • Carry measured forward in reconcileCanvasNodes (with a selection override for paste/duplicate) so v12 doesn't wipe handle bounds and re-measure on every node re-derivation
  • Switch block node seeds from top-level width/height (fixed inline styles in v12) to initialWidth/initialHeight, preserving v11 seed-then-measure sizing
  • Replace the v11-only [data-parent-node-id] CSS hook with an app-stamped .subflow-child-node class in both the editor and preview canvases; drop the inert edgesReconnectable prop
  • Externalize pdfjs-dist in next.config.ts and trigger.config.ts — pdf.js resolves its worker via a runtime-relative dynamic import that breaks when bundled (the reason unpdf was external before)
  • Restore ffmpeg's -y -nostdin (lost with fluent-ffmpeg; an existing output otherwise prompts on an unread stdin pipe and hangs) as shared FFMPEG_BASE_ARGS, and keep trim on output-side -ss for frame-accurate starts
  • Drop --frozen-lockfile from docker/realtime.Dockerfile (same pruned-lockfile fix already applied to the app and db images)
  • Point devcontainer drizzle commands at packages/db via new db:generate and the existing db:push scripts (the old apps/sim config no longer exists, and db:push also runs the resource-policy reconcile)
  • Harden the email boundary test to catch render imported from the react-email meta-package, restore the officeparser default-function module shape, stop /demo from crashing at module scope on a malformed Cal link env var, and align the @next/env pin in packages/sim-setup

Type of Change

  • Bug fix

Testing

Type-check across sim, docs, and workflow-renderer; affected vitest suites (canvas helpers, viewport, ffmpeg, extractor, email boundary, officeparser, demo scheduler, workflow-renderer, docs preview) all green; bun run lint, check:audits (40/40), and check:api-validation pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner September 1, 2026 17:51
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 1, 2026 5:56pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR repairs regressions introduced by React Flow v12 and related dependency upgrades.

  • Synchronizes React Flow color mode and restores manual canvas z-index behavior across editor and preview surfaces.
  • Preserves measured node dimensions, selection state, nested-node styling hooks, and seed-then-measure sizing.
  • Restores noninteractive FFmpeg overwrite behavior and frame-accurate trimming.
  • Corrects PDF.js deployment configuration, database development commands, parser compatibility, and supporting dependency pins.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Integrates theme-aware React Flow rendering, manual z-index behavior, nested-node classes, initial dimensions, and measurement-preserving reconciliation.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-canvas-helpers.ts Adds the nested-node class identifier and preserves measured dimensions and selection overrides during reconciliation.
apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/preview-workflow.tsx Applies matching color mode, z-index mode, and nested-node metadata to workflow previews.
apps/sim/lib/media/ffmpeg.ts Restores shared overwrite and stdin flags while retaining output-side seeking for accurate trim starts.
apps/sim/next.config.ts Externalizes pdfjs-dist so its runtime worker resolution remains available after bundling.
packages/workflow-renderer/src/canvas-layers.ts Exposes the manual React Flow z-index mode alongside the shared canvas layer scale.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Theme[Application theme] --> Mode[Canvas color mode]
  Mode --> RF[React Flow mounts]
  Layers[Shared canvas z-scale] --> Manual[Manual z-index mode]
  Manual --> RF
  Derived[Derived workflow nodes] --> Reconcile[Node reconciliation]
  Measured[Measured dimensions] --> Reconcile
  Selection[Pending selection] --> Reconcile
  Reconcile --> RF
Loading

Reviews (3): Last reviewed commit: "fix(trigger): keep pdfjs-dist external t..." | Re-trigger Greptile

Comment thread apps/sim/app/_styles/globals.css
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 26 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/trigger.config.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@cubic review

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 26 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 36a4b6a into staging Sep 1, 2026
24 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/canvas-reactflow-styling branch September 1, 2026 18:00
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