Skip to content

V3: stable artboard - #167

Merged
git-chad merged 40 commits into
git-chad/shader-lab-v3-planfrom
git-chad/v3-stable-artboard
Oct 1, 2026
Merged

git-chad merged 40 commits into
git-chad/shader-lab-v3-planfrom
git-chad/v3-stable-artboard

Conversation

@git-chad

Copy link
Copy Markdown
Collaborator

Adds a stable artboard (roadmap 2.8). Screen (adaptive) remains the previous behavior: the canvas follows the viewport, and older scenes and the demo keep it. Every other Aspect (16:9, 9:16, 4:3, 3:4, 1:1, Custom) is now a fixed document whose size is the saved composition, editable in Scene → Composition → Size. The editor fits and centers the artboard in the viewport with a pasteboard and refits on window or sidebar changes; passes receive the document as their logical size, so masks, Cells paint, text and exports coincide with the preview. Switching presets crops the current document to the new ratio.

Behavior changes to flag:

  • New blank projects and first visits start on a 16:9 1920×1080 artboard instead of adaptive.
  • Older files with a non-Screen aspect used to show a guide frame over an adaptive canvas; they now open as a real artboard of that ratio (their export adopts that size). Their width/height are normalized from the saved composition on import.
  • public/examples/v3 studies are now Custom 720×960, so they stop reframing.
  • The community scene player letterboxes fixed-artboard scenes; adaptive scenes still fill it. Not covered by tests (needs the database).

Undo safety: history stores the scene config but not the output size, so preset artboards derive their size from the scene config when its ratio matches, and fall back to cropping the saved composition otherwise.

Validation:

  • bun run check — passes; the same three preexisting lint warnings.
  • bun run test:composition — full suite passes, including tests/composition/artboard.mjs (document resolution and cropping, fitting, composition update rules, save/reopen, legacy fixture stays adaptive, blank default). Legacy baselines untouched.
  • bun tests/composition/artboard-ui.mjs — actual editor: fitted 3:4 artboard, window resize keeps the mask at the same artboard position and the saved composition unchanged, 16:9 crop to 720×405, adaptive fallback fills the viewport, undo restores the artboard, the Color Field study opens fixed. clean-projects-ui.mjs still passes.

Stacked on #166 (git-chad/v3-gradient-map), within integration #150. Nothing merges to main before V3 is complete. Focused user test: tests/composition/ARTBOARD-MANUAL-QA.md. Shape layers (2.7) follow on this base.

@vercel

vercel Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
shader-lab Ready Ready Preview Oct 1, 2026 7:06am UTC

@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 3/5

The PR is not yet safe to merge because undo can retain stale output dimensions and legacy Custom projects can reopen at the wrong document size.

Summary

This PR introduces fixed, fitted artboards for every non-Screen composition aspect and propagates document dimensions through preview, export, persistence, examples, and the community player.

  • Adds document-size resolution, preset cropping, viewport fitting, and composition editing.
  • Keeps Screen mode adaptive while making new projects default to a 1920×1080 artboard.
  • Adds automated and manual artboard coverage.
  • Two compatibility gaps remain in history restoration and legacy Custom imports.

Reviews (1) · Last reviewed commit: "Add a stable artboard with fixed documen..."

Comment thread src/store/editor-store.ts
Comment thread src/lib/editor/composition.ts
…roup failures

Media load callbacks now ignore replaced or removed passes and pending loads are cleared on disposal. Strict-mode pass failures are reported once at the originating pass instead of at every group boundary.
Publishing now drops every descendant of a hidden group and clears the
parentId of any retained layer (the audio source) whose parent was removed,
so the published scene passes hierarchy validation on reopen.
Cap the neighbor row and column search to two cells each side so the
worst-case cellAt count per fragment is 25 instead of unbounded in the
packed minimum-size, maximum-stroke configuration. Mirrored in the
runtime package.
…e on buttons

Clear the active paint layer when the layer stops being paintable (selection,
mode, visibility or lock change) so Paint never resumes without Edit Paint.
Only preventDefault on Space for non-interactive targets so focused buttons
and links still activate.
Create the .context artifact directory up front and pick the history shortcut modifier from the platform.
Importing a project now disarms the armed remix draft and clears the remix origin alongside the active draft, so later edits cannot autosave under the previous remix title.
…handle unmount

Mask coordinates are now measured against the composition crop frame in the
renderer and the handles overlay, so preview and export agree when the
viewport and composition aspect ratios differ.
Unmounting the handles mid-drag no longer writes the drag-start mask back,
which overwrote the result of an undo.
… imports

- Recompute outputSize from the restored scene config when applying a history snapshot
- Normalize Custom imports whose saved composition differs from the guide size, keeping fixed Custom documents intact
@git-chad
git-chad force-pushed the git-chad/v3-gradient-map branch from 60506af to 60d45d6 Compare October 1, 2026 07:04
@git-chad
git-chad force-pushed the git-chad/v3-stable-artboard branch from 949228c to 9058815 Compare October 1, 2026 07:04
@git-chad
git-chad changed the base branch from git-chad/v3-gradient-map to git-chad/shader-lab-v3-plan October 1, 2026 15:13
@git-chad
git-chad merged commit 9058815 into git-chad/shader-lab-v3-plan Oct 1, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 90588159 Deployed Oct 1, 2026 by vercel[bot]
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