-
Notifications
You must be signed in to change notification settings - Fork 0
fix: promoSection migration with Video / Image #857
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
WalkthroughTwo migration files were updated to simplify slot presence and data selection. In the promo migration, VideoSlot and ImageSlot are now always-present arrays; slot contents internally select between video vs image via Sequence Diagram(s)sequenceDiagram
autonumber
participant Migrator as Migration Script
participant OldSlots as Old Slot Structure
participant NewSlots as New Slot Structure
note right of OldSlots `#E8F3FF`: Old flow — conditional slots
Migrator->>OldSlots: Evaluate isVideo
alt isVideo true
OldSlots-->>Migrator: Provide VideoSlot (present), ImageSlot omitted
else isVideo false
OldSlots-->>Migrator: Provide ImageSlot (present), VideoSlot omitted
end
note right of NewSlots `#F6FFF0`: New flow — always-present slots with internal selection
Migrator->>NewSlots: Evaluate isVideo (uses optional chaining)
NewSlots-->>Migrator: Provide VideoSlot array (assetVideo guarded by isVideo)
NewSlots-->>Migrator: Provide ImageSlot array (image fields chosen based on isVideo)
sequenceDiagram
autonumber
participant Migrator as Migration Script
participant OldCards as Old CardsWrapperSlot
participant NewCards as New CardsWrapperSlot
note right of OldCards `#FFF7E6`: Old flow — conditional constantValue
Migrator->>OldCards: Check constantValueEnabled
alt enabled
OldCards-->>Migrator: constantValue = cards.map(id)
else disabled
OldCards-->>Migrator: constantValue = []
end
note right of NewCards `#F0F7FF`: New flow — unconditional constantValue
Migrator->>NewCards: Build constantValue
NewCards-->>Migrator: constantValue = cards.map(id) (always)
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 (1)
🔇 Additional comments (2)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/visual-editor/src/components/migrations/0029_promo_section_slots.ts(1 hunks)packages/visual-editor/src/components/migrations/0036_testimonials_section_slots.ts(1 hunks)
🔇 Additional comments (1)
packages/visual-editor/src/components/migrations/0036_testimonials_section_slots.ts (1)
160-160: LGTM: cards constantValue now mirrors rendered IDsThe array now stays in sync with the generated card props, which should keep the wrapper’s constant value accurate after migration.
Fixed PromoSection migration so after migration u can still toggle between video + image.
Also adjusted testimonialSectionSlot's constantValue for cardsWrapper.
Before
After