You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
What can the Unlayer editor do for live AI edits? #300
What can the Unlayer email editor, as PostHog embeds it, do for an AI that edits the open email live?
Can code select, highlight or scroll to one block (by its design id) inside the editor iframe?
Can code update one block or a part of the design without loadDesign reloading the whole editor, and without a visible flash?
Does the editor's undo history cover a design loaded or changed from code, so one AI turn undoes in one step?
Can code lock the editor (read-only) and unlock it?
Which editor events report a user's change, a load, and a selection?
Which of these depend on the Unlayer plan or version PostHog uses?
Sources: Unlayer's documentation and changelog, and how EmailTemplater (frontend/src/scenes/hog-functions/email-templater/) embeds the editor today. Feeds both prototypes.
No documented public commands select, highlight or scroll to a block by design ID. item:selected exists in the published API types, but needs verification against the loaded builder.
setBodyValues updates body settings. No general host API patches a paragraph, button or row. PostHog applies external designs through loadDesign. No-flash behavior is not guaranteed.
Native undo covers user edits. The docs do not establish history behavior for loadDesign or one-step undo for a host AI turn. Keep a host snapshot covering subject, preheader, body and every changed email.
Template permissions can lock elements. setDesignMode switches between editable live and admin modes. No documented global runtime read-only setter exists. Changes and loads use design:updated, design:loaded and editor:ready; PostHog already uses these and filters load echoes.
Unlayer's built-in Assistant streams design operations, but PostHog disables it. It needs an eligible paid plan, project ID and user ID. Its host-generation callback returns one final result, not a stream. PostHog locks wrapper 1.7.11 and types 1.501.0, while the unpinned builder defaults to stable, currently 1.489.0. Actual runtime version and plan entitlement are unverified.
Use a preview layer during the PostHog AI turn for streaming text, changed-block highlights and scrolling. Keep the editor mounted and hide the final design load behind that preview. A prototype must prove the lock, undo and no-flash behavior.
Activity
Silthus commentedon Oct 6, 2026
Note
🤖 GPT-6.1 Sol responding on behalf of Michael
Resolved in research/unlayer-live-edit.md.
item:selectedexists in the published API types, but needs verification against the loaded builder.setBodyValuesupdates body settings. No general host API patches a paragraph, button or row. PostHog applies external designs throughloadDesign. No-flash behavior is not guaranteed.loadDesignor one-step undo for a host AI turn. Keep a host snapshot covering subject, preheader, body and every changed email.setDesignModeswitches between editable live and admin modes. No documented global runtime read-only setter exists. Changes and loads usedesign:updated,design:loadedandeditor:ready; PostHog already uses these and filters load echoes.