-
Notifications
You must be signed in to change notification settings - Fork 0
feat: send schema preview to storm #876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes wire a StreamDocument through the Editor component hierarchy to LayoutEditor and into useLayoutMessageReceivers to enable schema resolution based on document metadata. A new FieldsOverride component is introduced to handle Advanced Settings panel rendering with custom schema markup field handling and navigation. The getSchema utility is simplified by removing conditional path computation logic and now accepts pre-computed paths directly. These modifications establish an end-to-end flow for resolving and communicating schemas to parent contexts. Sequence DiagramsequenceDiagram
participant Parent
participant Editor
participant LayoutEditor
participant useLayoutMessageReceivers
Editor->>LayoutEditor: Pass streamDocument prop
Parent->>LayoutEditor: Send "resolveSchema" message
LayoutEditor->>useLayoutMessageReceivers: Invoke with streamDocument
useLayoutMessageReceivers->>useLayoutMessageReceivers: Extract path from streamDocument.metadata<br/>(locator/dm_ vs other)
useLayoutMessageReceivers->>useLayoutMessageReceivers: Augment streamDocument with path<br/>and fallback siteDomain
useLayoutMessageReceivers->>useLayoutMessageReceivers: Resolve schema via resolveSchemaJson
useLayoutMessageReceivers->>Parent: Send resolved schema via "resolveSchema" channel
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🧰 Additional context used🧠 Learnings (2)📚 Learning: 2025-11-06T14:55:12.385ZApplied to files:
📚 Learning: 2025-11-04T21:23:36.061ZApplied to files:
🧬 Code graph analysis (4)packages/visual-editor/src/internal/puck/components/FieldsOverride.tsx (1)
packages/visual-editor/src/internal/hooks/layout/useMessageReceivers.ts (3)
packages/visual-editor/src/internal/components/InternalLayoutEditor.tsx (1)
packages/visual-editor/src/internal/components/LayoutEditor.tsx (1)
🔇 Additional comments (3)
Comment |
Sends/receives iframe messages to resolve schema for the Schema Drawer preview in storm
Also moves the advanced settings override to it's own file and switches to usePuck to fix some issues with the schema drawer re-mounting and then not saving properly