Skip to content

feat(renderer)!: multi-page canvas with bounded layout output (3.0.0)#35

Merged
Seungwoo321 merged 3 commits into
mainfrom
develop
May 8, 2026
Merged

feat(renderer)!: multi-page canvas with bounded layout output (3.0.0)#35
Seungwoo321 merged 3 commits into
mainfrom
develop

Conversation

@Seungwoo321
Copy link
Copy Markdown
Contributor

Summary

  • BREAKING: renderCanvas no longer emits chrome / grid / labels. Output is a single bounded <div class="wf-canvas"> containing absolutely-positioned <div class="wf-canvas-board"> wrappers. Hosts (dashboard infinite-canvas viewer, markdown-plugin, vscode-extension, SVG export) own chrome, grid, pan-zoom, and labels.
  • New page "X" at(x, y) { ... } grammar — explicit canvas placement; pages without at(...) auto-flow horizontally with configurable gap (default 64px).
  • New primitives: renderPage(page) (single-page export), renderCanvas(doc, opts?) (multi-page composition), layoutCanvas(pages, gap?) (pure utility for hosts to compose their own DOM). PlacedPage type exported.
  • Boards expose data-page-x / data-page-y / data-page-w / data-page-h / data-page-title attributes for host-DOM communication.
  • Version: 2.8.03.0.0.

Migration

  • renderCanvas(doc, { chrome: 'editor' })renderCanvas(doc) — host applies its own chrome (Figma-style grid is the dashboard editor's responsibility, landing in a follow-up PR).
  • chrome: 'preview' consumers (markdown-plugin, vscode-extension) already work — they don't pass chrome and now receive bare bounded layout.
  • CanvasChrome type and chrome / canvasBackground options on CanvasOptions are removed.

Test plan

  • pnpm test — 639/639 tests passing locally
  • pnpm build — TypeScript + DTS build clean
  • tsc --noEmit — clean
  • Storybook captures verified (Playwright MCP) — bounded layout matches design intent
  • CI green
  • After merge: bump @wireweave/core to ^3.0.0 in dependent repos via scripts/update-core-deps.sh
  • After merge: patch api-server/src/services/guide.ts lines 545/547/549 (chrome guide strings) — affected scope already audited (only api-server has chrome-related guide text; markdown-plugin / vscode-extension / dashboard / admin / examples / ux-rules / language-data are clean)

🤖 Generated with Claude Code

BREAKING CHANGE: renderCanvas no longer emits chrome / grid / labels.
The renderer now produces a single bounded `<div class="wf-canvas">` of the
exact layout extent containing absolutely-positioned `<div class="wf-canvas-board">`
wrappers. Hosts (dashboard infinite-canvas viewer, markdown-plugin, vscode-extension,
SVG export) are responsible for chrome, grid, pan-zoom, and labels.

Removed:
- `CanvasChrome` type and `chrome` / `canvasBackground` options on `CanvasOptions`
- chrome routing in `render()` / `renderToSvg()`

Added:
- `page "X" at(x, y) { ... }` grammar — canvas coordinates resolved into
  `Page.x` / `Page.y` for explicit placement; pages without `at(...)` auto-flow
  horizontally with configurable gap (default 64px)
- `renderPage(page)` — pure single-page export primitive
- `renderCanvas(doc, opts?)` — multi-page composition (gap-only options)
- `layoutCanvas(pages, gap?)` — pure utility that returns `{ placed, width, height }`
  so hosts can compose their own DOM
- `PlacedPage` public type
- `data-page-x` / `data-page-y` / `data-page-w` / `data-page-h` /
  `data-page-title` attributes on each board for host-DOM communication

Migration:
- `renderCanvas(doc, { chrome: 'editor' })` → `renderCanvas(doc)` and let the host
  apply its own chrome (Figma-style grid is the dashboard editor's responsibility)
- `chrome: 'preview'` consumers (markdown-plugin, vscode-extension preview)
  already work — they don't pass `chrome` and now receive bare bounded layout
Seungwoo321 and others added 2 commits May 8, 2026 21:16
Manually setting package.json to 3.0.0 caused release-it to compute
3.0.0 + BREAKING -> 4.0.0-beta.0 instead of the intended 2.8.0 -> 3.0.0-beta.0.
Restoring to 2.8.0 so release-it can auto-bump from the actual prior release.
@Seungwoo321 Seungwoo321 merged commit 57c0d1d into main May 8, 2026
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