Skip to content

fixes issues with canvas registering multiple times - #51

Merged
Sam Beveridge (00salmon) merged 1 commit into
mainfrom
fix-empty-canvas
Oct 6, 2026
Merged

Sam Beveridge (00salmon) merged 1 commit into
mainfrom
fix-empty-canvas

Conversation

@00salmon

@00salmon Sam Beveridge (00salmon) commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description of the change

Fixes issue with empty canvas + incorrectly loaded layouts

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation or Development tools (readme, specs, tests, code formatting)

Links

  • Jira issue number: (PUT IT HERE)
  • Process.st launch checklist: (PUT IT HERE)

Checklists

Development

  • Prettier was run (if applicable)
  • The behaviour changes in the pull request are covered by specs
  • All tests related to the changed code pass in development

Paperwork

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has a Jira number
  • This pull request has a Process.st launch checklist

Code review

  • Changes have been reviewed by at least one other engineer
  • Security impacts of this change have been considered

Copilot AI balanced review requested due to automatic review settings October 6, 2026 22:14
@changeset-bot

changeset-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 58ce6e3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@raisins/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Later molecule lookups receive fresh atoms while registrations remain bound to stale atoms from the first lookup.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Adds per-canvas registration deduplication for canvas plugins.

Changes:

  • Introduces registerOnce using owner identity.
  • Migrates built-in plugins and story renderers.
  • Adds registration-count tests and a Changeset.
File Description
.changeset/​canvas-register-once.md Documents the new API.
packages/​react/​src/​index.stories.tsx Deduplicates style renderer registration.
packages/​react/​src/​canvas/​CanvasController-Template.stories.tsx Deduplicates root renderer registration.
packages/​react/​src/​canvas/​CanvasScopeMolecule.tsx Implements registerOnce.
packages/​react/​src/​canvas/​CanvasScopeMolecule.test.tsx Tests registration counts.
packages/​react/​src/​canvas/​plugins/​CanvasHoveredMolecule.ts Groups hover registrations.
packages/​react/​src/​canvas/​plugins/​CanvasPickAndPlopMolecule.tsx Groups pick-and-plop registrations.
packages/​react/​src/​canvas/​plugins/​CanvasSelectionMolecule.tsx Groups selection registrations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/react/src/canvas/CanvasScopeMolecule.tsx
Comment thread packages/react/src/canvas/CanvasScopeMolecule.test.tsx
@00salmon
Sam Beveridge (00salmon) merged commit 7d51120 into main Oct 6, 2026
6 checks passed
@00salmon
Sam Beveridge (00salmon) deleted the fix-empty-canvas branch October 6, 2026 22:57
@github-actions github-actions Bot mentioned this pull request Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants