Repository navigation
feat(core): multi-board layout — rows, vertical stacks, grids (0.4.0) - #12
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: BoardLayoutdirection'row'rowleft→right,columntop→bottomwrapgap/crossGap96/gapalign'center'justify'start'Scene.break— start a new line at this board; the local alternative to a module-widewrap, and the way to author uneven rows (6 then 5).Defaults reproduce the previous layout exactly: one row, 96px gaps, shorter boards vertically centered.
Notes
layoutBoards, so the Stage render and zoom-to-board (viewport.fitTo) keep one source of truth.@opencanva/coreandcreate-opencanvato 0.4.0 (wrapper dep →^0.4.0). Not yet published to npm.Verification
Ran a 7-board scratch design on the dev server:
break, and viawrap: 6)wrap: 3grid,direction: 'column'stack,direction: 'column', wrap: 4align: 'start',justify: 'center', customgap/crossGap(0,60) (696,0) … (0,616)— the taller board still centers in its row; row 2 starts at 520 + 96window.__ox.lint()→ 0 issues, no console errorsLocal CI equivalents pass: core/demo/template typechecks,
check:sync,check-template-scaffold.mjs.🤖 Generated with Claude Code