Skip to content

Follow-up: isolate EmailBuilder editor Zustand store per surface #149

Description

@patoperpetua

Context

PR #142 ports the EmailBuilder.js MUI sample with a module-level Zustand singleton (editorStateStore). That matches the upstream sample and PostKit’s supported embed model: a single EmailTemplateAdmin / EmailBuilderMuiSurface per page.

CodeRabbit flagged that mounting two editable surfaces would share document/selection/drawers and could cross-fire onChange.

Goal

  • Create the store per surface instance
  • Provide via React context
  • Bind hooks/actions to the provider
  • Add a regression test: two canvases, edit one, other document + callback unchanged

Non-goals

  • Redesigning the admin catalog UX
  • Changing the public EmailTemplateAdmin API beyond what isolation requires

Parent: #138
Related: #142

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions