Skip to content

feat(core): multi-board layout — rows, vertical stacks, grids (0.4.0) - #12

Merged
daniellee-ux merged 2 commits into
mainfrom
claude/scene-vertical-stacking-b9b6b5
Jul 31, 2026
Merged

daniellee-ux merged 2 commits into
mainfrom
claude/scene-vertical-stacking-b9b6b5

Conversation

@daniellee-ux

Copy link
Copy Markdown
Owner

What

Multiple Scenes in one design could only auto-flow into a single horizontal row, so a design could not place a new version beneath an existing set of boards. This adds a configurable board arrangement.

export const layout: BoardLayout

Field Default Meaning
direction 'row' Flow axis — row left→right, column top→bottom
wrap none Wrap onto a new line after N boards
gap / crossGap 96 / gap Gap along the flow axis / between lines
align 'center' Cross-axis alignment of unequal boards inside a line
justify 'start' A short line's placement along the flow axis

Scene.break — start a new line at this board; the local alternative to a module-wide wrap, and the way to author uneven rows (6 then 5).

export const layout: BoardLayout = { wrap: 6 };   // 6 per row, the 7th drops below
// or, without touching the module layout:
V7.break = true;

Defaults reproduce the previous layout exactly: one row, 96px gaps, shorter boards vertically centered.

Notes

  • Positions stay baked into the boards returned by layoutBoards, so the Stage render and zoom-to-board (viewport.fitTo) keep one source of truth.
  • Lines stay in scene order, so DOM order — and therefore export order and the layers panel — are unchanged.
  • Also bumps @opencanva/core and create-opencanva to 0.4.0 (wrapper dep → ^0.4.0). Not yet published to npm.

Verification

Ran a 7-board scratch design on the dev server:

  • 6 in a row + the 7th directly below (via break, and via wrap: 6)
  • wrap: 3 grid, direction: 'column' stack, direction: 'column', wrap: 4
  • align: 'start', justify: 'center', custom gap/crossGap
  • Measured offsets (0,60) (696,0) … (0,616) — the taller board still centers in its row; row 2 starts at 520 + 96
  • Zoom-to-board from the layers panel frames a second-row board correctly
  • window.__ox.lint() → 0 issues, no console errors

Local CI equivalents pass: core/demo/template typechecks, check:sync, check-template-scaffold.mjs.

🤖 Generated with Claude Code

daniellee-ux and others added 2 commits July 31, 2026 21:42
Multiple Scenes could only auto-flow into one horizontal row, so a design
could not put a new version directly beneath an existing set of boards.

`layoutBoards` now splits scenes into lines and flows them along a
configurable axis:

- `export const layout: BoardLayout` — `direction` (row/column), `wrap`
  (boards per line), `gap`/`crossGap`, `align` (cross-axis within a line),
  `justify` (a short line along the flow axis).
- `Scene.break` — start a new line at this board, the local alternative to
  a module-wide `wrap` and the way to author uneven rows (6 then 5).

Defaults reproduce the old layout exactly: one row, 96px gaps, shorter
boards vertically centered. Positions stay baked into the returned boards,
so Stage's render and zoom-to-board (viewport.fitTo) keep one source of
truth, and lines stay in scene order — export and DOM order are unchanged.

Documented in the canva-authoring skill (new "Arranging multiple boards"
section), create-design, and the README; skills re-synced.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Minor bump for both packages: the multi-board layout feature (BoardLayout /
Scene.break — rows, vertical stacks, grids) landed since 0.3.0 and is
additive, so existing designs are unaffected.

create-opencanva's @opencanva/core dependency moves to ^0.4.0 to match, per
the established publish order (core first, verify it is live, then the
wrapper pinned to it) — a caret on ^0.3.0 would keep scaffolding the old
core.

Publishing to npm is not done in this commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@daniellee-ux
daniellee-ux merged commit f6c81a3 into main Jul 31, 2026
1 check passed
@daniellee-ux
daniellee-ux deleted the claude/scene-vertical-stacking-b9b6b5 branch July 31, 2026 16:45
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