[Preview NG] Migrate Perseus to the new preview system#3581
[Preview NG] Migrate Perseus to the new preview system#3581jeremywiebe wants to merge 8 commits intojer/preview-ng-7.5-typed-onchangefrom
Conversation
🗄️ Schema Change: No Changes ✅ |
|
Size Change: +399 B (+0.08%) Total Size: 504 kB 📦 View Changed
ℹ️ View Unchanged
|
🛠️ Item Splitting: No Changes ✅ |
a0b8f9f to
2d5913f
Compare
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (9c745c5) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3581If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3581If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3581 |
…storybook preview to new preview system
…view-page.tsx comments
…s changes from teh AI
abdc9f8 to
a366962
Compare
| }; | ||
|
|
||
| // Store refs for preview iframes (keyed by section index or "all") | ||
| private frameRefs: Record<string, PreviewWithIframeRef | null> = {}; |
There was a problem hiding this comment.
This moves us away from string refs (see _updatePreviewFrames in it original form)
…grate-storybook-preview] Migrate storybook preview page from iframeDataStore to usePreviewPresenter hook
…that isn't needed
ba3e0e6 to
56420cb
Compare
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Summary:
This PR is part of a series building a typed, hook-based preview system for the Perseus editor. The new system replaces the untyped
window.iframeDataStore+ rawpostMessage(string)communication with structured, validated message passing viausePreviewControllerandusePreviewPresenterhooks. The new system is being built alongside the old one — no existing behavior changes until the final PR in the series flips the switch.Previous PRs in this series:
This is the Preview NG changeover PR! After this lands, Perseus will be exclusively using the new Preview communication system (no more legacy
iframeDataStore+ string-postMessage preview protocol). This means that all Storybook preview code now uses the newusePreviewPresenterhook, and all four editors (EditorPage,ArticleEditor,HintEditor,ItemEditor) switch fromIframeContentRenderertoPreviewWithIframe(introduced in #3578).The legacy
IframeContentRendererremains because some client's still use it directly. When this change is released, I will switch clients over as part of the Perseus release. The legacy component will be deleted in a later cleanup pass once that's done.Screen.Recording.2026-05-06.at.1.20.24.PM.mov
NOTE: the issue of the keypad being clipped by the preview iframe is a longstanding issue and is unrelated to the changes in this PR.
Issue: LEMS-3741
Test plan:
pnpm tsccleanpnpm lintclean for touched filespnpm testmain.