Skip to content

web: scale the automation canvas as one diagram - #1821

Merged
nikhilunni merged 1 commit into
mainfrom
web/automation-canvas-zoom
Nov 19, 2026
Merged

nikhilunni merged 1 commit into
mainfrom
web/automation-canvas-zoom

Conversation

@nikhilunni

Copy link
Copy Markdown
Contributor

Problem

The Build tab's canvas squished and clipped nodes when the canvas column was narrow. Each way in got an equal-width column, and each canvas scaled itself to its column. With several ways in, a column was narrower than its flow even at the minimum scale (50%). The nodes were then cut off inside a small per-column scroll box, and different columns could show different scales.

Change

The diagram is now one picture with one zoom.

  • One scale. A new ZoomFrame scales every way in, the agent stubs, the bus and the agent node with one transform. Each column is as wide as its canvas, so no node is clipped.
  • Fit. "Fit" picks the largest scale in [50%, 100%] that fits the width, and centres a diagram that is narrower than the view. Below 50% the text is not legible, so the row scrolls sideways.
  • Pan. A drag on the empty ground pans the scroll area.
  • Zoom controls. The controls show the current scale. "+" and "−" step from the scale on screen (before, they jumped to 100% first). Each button is disabled at its limit, and "Fit" shows when it is active.
  • Add another way in moves to the toolbar as an anchored popover, so it no longer takes width from the row.
  • AgentBus takes the widths of the first and last columns, because the columns are no longer equal.

Canvas loses its own scroll box, scale and zoom prop. It now draws at its natural size.

Validation

  • pnpm format:check, pnpm lint (no new warnings), pnpm build.
  • vitest run src/pages/automations: 159 tests pass, including the new ZoomFrame.test.tsx (fit, both limits, stepping, and returning to Fit).
  • Manual browser check with four ways in, a branch and an agent. A wide view fits at 69% with no clipping. A narrow view stops at 50% and scrolls sideways, and drag-to-pan works. Zoom-in from the fitted scale steps to the next level. The popover anchors to its button.

🤖 Generated with Claude Code

The Build tab gave each way in an equal-width column and scaled each
canvas to its own column. With several ways in, a column was narrower
than its flow even at the minimum scale, so nodes were clipped inside a
per-column scroll box, and columns could show different scales.

Now a ZoomFrame scales the whole diagram (every way in, the agent stubs,
the bus, the agent) with one transform. Each column is as wide as its
canvas. "Fit" picks the largest scale in [50%, 100%] that fits the
width and centres the diagram; below 50% the row scrolls. A drag on the
empty ground pans. The zoom controls show the scale and step from the
scale on screen. "Add another way in" moves to the toolbar as a
popover, so it no longer takes width from the row. AgentBus takes the
first and last column widths, because columns are no longer equal.

Review pass: removed the per-canvas scroll and scale code from Canvas
and its zoom prop; no other findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nikhilunni
nikhilunni merged commit de94914 into main Nov 19, 2026
27 checks passed
@nikhilunni
nikhilunni deleted the web/automation-canvas-zoom branch November 19, 2026 14:54
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